diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 44a647676fd5..654376987382 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -231,7 +231,7 @@ importers: version: file:projects/arm-containerservicefleet.tgz '@rush-temp/arm-cosmosdb': specifier: file:./projects/arm-cosmosdb.tgz - version: file:projects/arm-cosmosdb.tgz + version: file:projects/arm-cosmosdb.tgz(msw@2.6.8(@types/node@22.7.9)(typescript@5.7.2))(vite@5.4.11(@types/node@22.7.9)) '@rush-temp/arm-cosmosdbforpostgresql': specifier: file:./projects/arm-cosmosdbforpostgresql.tgz version: file:projects/arm-cosmosdbforpostgresql.tgz @@ -2732,7 +2732,7 @@ packages: version: 0.0.0 '@rush-temp/arm-cosmosdb@file:projects/arm-cosmosdb.tgz': - resolution: {integrity: sha512-OrO8Gtlec2DgGUqu/bAelwZ/7QtHLWHEO8GRp6leoDkMPWu2CtRgMfNEK1RPhHTdDDmbTxr7H2gM2X6kW5ds5w==, tarball: file:projects/arm-cosmosdb.tgz} + resolution: {integrity: sha512-cSPC4jbGfSubLak2/CA0k7BZPxEe8anbRVm7Yez2jfroCkk37J+YCsulwQrb5B5MBGE2zGVN+HNFJApIh0dvQw==, tarball: file:projects/arm-cosmosdb.tgz} version: 0.0.0 '@rush-temp/arm-cosmosdbforpostgresql@file:projects/arm-cosmosdbforpostgresql.tgz': @@ -11486,25 +11486,37 @@ snapshots: - '@swc/wasm' - supports-color - '@rush-temp/arm-cosmosdb@file:projects/arm-cosmosdb.tgz': + '@rush-temp/arm-cosmosdb@file:projects/arm-cosmosdb.tgz(msw@2.6.8(@types/node@22.7.9)(typescript@5.7.2))(vite@5.4.11(@types/node@22.7.9))': dependencies: - '@azure-tools/test-credential': 1.3.1 - '@azure-tools/test-recorder': 3.5.2 '@azure/core-lro': 2.7.2 - '@types/chai': 4.3.20 - '@types/mocha': 10.0.10 '@types/node': 18.19.68 - chai: 4.5.0 + '@vitest/browser': 2.1.8(@types/node@18.19.68)(playwright@1.49.1)(typescript@5.6.3)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8) + '@vitest/coverage-istanbul': 2.1.8(vitest@2.1.8) dotenv: 16.4.7 - mocha: 11.0.2 - ts-node: 10.9.2(@types/node@18.19.68)(typescript@5.7.2) + playwright: 1.49.1 tslib: 2.8.1 tsx: 4.19.2 - typescript: 5.7.2 + typescript: 5.6.3 + vitest: 2.1.8(@types/node@18.19.68)(@vitest/browser@2.1.8)(msw@2.6.8(@types/node@22.7.9)(typescript@5.7.2)) transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' + - '@edge-runtime/vm' + - '@vitest/ui' + - bufferutil + - happy-dom + - jsdom + - less + - lightningcss + - msw + - safaridriver + - sass + - sass-embedded + - stylus + - sugarss - supports-color + - terser + - utf-8-validate + - vite + - webdriverio '@rush-temp/arm-cosmosdbforpostgresql@file:projects/arm-cosmosdbforpostgresql.tgz': dependencies: @@ -20350,6 +20362,27 @@ snapshots: '@ungap/structured-clone@1.2.1': {} + '@vitest/browser@2.1.8(@types/node@18.19.68)(playwright@1.49.1)(typescript@5.6.3)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8)': + dependencies: + '@testing-library/dom': 10.4.0 + '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) + '@vitest/mocker': 2.1.8(msw@2.6.8(@types/node@22.7.9)(typescript@5.7.2))(vite@5.4.11(@types/node@22.7.9)) + '@vitest/utils': 2.1.8 + magic-string: 0.30.15 + msw: 2.6.8(@types/node@18.19.68)(typescript@5.6.3) + sirv: 3.0.0 + tinyrainbow: 1.2.0 + vitest: 2.1.8(@types/node@22.7.9)(@vitest/browser@2.1.8)(msw@2.6.8(@types/node@22.7.9)(typescript@5.7.2)) + ws: 8.18.0 + optionalDependencies: + playwright: 1.49.1 + transitivePeerDependencies: + - '@types/node' + - bufferutil + - typescript + - utf-8-validate + - vite + '@vitest/browser@2.1.8(@types/node@18.19.68)(playwright@1.49.1)(typescript@5.7.2)(vite@5.4.11(@types/node@22.7.9))(vitest@2.1.8)': dependencies: '@testing-library/dom': 10.4.0 @@ -22745,6 +22778,31 @@ snapshots: ms@2.1.3: {} + msw@2.6.8(@types/node@18.19.68)(typescript@5.6.3): + dependencies: + '@bundled-es-modules/cookie': 2.0.1 + '@bundled-es-modules/statuses': 1.0.1 + '@bundled-es-modules/tough-cookie': 0.1.6 + '@inquirer/confirm': 5.1.0(@types/node@18.19.68) + '@mswjs/interceptors': 0.37.3 + '@open-draft/deferred-promise': 2.2.0 + '@open-draft/until': 2.1.0 + '@types/cookie': 0.6.0 + '@types/statuses': 2.0.5 + chalk: 4.1.2 + graphql: 16.9.0 + headers-polyfill: 4.0.3 + is-node-process: 1.2.0 + outvariant: 1.4.3 + path-to-regexp: 6.3.0 + strict-event-emitter: 0.5.1 + type-fest: 4.30.1 + yargs: 17.7.2 + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - '@types/node' + msw@2.6.8(@types/node@18.19.68)(typescript@5.7.2): dependencies: '@bundled-es-modules/cookie': 2.0.1 diff --git a/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md b/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md index 581fe8bc8146..3eeb4f95b1a0 100644 --- a/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md +++ b/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md @@ -1,5 +1,370 @@ # Release History +## 16.3.0-beta.1 (2024-12-19) +Compared with version 16.2.0 + +### Features Added + + - Added operation group ChaosFault + - Added operation group DataTransferJobs + - Added operation group GraphResources + - Added operation group NetworkSecurityPerimeterConfigurations + - Added operation group ThroughputPool + - Added operation group ThroughputPoolAccount + - Added operation group ThroughputPoolAccounts + - Added operation group ThroughputPools + - Added operation CassandraClusters.beginInvokeCommandAsync + - Added operation CassandraClusters.beginInvokeCommandAsyncAndWait + - Added operation CassandraClusters.getBackup + - Added operation CassandraClusters.getCommandAsync + - Added operation CassandraClusters.listBackups + - Added operation CassandraClusters.listCommand + - Added operation CassandraResources.beginCreateUpdateCassandraView + - Added operation CassandraResources.beginCreateUpdateCassandraViewAndWait + - Added operation CassandraResources.beginDeleteCassandraView + - Added operation CassandraResources.beginDeleteCassandraViewAndWait + - Added operation CassandraResources.beginMigrateCassandraViewToAutoscale + - Added operation CassandraResources.beginMigrateCassandraViewToAutoscaleAndWait + - Added operation CassandraResources.beginMigrateCassandraViewToManualThroughput + - Added operation CassandraResources.beginMigrateCassandraViewToManualThroughputAndWait + - Added operation CassandraResources.beginUpdateCassandraViewThroughput + - Added operation CassandraResources.beginUpdateCassandraViewThroughputAndWait + - Added operation CassandraResources.getCassandraView + - Added operation CassandraResources.getCassandraViewThroughput + - Added operation CassandraResources.listCassandraViews + - 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.beginMongoDBDatabasePartitionMerge + - Added operation MongoDBResources.beginMongoDBDatabasePartitionMergeAndWait + - Added operation MongoDBResources.beginMongoDBDatabaseRedistributeThroughput + - Added operation MongoDBResources.beginMongoDBDatabaseRedistributeThroughputAndWait + - Added operation MongoDBResources.beginMongoDBDatabaseRetrieveThroughputDistribution + - Added operation MongoDBResources.beginMongoDBDatabaseRetrieveThroughputDistributionAndWait + - 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.beginSqlDatabasePartitionMerge + - Added operation SqlResources.beginSqlDatabasePartitionMergeAndWait + - Added operation SqlResources.beginSqlDatabaseRedistributeThroughput + - Added operation SqlResources.beginSqlDatabaseRedistributeThroughputAndWait + - Added operation SqlResources.beginSqlDatabaseRetrieveThroughputDistribution + - Added operation SqlResources.beginSqlDatabaseRetrieveThroughputDistributionAndWait + - Added operation TableResources.beginCreateUpdateTableRoleAssignment + - Added operation TableResources.beginCreateUpdateTableRoleAssignmentAndWait + - Added operation TableResources.beginCreateUpdateTableRoleDefinition + - Added operation TableResources.beginCreateUpdateTableRoleDefinitionAndWait + - Added operation TableResources.beginDeleteTableRoleAssignment + - Added operation TableResources.beginDeleteTableRoleAssignmentAndWait + - Added operation TableResources.beginDeleteTableRoleDefinition + - Added operation TableResources.beginDeleteTableRoleDefinitionAndWait + - Added operation TableResources.getTableRoleAssignment + - Added operation TableResources.getTableRoleDefinition + - Added operation TableResources.listTableRoleAssignments + - Added operation TableResources.listTableRoleDefinitions + - Added Interface AccessRule + - Added Interface AccessRuleProperties + - Added Interface AccessRulePropertiesSubscriptionsItem + - Added Interface AzureBlobDataTransferDataSourceSink + - Added Interface BackupResource + - Added Interface BackupSchedule + - Added Interface BaseCosmosDataTransferDataSourceSink + - Added Interface CapacityModeChangeTransitionState + - Added Interface CassandraClustersGetBackupOptionalParams + - Added Interface CassandraClustersGetCommandAsyncOptionalParams + - Added Interface CassandraClustersInvokeCommandAsyncHeaders + - Added Interface CassandraClustersInvokeCommandAsyncOptionalParams + - Added Interface CassandraClustersListBackupsOptionalParams + - Added Interface CassandraClustersListCommandOptionalParams + - Added Interface CassandraResourcesCreateUpdateCassandraViewHeaders + - Added Interface CassandraResourcesCreateUpdateCassandraViewOptionalParams + - Added Interface CassandraResourcesDeleteCassandraViewHeaders + - Added Interface CassandraResourcesDeleteCassandraViewOptionalParams + - Added Interface CassandraResourcesGetCassandraViewOptionalParams + - Added Interface CassandraResourcesGetCassandraViewThroughputOptionalParams + - Added Interface CassandraResourcesListCassandraViewsOptionalParams + - Added Interface CassandraResourcesMigrateCassandraViewToAutoscaleHeaders + - Added Interface CassandraResourcesMigrateCassandraViewToAutoscaleOptionalParams + - Added Interface CassandraResourcesMigrateCassandraViewToManualThroughputHeaders + - Added Interface CassandraResourcesMigrateCassandraViewToManualThroughputOptionalParams + - Added Interface CassandraResourcesUpdateCassandraViewThroughputHeaders + - Added Interface CassandraResourcesUpdateCassandraViewThroughputOptionalParams + - Added Interface CassandraViewCreateUpdateParameters + - Added Interface CassandraViewGetPropertiesOptions + - Added Interface CassandraViewGetPropertiesResource + - Added Interface CassandraViewGetResults + - Added Interface CassandraViewListResult + - Added Interface CassandraViewResource + - Added Interface ChaosFaultEnableDisableOptionalParams + - Added Interface ChaosFaultGetOptionalParams + - Added Interface ChaosFaultListNextOptionalParams + - Added Interface ChaosFaultListOptionalParams + - Added Interface ChaosFaultListResponse + - Added Interface ChaosFaultResource + - Added Interface CommandAsyncPostBody + - Added Interface CommandPublicResource + - Added Interface CosmosCassandraDataTransferDataSourceSink + - Added Interface CosmosMongoDataTransferDataSourceSink + - Added Interface CosmosMongoVCoreDataTransferDataSourceSink + - Added Interface CosmosSqlDataTransferDataSourceSink + - Added Interface CreateJobRequest + - Added Interface DataTransferDataSourceSink + - Added Interface DataTransferJobFeedResults + - Added Interface DataTransferJobGetResults + - Added Interface DataTransferJobProperties + - Added Interface DataTransferJobsCancelOptionalParams + - Added Interface DataTransferJobsCompleteOptionalParams + - Added Interface DataTransferJobsCreateOptionalParams + - Added Interface DataTransferJobsGetOptionalParams + - Added Interface DataTransferJobsListByDatabaseAccountNextOptionalParams + - Added Interface DataTransferJobsListByDatabaseAccountOptionalParams + - Added Interface DataTransferJobsPauseOptionalParams + - Added Interface DataTransferJobsResumeOptionalParams + - Added Interface DiagnosticLogSettings + - Added Interface GraphResource + - Added Interface GraphResourceCreateUpdateParameters + - Added Interface GraphResourceGetPropertiesOptions + - Added Interface GraphResourceGetPropertiesResource + - Added Interface GraphResourceGetResults + - Added Interface GraphResourcesCreateUpdateGraphHeaders + - Added Interface GraphResourcesCreateUpdateGraphOptionalParams + - Added Interface GraphResourcesDeleteGraphResourceHeaders + - Added Interface GraphResourcesDeleteGraphResourceOptionalParams + - Added Interface GraphResourcesGetGraphOptionalParams + - Added Interface GraphResourcesListGraphsOptionalParams + - Added Interface GraphResourcesListResult + - Added Interface ListBackups + - Added Interface ListCommands + - Added Interface MaterializedViewDefinition + - Added Interface MergeParameters + - Added Interface MongoDBResourcesListMongoDBCollectionPartitionMergeHeaders + - Added Interface MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams + - Added Interface MongoDBResourcesMongoDBContainerRedistributeThroughputHeaders + - Added Interface MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams + - Added Interface MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionHeaders + - Added Interface MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams + - Added Interface MongoDBResourcesMongoDBDatabasePartitionMergeHeaders + - Added Interface MongoDBResourcesMongoDBDatabasePartitionMergeOptionalParams + - Added Interface MongoDBResourcesMongoDBDatabaseRedistributeThroughputHeaders + - Added Interface MongoDBResourcesMongoDBDatabaseRedistributeThroughputOptionalParams + - Added Interface MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionHeaders + - Added Interface MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionOptionalParams + - Added Interface NetworkSecurityPerimeter + - Added Interface NetworkSecurityPerimeterConfiguration + - Added Interface NetworkSecurityPerimeterConfigurationListResult + - Added Interface NetworkSecurityPerimeterConfigurationProperties + - Added Interface NetworkSecurityPerimeterConfigurationsGetOptionalParams + - Added Interface NetworkSecurityPerimeterConfigurationsListNextOptionalParams + - Added Interface NetworkSecurityPerimeterConfigurationsListOptionalParams + - Added Interface NetworkSecurityPerimeterConfigurationsReconcileHeaders + - Added Interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams + - Added Interface NetworkSecurityProfile + - Added Interface PermissionAutoGenerated + - Added Interface PhysicalPartitionId + - Added Interface PhysicalPartitionStorageInfo + - Added Interface PhysicalPartitionStorageInfoCollection + - Added Interface PhysicalPartitionThroughputInfoProperties + - Added Interface PhysicalPartitionThroughputInfoResource + - Added Interface PhysicalPartitionThroughputInfoResult + - Added Interface PhysicalPartitionThroughputInfoResultPropertiesResource + - Added Interface ProvisioningIssue + - Added Interface ProvisioningIssueProperties + - Added Interface RedistributeThroughputParameters + - Added Interface RedistributeThroughputPropertiesResource + - Added Interface ResourceAssociation + - Added Interface RetrieveThroughputParameters + - Added Interface RetrieveThroughputPropertiesResource + - Added Interface SqlResourcesListSqlContainerPartitionMergeHeaders + - Added Interface SqlResourcesListSqlContainerPartitionMergeOptionalParams + - Added Interface SqlResourcesSqlContainerRedistributeThroughputHeaders + - Added Interface SqlResourcesSqlContainerRedistributeThroughputOptionalParams + - Added Interface SqlResourcesSqlContainerRetrieveThroughputDistributionHeaders + - Added Interface SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams + - Added Interface SqlResourcesSqlDatabasePartitionMergeHeaders + - Added Interface SqlResourcesSqlDatabasePartitionMergeOptionalParams + - Added Interface SqlResourcesSqlDatabaseRedistributeThroughputHeaders + - Added Interface SqlResourcesSqlDatabaseRedistributeThroughputOptionalParams + - Added Interface SqlResourcesSqlDatabaseRetrieveThroughputDistributionHeaders + - Added Interface SqlResourcesSqlDatabaseRetrieveThroughputDistributionOptionalParams + - Added Interface TableResourcesCreateUpdateTableRoleAssignmentHeaders + - Added Interface TableResourcesCreateUpdateTableRoleAssignmentOptionalParams + - Added Interface TableResourcesCreateUpdateTableRoleDefinitionHeaders + - Added Interface TableResourcesCreateUpdateTableRoleDefinitionOptionalParams + - Added Interface TableResourcesDeleteTableRoleAssignmentHeaders + - Added Interface TableResourcesDeleteTableRoleAssignmentOptionalParams + - Added Interface TableResourcesDeleteTableRoleDefinitionHeaders + - Added Interface TableResourcesDeleteTableRoleDefinitionOptionalParams + - Added Interface TableResourcesGetTableRoleAssignmentOptionalParams + - Added Interface TableResourcesGetTableRoleDefinitionOptionalParams + - Added Interface TableResourcesListTableRoleAssignmentsOptionalParams + - Added Interface TableResourcesListTableRoleDefinitionsOptionalParams + - Added Interface TableRoleAssignmentListResult + - Added Interface TableRoleAssignmentResource + - Added Interface TableRoleDefinitionListResult + - Added Interface TableRoleDefinitionResource + - Added Interface ThroughputBucketResource + - Added Interface ThroughputPoolAccountCreateOptionalParams + - Added Interface ThroughputPoolAccountCreateParameters + - Added Interface ThroughputPoolAccountDeleteHeaders + - Added Interface ThroughputPoolAccountDeleteOptionalParams + - Added Interface ThroughputPoolAccountGetOptionalParams + - Added Interface ThroughputPoolAccountResource + - Added Interface ThroughputPoolAccountsListNextOptionalParams + - Added Interface ThroughputPoolAccountsListOptionalParams + - Added Interface ThroughputPoolAccountsListResult + - Added Interface ThroughputPoolCreateOrUpdateOptionalParams + - Added Interface ThroughputPoolDeleteHeaders + - Added Interface ThroughputPoolDeleteOptionalParams + - Added Interface ThroughputPoolGetOptionalParams + - Added Interface ThroughputPoolResource + - Added Interface ThroughputPoolsListByResourceGroupNextOptionalParams + - Added Interface ThroughputPoolsListByResourceGroupOptionalParams + - Added Interface ThroughputPoolsListNextOptionalParams + - Added Interface ThroughputPoolsListOptionalParams + - Added Interface ThroughputPoolsListResult + - Added Interface ThroughputPoolUpdate + - Added Interface ThroughputPoolUpdateHeaders + - Added Interface ThroughputPoolUpdateOptionalParams + - Added Interface TrackedResource + - Added Type Alias AccessRuleDirection + - Added Type Alias AutoReplicate + - Added Type Alias BackupState + - Added Type Alias BaseCosmosDataTransferDataSourceSinkUnion + - Added Type Alias CapacityMode + - Added Type Alias CapacityModeTransitionStatus + - Added Type Alias CassandraClustersGetBackupResponse + - Added Type Alias CassandraClustersGetCommandAsyncResponse + - Added Type Alias CassandraClustersInvokeCommandAsyncResponse + - Added Type Alias CassandraClustersListBackupsResponse + - Added Type Alias CassandraClustersListCommandResponse + - Added Type Alias CassandraResourcesCreateUpdateCassandraViewResponse + - Added Type Alias CassandraResourcesGetCassandraViewResponse + - Added Type Alias CassandraResourcesGetCassandraViewThroughputResponse + - Added Type Alias CassandraResourcesListCassandraViewsResponse + - Added Type Alias CassandraResourcesMigrateCassandraViewToAutoscaleResponse + - Added Type Alias CassandraResourcesMigrateCassandraViewToManualThroughputResponse + - Added Type Alias CassandraResourcesUpdateCassandraViewThroughputResponse + - Added Type Alias ChaosFaultEnableDisableResponse + - Added Type Alias ChaosFaultGetResponse + - Added Type Alias ChaosFaultListNextResponse + - Added Type Alias ChaosFaultListOperationResponse + - Added Type Alias ClusterType + - Added Type Alias CommandStatus + - Added Type Alias DataTransferComponent + - Added Type Alias DataTransferDataSourceSinkUnion + - Added Type Alias DataTransferJobMode + - Added Type Alias DataTransferJobsCancelResponse + - Added Type Alias DataTransferJobsCompleteResponse + - 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 DefaultPriorityLevel + - Added Type Alias EnableFullTextQuery + - Added Type Alias GraphResourcesCreateUpdateGraphResponse + - Added Type Alias GraphResourcesGetGraphResponse + - Added Type Alias GraphResourcesListGraphsResponse + - Added Type Alias IssueType + - Added Type Alias MongoDBResourcesListMongoDBCollectionPartitionMergeResponse + - Added Type Alias MongoDBResourcesMongoDBContainerRedistributeThroughputResponse + - Added Type Alias MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse + - Added Type Alias MongoDBResourcesMongoDBDatabasePartitionMergeResponse + - Added Type Alias MongoDBResourcesMongoDBDatabaseRedistributeThroughputResponse + - Added Type Alias MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionResponse + - Added Type Alias NetworkSecurityPerimeterConfigurationProvisioningState + - Added Type Alias NetworkSecurityPerimeterConfigurationsGetResponse + - Added Type Alias NetworkSecurityPerimeterConfigurationsListNextResponse + - Added Type Alias NetworkSecurityPerimeterConfigurationsListResponse + - Added Type Alias NetworkSecurityPerimeterConfigurationsReconcileResponse + - Added Type Alias ResourceAssociationAccessMode + - Added Type Alias ScheduledEventStrategy + - Added Type Alias Severity + - Added Type Alias SqlResourcesListSqlContainerPartitionMergeResponse + - Added Type Alias SqlResourcesSqlContainerRedistributeThroughputResponse + - Added Type Alias SqlResourcesSqlContainerRetrieveThroughputDistributionResponse + - Added Type Alias SqlResourcesSqlDatabasePartitionMergeResponse + - Added Type Alias SqlResourcesSqlDatabaseRedistributeThroughputResponse + - Added Type Alias SqlResourcesSqlDatabaseRetrieveThroughputDistributionResponse + - Added Type Alias SupportedActions + - Added Type Alias TableResourcesCreateUpdateTableRoleAssignmentResponse + - Added Type Alias TableResourcesCreateUpdateTableRoleDefinitionResponse + - Added Type Alias TableResourcesGetTableRoleAssignmentResponse + - Added Type Alias TableResourcesGetTableRoleDefinitionResponse + - Added Type Alias TableResourcesListTableRoleAssignmentsResponse + - Added Type Alias TableResourcesListTableRoleDefinitionsResponse + - Added Type Alias ThroughputPolicyType + - Added Type Alias ThroughputPoolAccountCreateResponse + - Added Type Alias ThroughputPoolAccountDeleteResponse + - Added Type Alias ThroughputPoolAccountGetResponse + - Added Type Alias ThroughputPoolAccountsListNextResponse + - Added Type Alias ThroughputPoolAccountsListResponse + - Added Type Alias ThroughputPoolCreateOrUpdateResponse + - Added Type Alias ThroughputPoolDeleteResponse + - Added Type Alias ThroughputPoolGetResponse + - Added Type Alias ThroughputPoolsListByResourceGroupNextResponse + - Added Type Alias ThroughputPoolsListByResourceGroupResponse + - Added Type Alias ThroughputPoolsListNextResponse + - Added Type Alias ThroughputPoolsListResponse + - Added Type Alias ThroughputPoolUpdateResponse + - Interface ARMResourceProperties has a new optional parameter identity + - Interface CassandraClustersDeallocateOptionalParams has a new optional parameter xMsForceDeallocate + - Interface ClusterResourceProperties has a new optional parameter autoReplicate + - Interface ClusterResourceProperties has a new optional parameter backupSchedules + - Interface ClusterResourceProperties has a new optional parameter clusterType + - Interface ClusterResourceProperties has a new optional parameter extensions + - Interface ClusterResourceProperties has a new optional parameter externalDataCenters + - Interface ClusterResourceProperties has a new optional parameter scheduledEventStrategy + - Interface ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems has a new optional parameter isLatestModel + - Interface DatabaseAccountCreateUpdateParameters has a new optional parameter capacityMode + - Interface DatabaseAccountCreateUpdateParameters has a new optional parameter defaultPriorityLevel + - Interface DatabaseAccountCreateUpdateParameters has a new optional parameter diagnosticLogSettings + - Interface DatabaseAccountCreateUpdateParameters has a new optional parameter enableMaterializedViews + - Interface DatabaseAccountCreateUpdateParameters has a new optional parameter enablePriorityBasedExecution + - Interface DatabaseAccountGetResults has a new optional parameter capacityMode + - Interface DatabaseAccountGetResults has a new optional parameter capacityModeChangeTransitionState + - Interface DatabaseAccountGetResults has a new optional parameter defaultPriorityLevel + - Interface DatabaseAccountGetResults has a new optional parameter diagnosticLogSettings + - Interface DatabaseAccountGetResults has a new optional parameter enableMaterializedViews + - Interface DatabaseAccountGetResults has a new optional parameter enablePriorityBasedExecution + - Interface DatabaseAccountUpdateParameters has a new optional parameter capacityMode + - Interface DatabaseAccountUpdateParameters has a new optional parameter defaultPriorityLevel + - Interface DatabaseAccountUpdateParameters has a new optional parameter diagnosticLogSettings + - Interface DatabaseAccountUpdateParameters has a new optional parameter enableMaterializedViews + - Interface DatabaseAccountUpdateParameters has a new optional parameter enablePriorityBasedExecution + - Interface Resource has a new optional parameter systemData + - Interface RestoreParameters has a new optional parameter sourceBackupLocation + - Interface SqlContainerResource has a new optional parameter materializedViewDefinition + - Interface ThroughputSettingsResource has a new optional parameter throughputBuckets + - Added Enum KnownAccessRuleDirection + - Added Enum KnownAutoReplicate + - Added Enum KnownBackupState + - Added Enum KnownCapacityMode + - Added Enum KnownCapacityModeTransitionStatus + - Added Enum KnownClusterType + - Added Enum KnownCommandStatus + - Added Enum KnownDataTransferComponent + - Added Enum KnownDataTransferJobMode + - Added Enum KnownDefaultPriorityLevel + - Added Enum KnownIssueType + - Added Enum KnownNetworkSecurityPerimeterConfigurationProvisioningState + - Added Enum KnownResourceAssociationAccessMode + - Added Enum KnownScheduledEventStrategy + - Added Enum KnownSeverity + - Added Enum KnownThroughputPolicyType + - Enum KnownStatus has a new value Canceled + - Enum KnownStatus has a new value Failed + - Enum KnownStatus has a new value Succeeded + - Enum KnownStatus has a new value Updating + + ## 16.2.0 (2024-12-09) ### Features Added diff --git a/sdk/cosmosdb/arm-cosmosdb/README.md b/sdk/cosmosdb/arm-cosmosdb/README.md index 2e2088dfdc04..d91abd9bd72e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/README.md +++ b/sdk/cosmosdb/arm-cosmosdb/README.md @@ -2,11 +2,11 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure CosmosDBManagement client. -Azure Cosmos DB Database Service Resource Provider REST API +Azure Cosmos DB Chaos Fault REST API [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/arm-cosmosdb) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-cosmosdb) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-cosmosdb) | +[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-cosmosdb?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -63,8 +63,8 @@ const client = new CosmosDBManagementClient(new DefaultAzureCredential(), subscr // const client = new CosmosDBManagementClient(credential, subscriptionId); ``` -### JavaScript Bundle +### JavaScript Bundle To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts diff --git a/sdk/cosmosdb/arm-cosmosdb/_meta.json b/sdk/cosmosdb/arm-cosmosdb/_meta.json index 9d9b3c1c94a7..f0c9be6bb1fa 100644 --- a/sdk/cosmosdb/arm-cosmosdb/_meta.json +++ b/sdk/cosmosdb/arm-cosmosdb/_meta.json @@ -1,5 +1,5 @@ { - "commit": "552b4dd311f90f4a7b2f7adf45461d7a8774a1cc", + "commit": "d811ed172ae395f3849439a305cf25d0eb6a426c", "readme": "specification/cosmos-db/resource-manager/readme.md", "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\cosmos-db\\resource-manager\\readme.md --use=@autorest/typescript@6.0.29 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", diff --git a/sdk/cosmosdb/arm-cosmosdb/api-extractor.json b/sdk/cosmosdb/arm-cosmosdb/api-extractor.json index 0020e5644c49..f3b603c8e745 100644 --- a/sdk/cosmosdb/arm-cosmosdb/api-extractor.json +++ b/sdk/cosmosdb/arm-cosmosdb/api-extractor.json @@ -1,6 +1,6 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "mainEntryPointFilePath": "dist/esm/index.d.ts", "docModel": { "enabled": true }, @@ -11,7 +11,7 @@ "dtsRollup": { "enabled": true, "untrimmedFilePath": "", - "publicTrimmedFilePath": "./types/arm-cosmosdb.d.ts" + "publicTrimmedFilePath": "dist/arm-cosmosdb.d.ts" }, "messages": { "tsdocMessageReporting": { @@ -28,4 +28,4 @@ } } } -} \ No newline at end of file +} diff --git a/sdk/cosmosdb/arm-cosmosdb/assets.json b/sdk/cosmosdb/arm-cosmosdb/assets.json index 489cff3dcacb..0dc83163032f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/assets.json +++ b/sdk/cosmosdb/arm-cosmosdb/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/cosmosdb/arm-cosmosdb", - "Tag": "js/cosmosdb/arm-cosmosdb_c817010168" + "Tag": "js/cosmosdb/arm-cosmosdb_2c4c765cdb" } diff --git a/sdk/cosmosdb/arm-cosmosdb/package.json b/sdk/cosmosdb/arm-cosmosdb/package.json index 01be1663ec94..1405cae19654 100644 --- a/sdk/cosmosdb/arm-cosmosdb/package.json +++ b/sdk/cosmosdb/arm-cosmosdb/package.json @@ -3,16 +3,16 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for CosmosDBManagementClient.", - "version": "16.2.0", + "version": "16.3.0-beta.1", "engines": { "node": ">=18.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^2.1.2", - "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.6.0", + "@azure/core-client": "^1.7.0", + "@azure/core-lro": "^2.5.4", + "@azure/core-paging": "^1.2.0", "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, @@ -24,23 +24,23 @@ "isomorphic" ], "license": "MIT", - "main": "./dist/index.js", - "module": "./dist-esm/src/index.js", - "types": "./types/arm-cosmosdb.d.ts", + "main": "./dist/commonjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/commonjs/index.d.ts", "devDependencies": { - "typescript": "~5.7.2", - "dotenv": "^16.0.0", + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.1.0", + "@azure-tools/test-utils-vitest": "^1.0.0", "@azure/dev-tool": "^1.0.0", "@azure/identity": "^4.2.1", - "@azure-tools/test-recorder": "^3.0.0", - "@azure-tools/test-credential": "^1.1.0", - "mocha": "^11.0.2", - "@types/mocha": "^10.0.0", - "tsx": "^4.7.1", - "@types/chai": "^4.2.8", - "chai": "^4.2.0", "@types/node": "^18.0.0", - "ts-node": "^10.0.0" + "@vitest/browser": "^2.1.8", + "@vitest/coverage-istanbul": "^2.1.8", + "dotenv": "^16.0.0", + "playwright": "^1.49.1", + "tsx": "^4.7.1", + "typescript": "~5.6.2", + "vitest": "^2.1.8" }, "repository": { "type": "git", @@ -50,46 +50,36 @@ "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ - "dist/**/*.js", - "dist/**/*.js.map", - "dist/**/*.d.ts", - "dist/**/*.d.ts.map", - "dist-esm/**/*.js", - "dist-esm/**/*.js.map", - "dist-esm/**/*.d.ts", - "dist-esm/**/*.d.ts.map", - "src/**/*.ts", + "dist/", "README.md", "LICENSE", - "tsconfig.json", - "review/*", - "CHANGELOG.md", - "types/*" + "review/", + "CHANGELOG.md" ], "scripts": { - "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "prepack": "npm run build", - "pack": "npm pack 2>&1", - "extract-api": "dev-tool run extract-api", - "lint": "echo skipped", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "build:node": "echo skipped", + "build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api", "build:browser": "echo skipped", - "build:test": "echo skipped", + "build:node": "echo skipped", "build:samples": "echo skipped.", + "build:test": "echo skipped", "check-format": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "execute:samples": "echo skipped", + "extract-api": "dev-tool run extract-api", "format": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "dev-tool run test:vitest --esm", + "lint": "echo skipped", + "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "pack": "npm pack 2>&1", + "prepack": "npm run build", "test": "npm run integration-test", - "test:node": "echo skipped", "test:browser": "echo skipped", + "test:node": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:node": "dev-tool run vendored 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": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "integration-test:browser": "echo skipped", + "unit-test:node": "dev-tool run test:vitest", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -110,5 +100,45 @@ ], "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-cosmosdb?view=azure-node-preview" + }, + "type": "module", + "tshy": { + "project": "./tsconfig.src.json", + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false + }, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } } -} \ 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 3d7633b07a87..ac33a7a5bbed 100644 --- a/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md +++ b/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md @@ -10,6 +10,31 @@ import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { SimplePollerLike } from '@azure/core-lro'; +// @public +export interface AccessRule { + name?: string; + properties?: AccessRuleProperties; +} + +// @public +export type AccessRuleDirection = string; + +// @public +export interface AccessRuleProperties { + addressPrefixes?: string[]; + direction?: AccessRuleDirection; + emailAddresses?: string[]; + fullyQualifiedDomainNames?: string[]; + networkSecurityPerimeters?: NetworkSecurityPerimeter[]; + phoneNumbers?: string[]; + subscriptions?: AccessRulePropertiesSubscriptionsItem[]; +} + +// @public +export interface AccessRulePropertiesSubscriptionsItem { + id?: string; +} + // @public export interface AccountKeyMetadata { readonly generationTime?: Date; @@ -41,6 +66,7 @@ export interface ARMProxyResource { // @public export interface ARMResourceProperties { readonly id?: string; + identity?: ManagedServiceIdentity; location?: string; readonly name?: string; tags?: { @@ -65,6 +91,9 @@ export interface AuthenticationMethodLdapProperties { serviceUserPassword?: string; } +// @public +export type AutoReplicate = string; + // @public (undocumented) export interface AutoscaleSettings { maxThroughput?: number; @@ -82,6 +111,15 @@ export interface AutoUpgradePolicyResource { throughputPolicy?: ThroughputPolicyResource; } +// @public +export interface AzureBlobDataTransferDataSourceSink extends DataTransferDataSourceSink { + component: "AzureBlobStorage"; + // (undocumented) + containerName: string; + // (undocumented) + endpointUrl?: string; +} + // @public export type AzureConnectionType = string; @@ -112,9 +150,38 @@ export type BackupPolicyType = string; // @public (undocumented) export type BackupPolicyUnion = BackupPolicy | PeriodicModeBackupPolicy | ContinuousModeBackupPolicy; +// @public +export interface BackupResource { + backupExpiryTimestamp?: Date; + backupId?: string; + backupStartTimestamp?: Date; + backupState?: BackupState; + backupStopTimestamp?: Date; +} + +// @public (undocumented) +export interface BackupSchedule { + cronExpression?: string; + retentionInHours?: number; + scheduleName?: string; +} + +// @public +export type BackupState = string; + // @public export type BackupStorageRedundancy = string; +// @public +export interface BaseCosmosDataTransferDataSourceSink extends DataTransferDataSourceSink { + component: "BaseCosmosDataTransferDataSourceSink" | "CosmosDBCassandra" | "CosmosDBMongo" | "CosmosDBSql"; + // (undocumented) + remoteAccountName?: string; +} + +// @public (undocumented) +export type BaseCosmosDataTransferDataSourceSinkUnion = BaseCosmosDataTransferDataSourceSink | CosmosCassandraDataTransferDataSourceSink | CosmosMongoDataTransferDataSourceSink | CosmosSqlDataTransferDataSourceSink; + // @public export interface Capability { name?: string; @@ -125,6 +192,22 @@ export interface Capacity { totalThroughputLimit?: number; } +// @public +export type CapacityMode = string; + +// @public +export interface CapacityModeChangeTransitionState { + readonly capacityModeLastSuccessfulTransitionEndTimestamp?: Date; + readonly capacityModeTransitionBeginTimestamp?: Date; + readonly capacityModeTransitionEndTimestamp?: Date; + capacityModeTransitionStatus?: CapacityModeTransitionStatus; + currentCapacityMode?: CapacityMode; + previousCapacityMode?: CapacityMode; +} + +// @public +export type CapacityModeTransitionStatus = string; + // @public export interface CassandraClusterPublicStatus { connectionErrors?: ConnectionError[]; @@ -154,13 +237,19 @@ export interface CassandraClusters { beginDeleteAndWait(resourceGroupName: string, clusterName: string, options?: CassandraClustersDeleteOptionalParams): Promise; beginInvokeCommand(resourceGroupName: string, clusterName: string, body: CommandPostBody, options?: CassandraClustersInvokeCommandOptionalParams): Promise, CassandraClustersInvokeCommandResponse>>; beginInvokeCommandAndWait(resourceGroupName: string, clusterName: string, body: CommandPostBody, options?: CassandraClustersInvokeCommandOptionalParams): Promise; + beginInvokeCommandAsync(resourceGroupName: string, clusterName: string, body: CommandAsyncPostBody, options?: CassandraClustersInvokeCommandAsyncOptionalParams): Promise, CassandraClustersInvokeCommandAsyncResponse>>; + beginInvokeCommandAsyncAndWait(resourceGroupName: string, clusterName: string, body: CommandAsyncPostBody, options?: CassandraClustersInvokeCommandAsyncOptionalParams): Promise; beginStart(resourceGroupName: string, clusterName: string, options?: CassandraClustersStartOptionalParams): Promise, void>>; beginStartAndWait(resourceGroupName: string, clusterName: string, options?: CassandraClustersStartOptionalParams): Promise; beginUpdate(resourceGroupName: string, clusterName: string, body: ClusterResource, options?: CassandraClustersUpdateOptionalParams): Promise, CassandraClustersUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, clusterName: string, body: ClusterResource, options?: CassandraClustersUpdateOptionalParams): Promise; get(resourceGroupName: string, clusterName: string, options?: CassandraClustersGetOptionalParams): Promise; + getBackup(resourceGroupName: string, clusterName: string, backupId: string, options?: CassandraClustersGetBackupOptionalParams): Promise; + getCommandAsync(resourceGroupName: string, clusterName: string, commandId: string, options?: CassandraClustersGetCommandAsyncOptionalParams): Promise; + listBackups(resourceGroupName: string, clusterName: string, options?: CassandraClustersListBackupsOptionalParams): PagedAsyncIterableIterator; listByResourceGroup(resourceGroupName: string, options?: CassandraClustersListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: CassandraClustersListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + listCommand(resourceGroupName: string, clusterName: string, options?: CassandraClustersListCommandOptionalParams): PagedAsyncIterableIterator; status(resourceGroupName: string, clusterName: string, options?: CassandraClustersStatusOptionalParams): Promise; } @@ -177,6 +266,7 @@ export type CassandraClustersCreateUpdateResponse = ClusterResource; export interface CassandraClustersDeallocateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; + xMsForceDeallocate?: string; } // @public @@ -185,6 +275,20 @@ export interface CassandraClustersDeleteOptionalParams extends coreClient.Operat updateIntervalInMs?: number; } +// @public +export interface CassandraClustersGetBackupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CassandraClustersGetBackupResponse = BackupResource; + +// @public +export interface CassandraClustersGetCommandAsyncOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CassandraClustersGetCommandAsyncResponse = CommandPublicResource; + // @public export interface CassandraClustersGetOptionalParams extends coreClient.OperationOptions { } @@ -192,6 +296,21 @@ export interface CassandraClustersGetOptionalParams extends coreClient.Operation // @public export type CassandraClustersGetResponse = ClusterResource; +// @public +export interface CassandraClustersInvokeCommandAsyncHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface CassandraClustersInvokeCommandAsyncOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CassandraClustersInvokeCommandAsyncResponse = CommandPublicResource; + // @public export interface CassandraClustersInvokeCommandOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -201,6 +320,13 @@ export interface CassandraClustersInvokeCommandOptionalParams extends coreClient // @public export type CassandraClustersInvokeCommandResponse = CommandOutput; +// @public +export interface CassandraClustersListBackupsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CassandraClustersListBackupsResponse = ListBackups; + // @public export interface CassandraClustersListByResourceGroupOptionalParams extends coreClient.OperationOptions { } @@ -215,6 +341,13 @@ export interface CassandraClustersListBySubscriptionOptionalParams extends coreC // @public export type CassandraClustersListBySubscriptionResponse = ListClusters; +// @public +export interface CassandraClustersListCommandOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CassandraClustersListCommandResponse = ListCommands; + // @public export interface CassandraClustersStartOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -338,10 +471,14 @@ export interface CassandraResources { beginCreateUpdateCassandraKeyspaceAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, createUpdateCassandraKeyspaceParameters: CassandraKeyspaceCreateUpdateParameters, options?: CassandraResourcesCreateUpdateCassandraKeyspaceOptionalParams): Promise; beginCreateUpdateCassandraTable(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, createUpdateCassandraTableParameters: CassandraTableCreateUpdateParameters, options?: CassandraResourcesCreateUpdateCassandraTableOptionalParams): Promise, CassandraResourcesCreateUpdateCassandraTableResponse>>; beginCreateUpdateCassandraTableAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, createUpdateCassandraTableParameters: CassandraTableCreateUpdateParameters, options?: CassandraResourcesCreateUpdateCassandraTableOptionalParams): Promise; + beginCreateUpdateCassandraView(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, createUpdateCassandraViewParameters: CassandraViewCreateUpdateParameters, options?: CassandraResourcesCreateUpdateCassandraViewOptionalParams): Promise, CassandraResourcesCreateUpdateCassandraViewResponse>>; + beginCreateUpdateCassandraViewAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, createUpdateCassandraViewParameters: CassandraViewCreateUpdateParameters, options?: CassandraResourcesCreateUpdateCassandraViewOptionalParams): Promise; beginDeleteCassandraKeyspace(resourceGroupName: string, accountName: string, keyspaceName: string, options?: CassandraResourcesDeleteCassandraKeyspaceOptionalParams): Promise, CassandraResourcesDeleteCassandraKeyspaceResponse>>; beginDeleteCassandraKeyspaceAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, options?: CassandraResourcesDeleteCassandraKeyspaceOptionalParams): Promise; beginDeleteCassandraTable(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options?: CassandraResourcesDeleteCassandraTableOptionalParams): Promise, CassandraResourcesDeleteCassandraTableResponse>>; beginDeleteCassandraTableAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options?: CassandraResourcesDeleteCassandraTableOptionalParams): Promise; + beginDeleteCassandraView(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, options?: CassandraResourcesDeleteCassandraViewOptionalParams): Promise, void>>; + beginDeleteCassandraViewAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, options?: CassandraResourcesDeleteCassandraViewOptionalParams): Promise; beginMigrateCassandraKeyspaceToAutoscale(resourceGroupName: string, accountName: string, keyspaceName: string, options?: CassandraResourcesMigrateCassandraKeyspaceToAutoscaleOptionalParams): Promise, CassandraResourcesMigrateCassandraKeyspaceToAutoscaleResponse>>; beginMigrateCassandraKeyspaceToAutoscaleAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, options?: CassandraResourcesMigrateCassandraKeyspaceToAutoscaleOptionalParams): Promise; beginMigrateCassandraKeyspaceToManualThroughput(resourceGroupName: string, accountName: string, keyspaceName: string, options?: CassandraResourcesMigrateCassandraKeyspaceToManualThroughputOptionalParams): Promise, CassandraResourcesMigrateCassandraKeyspaceToManualThroughputResponse>>; @@ -350,16 +487,25 @@ export interface CassandraResources { beginMigrateCassandraTableToAutoscaleAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options?: CassandraResourcesMigrateCassandraTableToAutoscaleOptionalParams): Promise; beginMigrateCassandraTableToManualThroughput(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options?: CassandraResourcesMigrateCassandraTableToManualThroughputOptionalParams): Promise, CassandraResourcesMigrateCassandraTableToManualThroughputResponse>>; beginMigrateCassandraTableToManualThroughputAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options?: CassandraResourcesMigrateCassandraTableToManualThroughputOptionalParams): Promise; + beginMigrateCassandraViewToAutoscale(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, options?: CassandraResourcesMigrateCassandraViewToAutoscaleOptionalParams): Promise, CassandraResourcesMigrateCassandraViewToAutoscaleResponse>>; + beginMigrateCassandraViewToAutoscaleAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, options?: CassandraResourcesMigrateCassandraViewToAutoscaleOptionalParams): Promise; + beginMigrateCassandraViewToManualThroughput(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, options?: CassandraResourcesMigrateCassandraViewToManualThroughputOptionalParams): Promise, CassandraResourcesMigrateCassandraViewToManualThroughputResponse>>; + beginMigrateCassandraViewToManualThroughputAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, options?: CassandraResourcesMigrateCassandraViewToManualThroughputOptionalParams): Promise; beginUpdateCassandraKeyspaceThroughput(resourceGroupName: string, accountName: string, keyspaceName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: CassandraResourcesUpdateCassandraKeyspaceThroughputOptionalParams): Promise, CassandraResourcesUpdateCassandraKeyspaceThroughputResponse>>; beginUpdateCassandraKeyspaceThroughputAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: CassandraResourcesUpdateCassandraKeyspaceThroughputOptionalParams): Promise; beginUpdateCassandraTableThroughput(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: CassandraResourcesUpdateCassandraTableThroughputOptionalParams): Promise, CassandraResourcesUpdateCassandraTableThroughputResponse>>; beginUpdateCassandraTableThroughputAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: CassandraResourcesUpdateCassandraTableThroughputOptionalParams): Promise; + beginUpdateCassandraViewThroughput(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: CassandraResourcesUpdateCassandraViewThroughputOptionalParams): Promise, CassandraResourcesUpdateCassandraViewThroughputResponse>>; + beginUpdateCassandraViewThroughputAndWait(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: CassandraResourcesUpdateCassandraViewThroughputOptionalParams): Promise; getCassandraKeyspace(resourceGroupName: string, accountName: string, keyspaceName: string, options?: CassandraResourcesGetCassandraKeyspaceOptionalParams): Promise; getCassandraKeyspaceThroughput(resourceGroupName: string, accountName: string, keyspaceName: string, options?: CassandraResourcesGetCassandraKeyspaceThroughputOptionalParams): Promise; getCassandraTable(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options?: CassandraResourcesGetCassandraTableOptionalParams): Promise; getCassandraTableThroughput(resourceGroupName: string, accountName: string, keyspaceName: string, tableName: string, options?: CassandraResourcesGetCassandraTableThroughputOptionalParams): Promise; + getCassandraView(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, options?: CassandraResourcesGetCassandraViewOptionalParams): Promise; + getCassandraViewThroughput(resourceGroupName: string, accountName: string, keyspaceName: string, viewName: string, options?: CassandraResourcesGetCassandraViewThroughputOptionalParams): Promise; listCassandraKeyspaces(resourceGroupName: string, accountName: string, options?: CassandraResourcesListCassandraKeyspacesOptionalParams): PagedAsyncIterableIterator; listCassandraTables(resourceGroupName: string, accountName: string, keyspaceName: string, options?: CassandraResourcesListCassandraTablesOptionalParams): PagedAsyncIterableIterator; + listCassandraViews(resourceGroupName: string, accountName: string, keyspaceName: string, options?: CassandraResourcesListCassandraViewsOptionalParams): PagedAsyncIterableIterator; } // @public @@ -392,6 +538,21 @@ export interface CassandraResourcesCreateUpdateCassandraTableOptionalParams exte // @public export type CassandraResourcesCreateUpdateCassandraTableResponse = CassandraTableGetResults; +// @public +export interface CassandraResourcesCreateUpdateCassandraViewHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface CassandraResourcesCreateUpdateCassandraViewOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CassandraResourcesCreateUpdateCassandraViewResponse = CassandraViewGetResults; + // @public export interface CassandraResourcesDeleteCassandraKeyspaceHeaders { azureAsyncOperation?: string; @@ -422,6 +583,18 @@ export interface CassandraResourcesDeleteCassandraTableOptionalParams extends co // @public export type CassandraResourcesDeleteCassandraTableResponse = CassandraResourcesDeleteCassandraTableHeaders; +// @public +export interface CassandraResourcesDeleteCassandraViewHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface CassandraResourcesDeleteCassandraViewOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + // @public export interface CassandraResourcesGetCassandraKeyspaceOptionalParams extends coreClient.OperationOptions { } @@ -450,6 +623,20 @@ export interface CassandraResourcesGetCassandraTableThroughputOptionalParams ext // @public export type CassandraResourcesGetCassandraTableThroughputResponse = ThroughputSettingsGetResults; +// @public +export interface CassandraResourcesGetCassandraViewOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CassandraResourcesGetCassandraViewResponse = CassandraViewGetResults; + +// @public +export interface CassandraResourcesGetCassandraViewThroughputOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CassandraResourcesGetCassandraViewThroughputResponse = ThroughputSettingsGetResults; + // @public export interface CassandraResourcesListCassandraKeyspacesOptionalParams extends coreClient.OperationOptions { } @@ -464,6 +651,13 @@ export interface CassandraResourcesListCassandraTablesOptionalParams extends cor // @public export type CassandraResourcesListCassandraTablesResponse = CassandraTableListResult; +// @public +export interface CassandraResourcesListCassandraViewsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CassandraResourcesListCassandraViewsResponse = CassandraViewListResult; + // @public export interface CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders { azureAsyncOperation?: string; @@ -524,6 +718,36 @@ export interface CassandraResourcesMigrateCassandraTableToManualThroughputOption // @public export type CassandraResourcesMigrateCassandraTableToManualThroughputResponse = ThroughputSettingsGetResults; +// @public +export interface CassandraResourcesMigrateCassandraViewToAutoscaleHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface CassandraResourcesMigrateCassandraViewToAutoscaleOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CassandraResourcesMigrateCassandraViewToAutoscaleResponse = ThroughputSettingsGetResults; + +// @public +export interface CassandraResourcesMigrateCassandraViewToManualThroughputHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface CassandraResourcesMigrateCassandraViewToManualThroughputOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CassandraResourcesMigrateCassandraViewToManualThroughputResponse = ThroughputSettingsGetResults; + // @public export interface CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders { azureAsyncOperation?: string; @@ -554,6 +778,21 @@ export interface CassandraResourcesUpdateCassandraTableThroughputOptionalParams // @public export type CassandraResourcesUpdateCassandraTableThroughputResponse = ThroughputSettingsGetResults; +// @public +export interface CassandraResourcesUpdateCassandraViewThroughputHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface CassandraResourcesUpdateCassandraViewThroughputOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CassandraResourcesUpdateCassandraViewThroughputResponse = ThroughputSettingsGetResults; + // @public export interface CassandraSchema { clusterKeys?: ClusterKey[]; @@ -596,11 +835,97 @@ export interface CassandraTableResource { schema?: CassandraSchema; } +// @public +export interface CassandraViewCreateUpdateParameters extends ARMResourceProperties { + options?: CreateUpdateOptions; + resource: CassandraViewResource; +} + +// @public (undocumented) +export interface CassandraViewGetPropertiesOptions extends OptionsResource { +} + +// @public (undocumented) +export interface CassandraViewGetPropertiesResource extends CassandraViewResource, ExtendedResourceProperties { +} + +// @public +export interface CassandraViewGetResults extends ARMResourceProperties { + // (undocumented) + options?: CassandraViewGetPropertiesOptions; + // (undocumented) + resource?: CassandraViewGetPropertiesResource; +} + +// @public +export interface CassandraViewListResult { + readonly value?: CassandraViewGetResults[]; +} + +// @public +export interface CassandraViewResource { + id: string; + viewDefinition: string; +} + // @public (undocumented) export interface Certificate { pem?: string; } +// @public +export interface ChaosFault { + beginEnableDisable(resourceGroupName: string, accountName: string, chaosFault: string, chaosFaultRequest: ChaosFaultResource, options?: ChaosFaultEnableDisableOptionalParams): Promise, ChaosFaultEnableDisableResponse>>; + beginEnableDisableAndWait(resourceGroupName: string, accountName: string, chaosFault: string, chaosFaultRequest: ChaosFaultResource, options?: ChaosFaultEnableDisableOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, chaosFault: string, options?: ChaosFaultGetOptionalParams): Promise; + list(resourceGroupName: string, accountName: string, options?: ChaosFaultListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ChaosFaultEnableDisableOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ChaosFaultEnableDisableResponse = ChaosFaultResource; + +// @public +export interface ChaosFaultGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ChaosFaultGetResponse = ChaosFaultResource; + +// @public +export interface ChaosFaultListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ChaosFaultListNextResponse = ChaosFaultListResponse; + +// @public +export type ChaosFaultListOperationResponse = ChaosFaultListResponse; + +// @public +export interface ChaosFaultListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ChaosFaultListResponse { + readonly nextLink?: string; + readonly value?: ChaosFaultResource[]; +} + +// @public +export interface ChaosFaultResource extends ProxyResource { + action?: SupportedActions; + containerName?: string; + databaseName?: string; + readonly provisioningState?: string; + region?: string; +} + // @public (undocumented) export interface ClientEncryptionIncludedPath { clientEncryptionKeyId: string; @@ -657,13 +982,18 @@ export interface ClusterResource extends ManagedCassandraARMResourceProperties { // @public export interface ClusterResourceProperties { authenticationMethod?: AuthenticationMethod; + autoReplicate?: AutoReplicate; azureConnectionMethod?: AzureConnectionType; + backupSchedules?: BackupSchedule[]; cassandraAuditLoggingEnabled?: boolean; cassandraVersion?: string; clientCertificates?: Certificate[]; clusterNameOverride?: string; + clusterType?: ClusterType; deallocated?: boolean; delegatedManagementSubnetId?: string; + extensions?: string[]; + externalDataCenters?: string[]; externalGossipCertificates?: Certificate[]; externalSeedNodes?: SeedNode[]; readonly gossipCertificates?: Certificate[]; @@ -675,9 +1005,13 @@ export interface ClusterResourceProperties { provisioningState?: ManagedCassandraProvisioningState; repairEnabled?: boolean; restoreFromBackupId?: string; + scheduledEventStrategy?: ScheduledEventStrategy; readonly seedNodes?: SeedNode[]; } +// @public +export type ClusterType = string; + // @public export interface Collection { listMetricDefinitions(resourceGroupName: string, accountName: string, databaseRid: string, collectionRid: string, options?: CollectionListMetricDefinitionsOptionalParams): PagedAsyncIterableIterator; @@ -758,6 +1092,15 @@ export interface Column { type?: string; } +// @public +export interface CommandAsyncPostBody { + arguments?: Record; + cassandraStopStart?: boolean; + command: string; + host: string; + readWrite?: boolean; +} + // @public export interface CommandOutput { commandOutput?: string; @@ -774,6 +1117,23 @@ export interface CommandPostBody { readwrite?: boolean; } +// @public +export interface CommandPublicResource { + arguments?: Record; + cassandraStopStart?: boolean; + command?: string; + commandId?: string; + host?: string; + isAdmin?: boolean; + outputFile?: string; + readWrite?: boolean; + result?: string; + status?: CommandStatus; +} + +// @public +export type CommandStatus = string; + // @public (undocumented) export interface Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties { readonly clientId?: string; @@ -788,6 +1148,7 @@ export interface ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDa diskFreeKB?: number; diskUsedKB?: number; hostID?: string; + isLatestModel?: boolean; load?: string; memoryBuffersAndCachedKB?: number; memoryFreeKB?: number; @@ -891,6 +1252,15 @@ export interface CorsPolicy { maxAgeInSeconds?: number; } +// @public +export interface CosmosCassandraDataTransferDataSourceSink extends BaseCosmosDataTransferDataSourceSink { + component: "CosmosDBCassandra"; + // (undocumented) + keyspaceName: string; + // (undocumented) + tableName: string; +} + // @public (undocumented) export class CosmosDBManagementClient extends coreClient.ServiceClient { // (undocumented) @@ -905,6 +1275,8 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { // (undocumented) cassandraResources: CassandraResources; // (undocumented) + chaosFault: ChaosFault; + // (undocumented) collection: Collection; // (undocumented) collectionPartition: CollectionPartition; @@ -919,12 +1291,18 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { // (undocumented) databaseAccounts: DatabaseAccounts; // (undocumented) + dataTransferJobs: DataTransferJobs; + // (undocumented) + graphResources: GraphResources; + // (undocumented) gremlinResources: GremlinResources; // (undocumented) locations: Locations; // (undocumented) mongoDBResources: MongoDBResources; // (undocumented) + networkSecurityPerimeterConfigurations: NetworkSecurityPerimeterConfigurations; + // (undocumented) notebookWorkspaces: NotebookWorkspaces; // (undocumented) operations: Operations; @@ -974,6 +1352,14 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { subscriptionId: string; // (undocumented) tableResources: TableResources; + // (undocumented) + throughputPool: ThroughputPool; + // (undocumented) + throughputPoolAccount: ThroughputPoolAccount; + // (undocumented) + throughputPoolAccounts: ThroughputPoolAccounts; + // (undocumented) + throughputPools: ThroughputPools; } // @public @@ -983,9 +1369,45 @@ export interface CosmosDBManagementClientOptionalParams extends coreClient.Servi endpoint?: string; } +// @public +export interface CosmosMongoDataTransferDataSourceSink extends BaseCosmosDataTransferDataSourceSink { + // (undocumented) + collectionName: string; + component: "CosmosDBMongo"; + // (undocumented) + databaseName: string; +} + +// @public +export interface CosmosMongoVCoreDataTransferDataSourceSink extends DataTransferDataSourceSink { + // (undocumented) + collectionName: string; + component: "CosmosDBMongoVCore"; + // (undocumented) + connectionStringKeyVaultUri?: string; + // (undocumented) + databaseName: string; + // (undocumented) + hostName?: string; +} + +// @public +export interface CosmosSqlDataTransferDataSourceSink extends BaseCosmosDataTransferDataSourceSink { + component: "CosmosDBSql"; + // (undocumented) + containerName: string; + // (undocumented) + databaseName: string; +} + // @public export type CreatedByType = string; +// @public +export interface CreateJobRequest extends ARMProxyResource { + properties: DataTransferJobProperties; +} + // @public export type CreateMode = string; @@ -1017,6 +1439,7 @@ export interface DatabaseAccountCreateUpdateParameters extends ARMResourceProper backupPolicy?: BackupPolicyUnion; capabilities?: Capability[]; capacity?: Capacity; + capacityMode?: CapacityMode; connectorOffer?: ConnectorOffer; consistencyPolicy?: ConsistencyPolicy; cors?: CorsPolicy[]; @@ -1024,6 +1447,8 @@ export interface DatabaseAccountCreateUpdateParameters extends ARMResourceProper customerManagedKeyStatus?: string; databaseAccountOfferType: "Standard"; defaultIdentity?: string; + defaultPriorityLevel?: DefaultPriorityLevel; + diagnosticLogSettings?: DiagnosticLogSettings; disableKeyBasedMetadataWriteAccess?: boolean; disableLocalAuth?: boolean; enableAnalyticalStorage?: boolean; @@ -1031,10 +1456,11 @@ export interface DatabaseAccountCreateUpdateParameters extends ARMResourceProper enableBurstCapacity?: boolean; enableCassandraConnector?: boolean; enableFreeTier?: boolean; + enableMaterializedViews?: boolean; enableMultipleWriteLocations?: boolean; enablePartitionMerge?: boolean; enablePerRegionPerPartitionAutoscale?: boolean; - identity?: ManagedServiceIdentity; + enablePriorityBasedExecution?: boolean; ipRules?: IpAddressOrRange[]; isVirtualNetworkFilterEnabled?: boolean; readonly keysMetadata?: DatabaseAccountKeysMetadata; @@ -1056,6 +1482,8 @@ export interface DatabaseAccountGetResults extends ARMResourceProperties { backupPolicy?: BackupPolicyUnion; capabilities?: Capability[]; capacity?: Capacity; + capacityMode?: CapacityMode; + capacityModeChangeTransitionState?: CapacityModeChangeTransitionState; connectorOffer?: ConnectorOffer; consistencyPolicy?: ConsistencyPolicy; cors?: CorsPolicy[]; @@ -1063,6 +1491,8 @@ export interface DatabaseAccountGetResults extends ARMResourceProperties { customerManagedKeyStatus?: string; readonly databaseAccountOfferType?: "Standard"; defaultIdentity?: string; + defaultPriorityLevel?: DefaultPriorityLevel; + diagnosticLogSettings?: DiagnosticLogSettings; disableKeyBasedMetadataWriteAccess?: boolean; disableLocalAuth?: boolean; readonly documentEndpoint?: string; @@ -1071,11 +1501,12 @@ export interface DatabaseAccountGetResults extends ARMResourceProperties { enableBurstCapacity?: boolean; enableCassandraConnector?: boolean; enableFreeTier?: boolean; + enableMaterializedViews?: boolean; enableMultipleWriteLocations?: boolean; enablePartitionMerge?: boolean; enablePerRegionPerPartitionAutoscale?: boolean; + enablePriorityBasedExecution?: boolean; readonly failoverPolicies?: FailoverPolicy[]; - identity?: ManagedServiceIdentity; readonly instanceId?: string; ipRules?: IpAddressOrRange[]; isVirtualNetworkFilterEnabled?: boolean; @@ -1346,11 +1777,14 @@ export interface DatabaseAccountUpdateParameters { backupPolicy?: BackupPolicyUnion; capabilities?: Capability[]; capacity?: Capacity; + capacityMode?: CapacityMode; connectorOffer?: ConnectorOffer; consistencyPolicy?: ConsistencyPolicy; cors?: CorsPolicy[]; customerManagedKeyStatus?: string; defaultIdentity?: string; + defaultPriorityLevel?: DefaultPriorityLevel; + diagnosticLogSettings?: DiagnosticLogSettings; disableKeyBasedMetadataWriteAccess?: boolean; disableLocalAuth?: boolean; enableAnalyticalStorage?: boolean; @@ -1358,9 +1792,11 @@ export interface DatabaseAccountUpdateParameters { enableBurstCapacity?: boolean; enableCassandraConnector?: boolean; enableFreeTier?: boolean; + enableMaterializedViews?: boolean; enableMultipleWriteLocations?: boolean; enablePartitionMerge?: boolean; enablePerRegionPerPartitionAutoscale?: boolean; + enablePriorityBasedExecution?: boolean; identity?: ManagedServiceIdentity; ipRules?: IpAddressOrRange[]; isVirtualNetworkFilterEnabled?: boolean; @@ -1432,15 +1868,132 @@ export interface DataCenterResourceProperties { } // @public -export interface DataTransferRegionalServiceResource extends RegionalServiceResource { -} +export type DataTransferComponent = string; // @public -export interface DataTransferServiceResource { - properties?: DataTransferServiceResourceProperties; +export interface DataTransferDataSourceSink { + component: "BaseCosmosDataTransferDataSourceSink" | "CosmosDBCassandra" | "CosmosDBMongo" | "CosmosDBMongoVCore" | "CosmosDBSql" | "AzureBlobStorage"; } -// @public +// @public (undocumented) +export type DataTransferDataSourceSinkUnion = DataTransferDataSourceSink | BaseCosmosDataTransferDataSourceSinkUnion | CosmosMongoVCoreDataTransferDataSourceSink | AzureBlobDataTransferDataSourceSink; + +// @public +export interface DataTransferJobFeedResults { + readonly nextLink?: string; + readonly value?: DataTransferJobGetResults[]; +} + +// @public +export interface DataTransferJobGetResults extends ARMProxyResource { + destination?: DataTransferDataSourceSinkUnion; + readonly duration?: string; + readonly error?: ErrorResponse; + readonly jobName?: string; + readonly lastUpdatedUtcTime?: Date; + mode?: DataTransferJobMode; + readonly processedCount?: number; + source?: DataTransferDataSourceSinkUnion; + readonly status?: string; + readonly totalCount?: number; + workerCount?: number; +} + +// @public +export type DataTransferJobMode = string; + +// @public +export interface DataTransferJobProperties { + destination: DataTransferDataSourceSinkUnion; + readonly duration?: string; + readonly error?: ErrorResponse; + readonly jobName?: string; + readonly lastUpdatedUtcTime?: Date; + mode?: DataTransferJobMode; + 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; + complete(resourceGroupName: string, accountName: string, jobName: string, options?: DataTransferJobsCompleteOptionalParams): 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 DataTransferJobsCompleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataTransferJobsCompleteResponse = DataTransferJobGetResults; + +// @public +export interface DataTransferJobsCreateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataTransferJobsCreateResponse = DataTransferJobGetResults; + +// @public +export interface DataTransferJobsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataTransferJobsGetResponse = DataTransferJobGetResults; + +// @public +export interface DataTransferJobsListByDatabaseAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataTransferJobsListByDatabaseAccountNextResponse = DataTransferJobFeedResults; + +// @public +export interface DataTransferJobsListByDatabaseAccountOptionalParams extends coreClient.OperationOptions { +} + +// @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 interface DataTransferRegionalServiceResource extends RegionalServiceResource { +} + +// @public +export interface DataTransferServiceResource { + properties?: DataTransferServiceResourceProperties; +} + +// @public export interface DataTransferServiceResourceCreateUpdateProperties extends ServiceResourceCreateUpdateProperties { serviceType: "DataTransfer"; } @@ -1460,9 +2013,20 @@ export type DedicatedGatewayType = string; // @public export type DefaultConsistencyLevel = "Eventual" | "Session" | "BoundedStaleness" | "Strong" | "ConsistentPrefix"; +// @public +export type DefaultPriorityLevel = string; + +// @public +export interface DiagnosticLogSettings { + enableFullTextQuery?: EnableFullTextQuery; +} + // @public export type DistanceFunction = string; +// @public +export type EnableFullTextQuery = "None" | "True" | "False"; + // @public export interface ErrorAdditionalInfo { readonly info?: Record; @@ -1532,6 +2096,89 @@ export interface GraphAPIComputeServiceResourceProperties extends ServiceResourc serviceType: "GraphAPICompute"; } +// @public +export interface GraphResource { + id: string; +} + +// @public +export interface GraphResourceCreateUpdateParameters extends ARMResourceProperties { + options?: CreateUpdateOptions; + resource: GraphResource; +} + +// @public (undocumented) +export interface GraphResourceGetPropertiesOptions extends OptionsResource { +} + +// @public (undocumented) +export interface GraphResourceGetPropertiesResource extends GraphResource { +} + +// @public +export interface GraphResourceGetResults extends ARMResourceProperties { + // (undocumented) + options?: GraphResourceGetPropertiesOptions; + // (undocumented) + resource?: GraphResourceGetPropertiesResource; +} + +// @public +export interface GraphResources { + beginCreateUpdateGraph(resourceGroupName: string, accountName: string, graphName: string, createUpdateGraphParameters: GraphResourceCreateUpdateParameters, options?: GraphResourcesCreateUpdateGraphOptionalParams): Promise, GraphResourcesCreateUpdateGraphResponse>>; + beginCreateUpdateGraphAndWait(resourceGroupName: string, accountName: string, graphName: string, createUpdateGraphParameters: GraphResourceCreateUpdateParameters, options?: GraphResourcesCreateUpdateGraphOptionalParams): Promise; + beginDeleteGraphResource(resourceGroupName: string, accountName: string, graphName: string, options?: GraphResourcesDeleteGraphResourceOptionalParams): Promise, void>>; + beginDeleteGraphResourceAndWait(resourceGroupName: string, accountName: string, graphName: string, options?: GraphResourcesDeleteGraphResourceOptionalParams): Promise; + getGraph(resourceGroupName: string, accountName: string, graphName: string, options?: GraphResourcesGetGraphOptionalParams): Promise; + listGraphs(resourceGroupName: string, accountName: string, options?: GraphResourcesListGraphsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface GraphResourcesCreateUpdateGraphHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface GraphResourcesCreateUpdateGraphOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GraphResourcesCreateUpdateGraphResponse = GraphResourceGetResults; + +// @public +export interface GraphResourcesDeleteGraphResourceHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface GraphResourcesDeleteGraphResourceOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface GraphResourcesGetGraphOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GraphResourcesGetGraphResponse = GraphResourceGetResults; + +// @public +export interface GraphResourcesListGraphsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GraphResourcesListGraphsResponse = GraphResourcesListResult; + +// @public +export interface GraphResourcesListResult { + readonly value?: GraphResourceGetResults[]; +} + // @public export interface GremlinDatabaseCreateUpdateParameters extends ARMResourceProperties { options?: CreateUpdateOptions; @@ -1880,6 +2527,9 @@ export interface IpAddressOrRange { ipAddressOrRange?: string; } +// @public +export type IssueType = string; + // @public export type KeyKind = string; @@ -1894,6 +2544,12 @@ export interface KeyWrapMetadata { // @public export type Kind = string; +// @public +export enum KnownAccessRuleDirection { + Inbound = "Inbound", + Outbound = "Outbound" +} + // @public export enum KnownAnalyticalStorageSchemaType { FullFidelity = "FullFidelity", @@ -1917,6 +2573,13 @@ export enum KnownAuthenticationMethod { None = "None" } +// @public +export enum KnownAutoReplicate { + AllKeyspaces = "AllKeyspaces", + None = "None", + SystemKeyspaces = "SystemKeyspaces" +} + // @public export enum KnownAzureConnectionType { None = "None", @@ -1937,6 +2600,14 @@ export enum KnownBackupPolicyType { Periodic = "Periodic" } +// @public +export enum KnownBackupState { + Failed = "Failed", + Initiated = "Initiated", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + // @public export enum KnownBackupStorageRedundancy { Geo = "Geo", @@ -1944,6 +2615,38 @@ export enum KnownBackupStorageRedundancy { Zone = "Zone" } +// @public +export enum KnownCapacityMode { + None = "None", + Provisioned = "Provisioned", + Serverless = "Serverless" +} + +// @public +export enum KnownCapacityModeTransitionStatus { + Completed = "Completed", + Failed = "Failed", + Initialized = "Initialized", + InProgress = "InProgress", + Invalid = "Invalid" +} + +// @public +export enum KnownClusterType { + NonProduction = "NonProduction", + Production = "Production" +} + +// @public +export enum KnownCommandStatus { + Done = "Done", + Enqueue = "Enqueue", + Failed = "Failed", + Finished = "Finished", + Processing = "Processing", + Running = "Running" +} + // @public export enum KnownCompositePathSortOrder { Ascending = "ascending", @@ -1998,6 +2701,21 @@ export enum KnownDatabaseAccountKind { Parse = "Parse" } +// @public +export enum KnownDataTransferComponent { + AzureBlobStorage = "AzureBlobStorage", + CosmosDBCassandra = "CosmosDBCassandra", + CosmosDBMongo = "CosmosDBMongo", + CosmosDBMongoVCore = "CosmosDBMongoVCore", + CosmosDBSql = "CosmosDBSql" +} + +// @public +export enum KnownDataTransferJobMode { + Offline = "Offline", + Online = "Online" +} + // @public export enum KnownDataType { LineString = "LineString", @@ -2014,6 +2732,12 @@ export enum KnownDedicatedGatewayType { IntegratedCache = "IntegratedCache" } +// @public +export enum KnownDefaultPriorityLevel { + High = "High", + Low = "Low" +} + // @public export enum KnownDistanceFunction { Cosine = "cosine", @@ -2035,6 +2759,14 @@ export enum KnownIndexKind { Spatial = "Spatial" } +// @public +export enum KnownIssueType { + ConfigurationPropagationFailure = "ConfigurationPropagationFailure", + MissingIdentityConfiguration = "MissingIdentityConfiguration", + MissingPerimeterConfiguration = "MissingPerimeterConfiguration", + Unknown = "Unknown" +} + // @public export enum KnownKeyKind { Primary = "primary", @@ -2074,6 +2806,17 @@ export enum KnownMinimalTlsVersion { Tls12 = "Tls12" } +// @public +export enum KnownNetworkSecurityPerimeterConfigurationProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + // @public export enum KnownNodeState { Joining = "Joining", @@ -2127,11 +2870,25 @@ export enum KnownPublicNetworkAccess { SecuredByPerimeter = "SecuredByPerimeter" } +// @public +export enum KnownResourceAssociationAccessMode { + Audit = "Audit", + Enforced = "Enforced", + Learning = "Learning" +} + // @public export enum KnownRestoreMode { PointInTime = "PointInTime" } +// @public +export enum KnownScheduledEventStrategy { + Ignore = "Ignore", + StopAny = "StopAny", + StopByRack = "StopByRack" +} + // @public export enum KnownServerVersion { Five0 = "5.0", @@ -2168,6 +2925,12 @@ export enum KnownServiceType { SqlDedicatedGateway = "SqlDedicatedGateway" } +// @public +export enum KnownSeverity { + Error = "Error", + Warning = "Warning" +} + // @public export enum KnownSpatialType { LineString = "LineString", @@ -2178,11 +2941,22 @@ export enum KnownSpatialType { // @public export enum KnownStatus { + Canceled = "Canceled", Deleting = "Deleting", + Failed = "Failed", Initializing = "Initializing", InternallyReady = "InternallyReady", Online = "Online", - Uninitialized = "Uninitialized" + Succeeded = "Succeeded", + Uninitialized = "Uninitialized", + Updating = "Updating" +} + +// @public +export enum KnownThroughputPolicyType { + Custom = "custom", + Equal = "equal", + None = "none" } // @public @@ -2238,11 +3012,21 @@ export enum KnownVectorIndexType { QuantizedFlat = "quantizedFlat" } +// @public +export interface ListBackups { + readonly value?: BackupResource[]; +} + // @public export interface ListClusters { value?: ClusterResource[]; } +// @public +export interface ListCommands { + readonly value?: CommandPublicResource[]; +} + // @public export interface ListDataCenters { readonly value?: DataCenterResource[]; @@ -2346,6 +3130,13 @@ export interface ManagedServiceIdentity { }; } +// @public +export interface MaterializedViewDefinition { + definition: string; + sourceCollectionId: string; + readonly sourceCollectionRid?: string; +} + // @public export interface MaterializedViewsBuilderRegionalServiceResource extends RegionalServiceResource { } @@ -2366,6 +3157,11 @@ export interface MaterializedViewsBuilderServiceResourceProperties extends Servi serviceType: "MaterializedViewsBuilder"; } +// @public +export interface MergeParameters { + isDryRun?: boolean; +} + // @public export interface Metric { readonly endTime?: Date; @@ -2511,6 +3307,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>>; @@ -2519,6 +3317,16 @@ 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; + beginMongoDBDatabasePartitionMerge(resourceGroupName: string, accountName: string, databaseName: string, mergeParameters: MergeParameters, options?: MongoDBResourcesMongoDBDatabasePartitionMergeOptionalParams): Promise, MongoDBResourcesMongoDBDatabasePartitionMergeResponse>>; + beginMongoDBDatabasePartitionMergeAndWait(resourceGroupName: string, accountName: string, databaseName: string, mergeParameters: MergeParameters, options?: MongoDBResourcesMongoDBDatabasePartitionMergeOptionalParams): Promise; + beginMongoDBDatabaseRedistributeThroughput(resourceGroupName: string, accountName: string, databaseName: string, redistributeThroughputParameters: RedistributeThroughputParameters, options?: MongoDBResourcesMongoDBDatabaseRedistributeThroughputOptionalParams): Promise, MongoDBResourcesMongoDBDatabaseRedistributeThroughputResponse>>; + beginMongoDBDatabaseRedistributeThroughputAndWait(resourceGroupName: string, accountName: string, databaseName: string, redistributeThroughputParameters: RedistributeThroughputParameters, options?: MongoDBResourcesMongoDBDatabaseRedistributeThroughputOptionalParams): Promise; + beginMongoDBDatabaseRetrieveThroughputDistribution(resourceGroupName: string, accountName: string, databaseName: string, retrieveThroughputParameters: RetrieveThroughputParameters, options?: MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionOptionalParams): Promise, MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionResponse>>; + beginMongoDBDatabaseRetrieveThroughputDistributionAndWait(resourceGroupName: string, accountName: string, databaseName: string, retrieveThroughputParameters: RetrieveThroughputParameters, options?: MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionOptionalParams): 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>>; @@ -2669,6 +3477,21 @@ export interface MongoDBResourcesGetMongoUserDefinitionOptionalParams extends co // @public export type MongoDBResourcesGetMongoUserDefinitionResponse = MongoUserDefinitionGetResults; +// @public +export interface MongoDBResourcesListMongoDBCollectionPartitionMergeHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MongoDBResourcesListMongoDBCollectionPartitionMergeResponse = PhysicalPartitionStorageInfoCollection; + // @public export interface MongoDBResourcesListMongoDBCollectionsOptionalParams extends coreClient.OperationOptions { } @@ -2758,64 +3581,139 @@ export interface MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptiona export type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputResponse = ThroughputSettingsGetResults; // @public -export interface MongoDBResourcesRetrieveContinuousBackupInformationOptionalParams extends coreClient.OperationOptions { +export interface MongoDBResourcesMongoDBContainerRedistributeThroughputHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type MongoDBResourcesRetrieveContinuousBackupInformationResponse = BackupInformation; +export type MongoDBResourcesMongoDBContainerRedistributeThroughputResponse = PhysicalPartitionThroughputInfoResult; // @public -export interface MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders { +export interface MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionHeaders { azureAsyncOperation?: string; location?: string; } // @public -export interface MongoDBResourcesUpdateMongoDBCollectionThroughputOptionalParams extends coreClient.OperationOptions { +export interface MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type MongoDBResourcesUpdateMongoDBCollectionThroughputResponse = ThroughputSettingsGetResults; +export type MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse = PhysicalPartitionThroughputInfoResult; // @public -export interface MongoDBResourcesUpdateMongoDBDatabaseThroughputHeaders { +export interface MongoDBResourcesMongoDBDatabasePartitionMergeHeaders { azureAsyncOperation?: string; location?: string; } // @public -export interface MongoDBResourcesUpdateMongoDBDatabaseThroughputOptionalParams extends coreClient.OperationOptions { +export interface MongoDBResourcesMongoDBDatabasePartitionMergeOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type MongoDBResourcesUpdateMongoDBDatabaseThroughputResponse = ThroughputSettingsGetResults; +export type MongoDBResourcesMongoDBDatabasePartitionMergeResponse = PhysicalPartitionStorageInfoCollection; // @public -export interface MongoIndex { - key?: MongoIndexKeys; - options?: MongoIndexOptions; +export interface MongoDBResourcesMongoDBDatabaseRedistributeThroughputHeaders { + azureAsyncOperation?: string; + location?: string; } // @public -export interface MongoIndexKeys { - keys?: string[]; +export interface MongoDBResourcesMongoDBDatabaseRedistributeThroughputOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export interface MongoIndexOptions { - expireAfterSeconds?: number; - unique?: boolean; -} +export type MongoDBResourcesMongoDBDatabaseRedistributeThroughputResponse = PhysicalPartitionThroughputInfoResult; // @public -export interface MongoRoleDefinitionCreateUpdateParameters { - databaseName?: string; +export interface MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionResponse = PhysicalPartitionThroughputInfoResult; + +// @public +export interface MongoDBResourcesRetrieveContinuousBackupInformationOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MongoDBResourcesRetrieveContinuousBackupInformationResponse = BackupInformation; + +// @public +export interface MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface MongoDBResourcesUpdateMongoDBCollectionThroughputOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MongoDBResourcesUpdateMongoDBCollectionThroughputResponse = ThroughputSettingsGetResults; + +// @public +export interface MongoDBResourcesUpdateMongoDBDatabaseThroughputHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface MongoDBResourcesUpdateMongoDBDatabaseThroughputOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MongoDBResourcesUpdateMongoDBDatabaseThroughputResponse = ThroughputSettingsGetResults; + +// @public +export interface MongoIndex { + key?: MongoIndexKeys; + options?: MongoIndexOptions; +} + +// @public +export interface MongoIndexKeys { + keys?: string[]; +} + +// @public +export interface MongoIndexOptions { + expireAfterSeconds?: number; + unique?: boolean; +} + +// @public +export interface MongoRoleDefinitionCreateUpdateParameters { + databaseName?: string; privileges?: Privilege[]; roleName?: string; roles?: Role[]; @@ -2867,6 +3765,89 @@ export interface MongoUserDefinitionListResult { // @public export type NetworkAclBypass = "None" | "AzureServices"; +// @public +export interface NetworkSecurityPerimeter { + id?: string; + location?: string; + perimeterGuid?: string; +} + +// @public +export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { + properties?: NetworkSecurityPerimeterConfigurationProperties; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationListResult { + nextLink?: string; + value?: NetworkSecurityPerimeterConfiguration[]; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationProperties { + networkSecurityPerimeter?: NetworkSecurityPerimeter; + profile?: NetworkSecurityProfile; + readonly provisioningIssues?: ProvisioningIssue[]; + readonly provisioningState?: NetworkSecurityPerimeterConfigurationProvisioningState; + resourceAssociation?: ResourceAssociation; +} + +// @public +export type NetworkSecurityPerimeterConfigurationProvisioningState = string; + +// @public +export interface NetworkSecurityPerimeterConfigurations { + beginReconcile(resourceGroupName: string, accountName: string, networkSecurityPerimeterConfigurationName: string, options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams): Promise, NetworkSecurityPerimeterConfigurationsReconcileResponse>>; + beginReconcileAndWait(resourceGroupName: string, accountName: string, networkSecurityPerimeterConfigurationName: string, options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, networkSecurityPerimeterConfigurationName: string, options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams): Promise; + list(resourceGroupName: string, accountName: string, options?: NetworkSecurityPerimeterConfigurationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetworkSecurityPerimeterConfigurationsGetResponse = NetworkSecurityPerimeterConfiguration; + +// @public +export interface NetworkSecurityPerimeterConfigurationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetworkSecurityPerimeterConfigurationsListNextResponse = NetworkSecurityPerimeterConfigurationListResult; + +// @public +export interface NetworkSecurityPerimeterConfigurationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type NetworkSecurityPerimeterConfigurationsListResponse = NetworkSecurityPerimeterConfigurationListResult; + +// @public +export interface NetworkSecurityPerimeterConfigurationsReconcileHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type NetworkSecurityPerimeterConfigurationsReconcileResponse = NetworkSecurityPerimeterConfigurationsReconcileHeaders; + +// @public +export interface NetworkSecurityProfile { + accessRules?: AccessRule[]; + accessRulesVersion?: number; + diagnosticSettingsVersion?: number; + enabledLogCategories?: string[]; + name?: string; +} + // @public export type NodeState = string; @@ -3138,6 +4119,49 @@ export interface Permission { notDataActions?: string[]; } +// @public +export interface PermissionAutoGenerated { + dataActions?: string[]; + id?: string; + 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 interface PhysicalPartitionThroughputInfoResult extends ARMResourceProperties { + resource?: PhysicalPartitionThroughputInfoResultPropertiesResource; +} + +// @public +export interface PhysicalPartitionThroughputInfoResultPropertiesResource extends PhysicalPartitionThroughputInfoProperties { +} + // @public export type PrimaryAggregationType = string; @@ -3249,6 +4273,21 @@ export interface PrivilegeResource { db?: string; } +// @public +export interface ProvisioningIssue { + readonly name?: string; + readonly properties?: ProvisioningIssueProperties; +} + +// @public +export interface ProvisioningIssueProperties { + readonly description?: string; + readonly issueType?: IssueType; + readonly severity?: Severity; + readonly suggestedAccessRules?: AccessRule[]; + readonly suggestedResourceIds?: string[]; +} + // @public export interface ProxyResource extends Resource { } @@ -3256,6 +4295,18 @@ export interface ProxyResource extends Resource { // @public export type PublicNetworkAccess = string; +// @public +export interface RedistributeThroughputParameters extends ARMResourceProperties { + resource: RedistributeThroughputPropertiesResource; +} + +// @public +export interface RedistributeThroughputPropertiesResource { + sourcePhysicalPartitionThroughputInfo: PhysicalPartitionThroughputInfoResource[]; + targetPhysicalPartitionThroughputInfo: PhysicalPartitionThroughputInfoResource[]; + throughputPolicy: ThroughputPolicyType; +} + // @public export interface RegionalServiceResource { readonly location?: string; @@ -3272,9 +4323,19 @@ export interface RegionForOnlineOffline { export interface Resource { readonly id?: string; readonly name?: string; + readonly systemData?: SystemData; readonly type?: string; } +// @public +export interface ResourceAssociation { + accessMode?: ResourceAssociationAccessMode; + name?: string; +} + +// @public +export type ResourceAssociationAccessMode = string; + // @public export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "SystemAssigned,UserAssigned" | "None"; @@ -3732,6 +4793,7 @@ export interface RestoreParameters extends RestoreParametersBase { databasesToRestore?: DatabaseRestoreResource[]; gremlinDatabasesToRestore?: GremlinDatabaseRestoreResource[]; restoreMode?: RestoreMode; + sourceBackupLocation?: string; tablesToRestore?: string[]; } @@ -3742,6 +4804,16 @@ export interface RestoreParametersBase { restoreWithTtlDisabled?: boolean; } +// @public +export interface RetrieveThroughputParameters extends ARMResourceProperties { + resource: RetrieveThroughputPropertiesResource; +} + +// @public +export interface RetrieveThroughputPropertiesResource { + physicalPartitionIds: PhysicalPartitionId[]; +} + // @public export interface Role { db?: string; @@ -3751,6 +4823,9 @@ export interface Role { // @public export type RoleDefinitionType = "BuiltInRole" | "CustomRole"; +// @public +export type ScheduledEventStrategy = string; + // @public (undocumented) export interface SeedNode { ipAddress?: string; @@ -3769,12 +4844,6 @@ export interface Service { list(resourceGroupName: string, accountName: string, options?: ServiceListOptionalParams): PagedAsyncIterableIterator; } -// @public -export interface ServiceCreateHeaders { - azureAsyncOperation?: string; - location?: string; -} - // @public export interface ServiceCreateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -3857,6 +4926,9 @@ export type ServiceStatus = string; // @public export type ServiceType = string; +// @public +export type Severity = string; + // @public (undocumented) export interface SpatialSpec { path?: string; @@ -3903,6 +4975,7 @@ export interface SqlContainerResource { defaultTtl?: number; id: string; indexingPolicy?: IndexingPolicy; + materializedViewDefinition?: MaterializedViewDefinition; partitionKey?: ContainerPartitionKey; restoreParameters?: ResourceRestoreParameters; uniqueKeyPolicy?: UniqueKeyPolicy; @@ -4001,6 +5074,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, SqlResourcesDeleteSqlUserDefinedFunctionResponse>>; 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>>; @@ -4011,6 +5086,16 @@ 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; + beginSqlDatabasePartitionMerge(resourceGroupName: string, accountName: string, databaseName: string, mergeParameters: MergeParameters, options?: SqlResourcesSqlDatabasePartitionMergeOptionalParams): Promise, SqlResourcesSqlDatabasePartitionMergeResponse>>; + beginSqlDatabasePartitionMergeAndWait(resourceGroupName: string, accountName: string, databaseName: string, mergeParameters: MergeParameters, options?: SqlResourcesSqlDatabasePartitionMergeOptionalParams): Promise; + beginSqlDatabaseRedistributeThroughput(resourceGroupName: string, accountName: string, databaseName: string, redistributeThroughputParameters: RedistributeThroughputParameters, options?: SqlResourcesSqlDatabaseRedistributeThroughputOptionalParams): Promise, SqlResourcesSqlDatabaseRedistributeThroughputResponse>>; + beginSqlDatabaseRedistributeThroughputAndWait(resourceGroupName: string, accountName: string, databaseName: string, redistributeThroughputParameters: RedistributeThroughputParameters, options?: SqlResourcesSqlDatabaseRedistributeThroughputOptionalParams): Promise; + beginSqlDatabaseRetrieveThroughputDistribution(resourceGroupName: string, accountName: string, databaseName: string, retrieveThroughputParameters: RetrieveThroughputParameters, options?: SqlResourcesSqlDatabaseRetrieveThroughputDistributionOptionalParams): Promise, SqlResourcesSqlDatabaseRetrieveThroughputDistributionResponse>>; + beginSqlDatabaseRetrieveThroughputDistributionAndWait(resourceGroupName: string, accountName: string, databaseName: string, retrieveThroughputParameters: RetrieveThroughputParameters, options?: SqlResourcesSqlDatabaseRetrieveThroughputDistributionOptionalParams): 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>>; @@ -4307,6 +5392,21 @@ export interface SqlResourcesListClientEncryptionKeysOptionalParams extends core // @public export type SqlResourcesListClientEncryptionKeysResponse = ClientEncryptionKeysListResult; +// @public +export interface SqlResourcesListSqlContainerPartitionMergeHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface SqlResourcesListSqlContainerPartitionMergeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlResourcesListSqlContainerPartitionMergeResponse = PhysicalPartitionStorageInfoCollection; + // @public export interface SqlResourcesListSqlContainersOptionalParams extends coreClient.OperationOptions { } @@ -4425,6 +5525,81 @@ export interface SqlResourcesRetrieveContinuousBackupInformationOptionalParams e // @public export type SqlResourcesRetrieveContinuousBackupInformationResponse = BackupInformation; +// @public +export interface SqlResourcesSqlContainerRedistributeThroughputHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface SqlResourcesSqlContainerRedistributeThroughputOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlResourcesSqlContainerRedistributeThroughputResponse = PhysicalPartitionThroughputInfoResult; + +// @public +export interface SqlResourcesSqlContainerRetrieveThroughputDistributionHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlResourcesSqlContainerRetrieveThroughputDistributionResponse = PhysicalPartitionThroughputInfoResult; + +// @public +export interface SqlResourcesSqlDatabasePartitionMergeHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface SqlResourcesSqlDatabasePartitionMergeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlResourcesSqlDatabasePartitionMergeResponse = PhysicalPartitionStorageInfoCollection; + +// @public +export interface SqlResourcesSqlDatabaseRedistributeThroughputHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface SqlResourcesSqlDatabaseRedistributeThroughputOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlResourcesSqlDatabaseRedistributeThroughputResponse = PhysicalPartitionThroughputInfoResult; + +// @public +export interface SqlResourcesSqlDatabaseRetrieveThroughputDistributionHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface SqlResourcesSqlDatabaseRetrieveThroughputDistributionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlResourcesSqlDatabaseRetrieveThroughputDistributionResponse = PhysicalPartitionThroughputInfoResult; + // @public export interface SqlResourcesUpdateSqlContainerThroughputHeaders { azureAsyncOperation?: string; @@ -4581,6 +5756,9 @@ export interface SqlUserDefinedFunctionResource { // @public export type Status = string; +// @public +export type SupportedActions = "Enable" | "Disable"; + // @public export interface SystemData { createdAt?: Date; @@ -4629,8 +5807,16 @@ export interface TableResource { export interface TableResources { beginCreateUpdateTable(resourceGroupName: string, accountName: string, tableName: string, createUpdateTableParameters: TableCreateUpdateParameters, options?: TableResourcesCreateUpdateTableOptionalParams): Promise, TableResourcesCreateUpdateTableResponse>>; beginCreateUpdateTableAndWait(resourceGroupName: string, accountName: string, tableName: string, createUpdateTableParameters: TableCreateUpdateParameters, options?: TableResourcesCreateUpdateTableOptionalParams): Promise; + beginCreateUpdateTableRoleAssignment(resourceGroupName: string, accountName: string, roleAssignmentId: string, createUpdateTableRoleAssignmentParameters: TableRoleAssignmentResource, options?: TableResourcesCreateUpdateTableRoleAssignmentOptionalParams): Promise, TableResourcesCreateUpdateTableRoleAssignmentResponse>>; + beginCreateUpdateTableRoleAssignmentAndWait(resourceGroupName: string, accountName: string, roleAssignmentId: string, createUpdateTableRoleAssignmentParameters: TableRoleAssignmentResource, options?: TableResourcesCreateUpdateTableRoleAssignmentOptionalParams): Promise; + beginCreateUpdateTableRoleDefinition(resourceGroupName: string, accountName: string, roleDefinitionId: string, createUpdateTableRoleDefinitionParameters: TableRoleDefinitionResource, options?: TableResourcesCreateUpdateTableRoleDefinitionOptionalParams): Promise, TableResourcesCreateUpdateTableRoleDefinitionResponse>>; + beginCreateUpdateTableRoleDefinitionAndWait(resourceGroupName: string, accountName: string, roleDefinitionId: string, createUpdateTableRoleDefinitionParameters: TableRoleDefinitionResource, options?: TableResourcesCreateUpdateTableRoleDefinitionOptionalParams): Promise; beginDeleteTable(resourceGroupName: string, accountName: string, tableName: string, options?: TableResourcesDeleteTableOptionalParams): Promise, TableResourcesDeleteTableResponse>>; beginDeleteTableAndWait(resourceGroupName: string, accountName: string, tableName: string, options?: TableResourcesDeleteTableOptionalParams): Promise; + beginDeleteTableRoleAssignment(resourceGroupName: string, accountName: string, roleAssignmentId: string, options?: TableResourcesDeleteTableRoleAssignmentOptionalParams): Promise, void>>; + beginDeleteTableRoleAssignmentAndWait(resourceGroupName: string, accountName: string, roleAssignmentId: string, options?: TableResourcesDeleteTableRoleAssignmentOptionalParams): Promise; + beginDeleteTableRoleDefinition(resourceGroupName: string, accountName: string, roleDefinitionId: string, options?: TableResourcesDeleteTableRoleDefinitionOptionalParams): Promise, void>>; + beginDeleteTableRoleDefinitionAndWait(resourceGroupName: string, accountName: string, roleDefinitionId: string, options?: TableResourcesDeleteTableRoleDefinitionOptionalParams): Promise; beginMigrateTableToAutoscale(resourceGroupName: string, accountName: string, tableName: string, options?: TableResourcesMigrateTableToAutoscaleOptionalParams): Promise, TableResourcesMigrateTableToAutoscaleResponse>>; beginMigrateTableToAutoscaleAndWait(resourceGroupName: string, accountName: string, tableName: string, options?: TableResourcesMigrateTableToAutoscaleOptionalParams): Promise; beginMigrateTableToManualThroughput(resourceGroupName: string, accountName: string, tableName: string, options?: TableResourcesMigrateTableToManualThroughputOptionalParams): Promise, TableResourcesMigrateTableToManualThroughputResponse>>; @@ -4640,7 +5826,11 @@ export interface TableResources { beginUpdateTableThroughput(resourceGroupName: string, accountName: string, tableName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: TableResourcesUpdateTableThroughputOptionalParams): Promise, TableResourcesUpdateTableThroughputResponse>>; beginUpdateTableThroughputAndWait(resourceGroupName: string, accountName: string, tableName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: TableResourcesUpdateTableThroughputOptionalParams): Promise; getTable(resourceGroupName: string, accountName: string, tableName: string, options?: TableResourcesGetTableOptionalParams): Promise; + getTableRoleAssignment(resourceGroupName: string, accountName: string, roleAssignmentId: string, options?: TableResourcesGetTableRoleAssignmentOptionalParams): Promise; + getTableRoleDefinition(resourceGroupName: string, accountName: string, roleDefinitionId: string, options?: TableResourcesGetTableRoleDefinitionOptionalParams): Promise; getTableThroughput(resourceGroupName: string, accountName: string, tableName: string, options?: TableResourcesGetTableThroughputOptionalParams): Promise; + listTableRoleAssignments(resourceGroupName: string, accountName: string, options?: TableResourcesListTableRoleAssignmentsOptionalParams): PagedAsyncIterableIterator; + listTableRoleDefinitions(resourceGroupName: string, accountName: string, options?: TableResourcesListTableRoleDefinitionsOptionalParams): PagedAsyncIterableIterator; listTables(resourceGroupName: string, accountName: string, options?: TableResourcesListTablesOptionalParams): PagedAsyncIterableIterator; } @@ -4659,6 +5849,36 @@ export interface TableResourcesCreateUpdateTableOptionalParams extends coreClien // @public export type TableResourcesCreateUpdateTableResponse = TableGetResults; +// @public +export interface TableResourcesCreateUpdateTableRoleAssignmentHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface TableResourcesCreateUpdateTableRoleAssignmentOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type TableResourcesCreateUpdateTableRoleAssignmentResponse = TableRoleAssignmentResource; + +// @public +export interface TableResourcesCreateUpdateTableRoleDefinitionHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface TableResourcesCreateUpdateTableRoleDefinitionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type TableResourcesCreateUpdateTableRoleDefinitionResponse = TableRoleDefinitionResource; + // @public export interface TableResourcesDeleteTableHeaders { azureAsyncOperation?: string; @@ -4674,6 +5894,30 @@ export interface TableResourcesDeleteTableOptionalParams extends coreClient.Oper // @public export type TableResourcesDeleteTableResponse = TableResourcesDeleteTableHeaders; +// @public +export interface TableResourcesDeleteTableRoleAssignmentHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface TableResourcesDeleteTableRoleAssignmentOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface TableResourcesDeleteTableRoleDefinitionHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface TableResourcesDeleteTableRoleDefinitionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + // @public export interface TableResourcesGetTableOptionalParams extends coreClient.OperationOptions { } @@ -4681,6 +5925,20 @@ export interface TableResourcesGetTableOptionalParams extends coreClient.Operati // @public export type TableResourcesGetTableResponse = TableGetResults; +// @public +export interface TableResourcesGetTableRoleAssignmentOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TableResourcesGetTableRoleAssignmentResponse = TableRoleAssignmentResource; + +// @public +export interface TableResourcesGetTableRoleDefinitionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TableResourcesGetTableRoleDefinitionResponse = TableRoleDefinitionResource; + // @public export interface TableResourcesGetTableThroughputOptionalParams extends coreClient.OperationOptions { } @@ -4688,6 +5946,20 @@ export interface TableResourcesGetTableThroughputOptionalParams extends coreClie // @public export type TableResourcesGetTableThroughputResponse = ThroughputSettingsGetResults; +// @public +export interface TableResourcesListTableRoleAssignmentsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TableResourcesListTableRoleAssignmentsResponse = TableRoleAssignmentListResult; + +// @public +export interface TableResourcesListTableRoleDefinitionsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type TableResourcesListTableRoleDefinitionsResponse = TableRoleDefinitionListResult; + // @public export interface TableResourcesListTablesOptionalParams extends coreClient.OperationOptions { } @@ -4749,12 +6021,242 @@ export interface TableResourcesUpdateTableThroughputOptionalParams extends coreC // @public export type TableResourcesUpdateTableThroughputResponse = ThroughputSettingsGetResults; +// @public +export interface TableRoleAssignmentListResult { + readonly nextLink?: string; + readonly value?: TableRoleAssignmentResource[]; +} + +// @public +export interface TableRoleAssignmentResource extends ProxyResource { + principalId?: string; + readonly provisioningState?: string; + roleDefinitionId?: string; + scope?: string; +} + +// @public +export interface TableRoleDefinitionListResult { + readonly nextLink?: string; + readonly value?: TableRoleDefinitionResource[]; +} + +// @public +export interface TableRoleDefinitionResource extends ProxyResource { + assignableScopes?: string[]; + idPropertiesId?: string; + permissions?: PermissionAutoGenerated[]; + roleName?: string; + typePropertiesType?: RoleDefinitionType; +} + +// @public +export interface ThroughputBucketResource { + id: number; + maxThroughputPercentage: number; +} + // @public export interface ThroughputPolicyResource { incrementPercent?: number; isEnabled?: boolean; } +// @public +export type ThroughputPolicyType = string; + +// @public +export interface ThroughputPool { + beginCreateOrUpdate(resourceGroupName: string, throughputPoolName: string, body: ThroughputPoolResource, options?: ThroughputPoolCreateOrUpdateOptionalParams): Promise, ThroughputPoolCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, throughputPoolName: string, body: ThroughputPoolResource, options?: ThroughputPoolCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, throughputPoolName: string, options?: ThroughputPoolDeleteOptionalParams): Promise, ThroughputPoolDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, throughputPoolName: string, options?: ThroughputPoolDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, throughputPoolName: string, options?: ThroughputPoolUpdateOptionalParams): Promise, ThroughputPoolUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, throughputPoolName: string, options?: ThroughputPoolUpdateOptionalParams): Promise; + get(resourceGroupName: string, throughputPoolName: string, options?: ThroughputPoolGetOptionalParams): Promise; +} + +// @public +export interface ThroughputPoolAccount { + beginCreate(resourceGroupName: string, throughputPoolName: string, throughputPoolAccountName: string, body: ThroughputPoolAccountResource, options?: ThroughputPoolAccountCreateOptionalParams): Promise, ThroughputPoolAccountCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, throughputPoolName: string, throughputPoolAccountName: string, body: ThroughputPoolAccountResource, options?: ThroughputPoolAccountCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, throughputPoolName: string, throughputPoolAccountName: string, options?: ThroughputPoolAccountDeleteOptionalParams): Promise, ThroughputPoolAccountDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, throughputPoolName: string, throughputPoolAccountName: string, options?: ThroughputPoolAccountDeleteOptionalParams): Promise; + get(resourceGroupName: string, throughputPoolName: string, throughputPoolAccountName: string, options?: ThroughputPoolAccountGetOptionalParams): Promise; +} + +// @public +export interface ThroughputPoolAccountCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface ThroughputPoolAccountCreateParameters { + accountLocation?: string; + accountResourceIdentifier?: string; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export type ThroughputPoolAccountCreateResponse = ThroughputPoolAccountResource; + +// @public +export interface ThroughputPoolAccountDeleteHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface ThroughputPoolAccountDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ThroughputPoolAccountDeleteResponse = ThroughputPoolAccountDeleteHeaders; + +// @public +export interface ThroughputPoolAccountGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ThroughputPoolAccountGetResponse = ThroughputPoolAccountResource; + +// @public +export interface ThroughputPoolAccountResource extends ProxyResource { + readonly accountInstanceId?: string; + accountLocation?: string; + accountResourceIdentifier?: string; + provisioningState?: Status; +} + +// @public +export interface ThroughputPoolAccounts { + list(resourceGroupName: string, throughputPoolName: string, options?: ThroughputPoolAccountsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ThroughputPoolAccountsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ThroughputPoolAccountsListNextResponse = ThroughputPoolAccountsListResult; + +// @public +export interface ThroughputPoolAccountsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ThroughputPoolAccountsListResponse = ThroughputPoolAccountsListResult; + +// @public +export interface ThroughputPoolAccountsListResult { + readonly nextLink?: string; + readonly value?: ThroughputPoolAccountResource[]; +} + +// @public +export interface ThroughputPoolCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ThroughputPoolCreateOrUpdateResponse = ThroughputPoolResource; + +// @public +export interface ThroughputPoolDeleteHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface ThroughputPoolDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ThroughputPoolDeleteResponse = ThroughputPoolDeleteHeaders; + +// @public +export interface ThroughputPoolGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ThroughputPoolGetResponse = ThroughputPoolResource; + +// @public +export interface ThroughputPoolResource extends TrackedResource { + maxThroughput?: number; + provisioningState?: Status; +} + +// @public +export interface ThroughputPools { + list(options?: ThroughputPoolsListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: ThroughputPoolsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ThroughputPoolsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ThroughputPoolsListByResourceGroupNextResponse = ThroughputPoolsListResult; + +// @public +export interface ThroughputPoolsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ThroughputPoolsListByResourceGroupResponse = ThroughputPoolsListResult; + +// @public +export interface ThroughputPoolsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ThroughputPoolsListNextResponse = ThroughputPoolsListResult; + +// @public +export interface ThroughputPoolsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ThroughputPoolsListResponse = ThroughputPoolsListResult; + +// @public +export interface ThroughputPoolsListResult { + readonly nextLink?: string; + readonly value?: ThroughputPoolResource[]; +} + +// @public +export interface ThroughputPoolUpdate { + maxThroughput?: number; + provisioningState?: Status; +} + +// @public +export interface ThroughputPoolUpdateHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface ThroughputPoolUpdateOptionalParams extends coreClient.OperationOptions { + body?: ThroughputPoolUpdate; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type ThroughputPoolUpdateResponse = ThroughputPoolResource; + // @public (undocumented) export interface ThroughputSettingsGetPropertiesResource extends ThroughputSettingsResource, ExtendedResourceProperties { } @@ -4773,6 +6275,7 @@ export interface ThroughputSettingsResource { readonly offerReplacePending?: string; readonly softAllowedMaximumThroughput?: string; throughput?: number; + throughputBuckets?: ThroughputBucketResource[]; } // @public @@ -4780,6 +6283,14 @@ export interface ThroughputSettingsUpdateParameters extends ARMResourcePropertie resource: ThroughputSettingsResource; } +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + // @public export type TriggerOperation = string; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersCreateUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersCreateUpdateSample.ts index 8bca62048601..411d70202b20 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersCreateUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersCreateUpdateSample.ts @@ -10,20 +10,18 @@ // Licensed under the MIT License. import { ClusterResource, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. * * @summary Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterCreate.json */ async function cosmosDbManagedCassandraClusterCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || - "ffffffff-ffff-ffff-ffff-ffffffffffff"; + "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersDeallocateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersDeallocateSample.ts index f9921c9e8fe1..75d22f0fc4b2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersDeallocateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersDeallocateSample.ts @@ -10,20 +10,18 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. * * @summary Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDeallocate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json */ async function cosmosDbManagedCassandraClusterDeallocate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || - "ffffffff-ffff-ffff-ffff-ffffffffffff"; + "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersDeleteSample.ts index 305528d5a968..e10b930b7720 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes a managed Cassandra cluster. * * @summary Deletes a managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDelete.json */ async function cosmosDbManagedCassandraClusterDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersGetBackupSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersGetBackupSample.ts new file mode 100644 index 000000000000..f05cbb420245 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersGetBackupSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get the properties of an individual backup of this cluster that is available to restore. + * + * @summary Get the properties of an individual backup of this cluster that is available to restore. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackup.json + */ +async function cosmosDbManagedCassandraBackup() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const backupId = "1611250348"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraClusters.getBackup( + resourceGroupName, + clusterName, + backupId, + ); + console.log(result); +} + +async function main() { + cosmosDbManagedCassandraBackup(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersGetCommandAsyncSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersGetCommandAsyncSample.ts new file mode 100644 index 000000000000..f2437218b52c --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersGetCommandAsyncSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get details about a specified command that was run asynchronously. + * + * @summary Get details about a specified command that was run asynchronously. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandResult.json + */ +async function cosmosDbManagedCassandraCommandResult() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const commandId = "318653d0-3da5-4814-b8f6-429f2af0b2a4"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraClusters.getCommandAsync( + resourceGroupName, + clusterName, + commandId, + ); + console.log(result); +} + +async function main() { + cosmosDbManagedCassandraCommandResult(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersGetSample.ts index 6819bbc9eda0..cd610e8f66d7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the properties of a managed Cassandra cluster. * * @summary Get the properties of a managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json */ async function cosmosDbManagedCassandraClusterGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersInvokeCommandAsyncSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersInvokeCommandAsyncSample.ts new file mode 100644 index 000000000000..ec06e542f3b0 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersInvokeCommandAsyncSample.ts @@ -0,0 +1,50 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CommandAsyncPostBody, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Invoke a command like nodetool for cassandra maintenance asynchronously + * + * @summary Invoke a command like nodetool for cassandra maintenance asynchronously + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandAsync.json + */ +async function cosmosDbManagedCassandraCommandAsync() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const body: CommandAsyncPostBody = { + arguments: { status: "" }, + command: "nodetool", + host: "10.0.1.12", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraClusters.beginInvokeCommandAsyncAndWait( + resourceGroupName, + clusterName, + body, + ); + console.log(result); +} + +async function main() { + cosmosDbManagedCassandraCommandAsync(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersInvokeCommandSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersInvokeCommandSample.ts index fb53183bd163..d9508c107232 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersInvokeCommandSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersInvokeCommandSample.ts @@ -10,25 +10,24 @@ // Licensed under the MIT License. import { CommandPostBody, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Invoke a command like nodetool for cassandra maintenance * * @summary Invoke a command like nodetool for cassandra maintenance - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraCommand.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommand.json */ async function cosmosDbManagedCassandraCommand() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || - "ffffffff-ffff-ffff-ffff-ffffffffffff"; + "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; const body: CommandPostBody = { - command: "nodetool status", + arguments: { status: "" }, + command: "nodetool", host: "10.0.1.12", }; const credential = new DefaultAzureCredential(); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListBackupsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListBackupsSample.ts new file mode 100644 index 000000000000..43f156df7fa2 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListBackupsSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to List the backups of this cluster that are available to restore. + * + * @summary List the backups of this cluster that are available to restore. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackupsList.json + */ +async function cosmosDbManagedCassandraBackupsList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cassandraClusters.listBackups( + resourceGroupName, + clusterName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbManagedCassandraBackupsList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListByResourceGroupSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListByResourceGroupSample.ts index 4c761b69428b..c22224e47a7a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListByResourceGroupSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListByResourceGroupSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to List all managed Cassandra clusters in this resource group. * * @summary List all managed Cassandra clusters in this resource group. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json */ async function cosmosDbManagedCassandraClusterListByResourceGroup() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListBySubscriptionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListBySubscriptionSample.ts index 6a527fcb2480..8fdfcf27e81e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListBySubscriptionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListBySubscriptionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to List all managed Cassandra clusters in this subscription. * * @summary List all managed Cassandra clusters in this subscription. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json */ async function cosmosDbManagedCassandraClusterListBySubscription() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListCommandSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListCommandSample.ts new file mode 100644 index 000000000000..c028d0d73de5 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersListCommandSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to List all commands currently running on ring info + * + * @summary List all commands currently running on ring info + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraListCommand.json + */ +async function cosmosDbManagedCassandraListCommand() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cassandraClusters.listCommand( + resourceGroupName, + clusterName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbManagedCassandraListCommand(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersStartSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersStartSample.ts index 01ce3133be11..190c9122fd02 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersStartSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersStartSample.ts @@ -10,20 +10,18 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. * * @summary Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterStart.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterStart.json */ async function cosmosDbManagedCassandraClusterStart() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || - "ffffffff-ffff-ffff-ffff-ffffffffffff"; + "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersStatusSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersStatusSample.ts index 4611df59ed61..ccfc6aea3692 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersStatusSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersStatusSample.ts @@ -10,20 +10,18 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. * * @summary Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraStatus.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraStatus.json */ async function cosmosDbManagedCassandraStatus() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || - "ffffffff-ffff-ffff-ffff-ffffffffffff"; + "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersUpdateSample.ts index 7f32c64094ac..f6b18c085210 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraClustersUpdateSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { ClusterResource, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Updates some of the properties of a managed Cassandra cluster. * * @summary Updates some of the properties of a managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterPatch.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterPatch.json */ async function cosmosDbManagedCassandraClusterPatch() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersCreateUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersCreateUpdateSample.ts index 0063d200cede..685b80b61a58 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersCreateUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersCreateUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. * * @summary Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json */ async function cosmosDbManagedCassandraDataCenterCreate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersDeleteSample.ts index 6fbb7c22e9eb..e92bf2fbaf18 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Delete a managed Cassandra data center. * * @summary Delete a managed Cassandra data center. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json */ async function cosmosDbManagedCassandraDataCenterDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersGetSample.ts index 2f318343f58c..5bc746eadf3e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the properties of a managed Cassandra data center. * * @summary Get the properties of a managed Cassandra data center. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json */ async function cosmosDbManagedCassandraDataCenterGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersListSample.ts index f8785f6bb8d0..3e9c05ba21ea 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to List all data centers in a particular managed Cassandra cluster. * * @summary List all data centers in a particular managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterList.json */ async function cosmosDbManagedCassandraDataCenterList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersUpdateSample.ts index c5076eef70d5..ca10b79dbbca 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraDataCentersUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update some of the properties of a managed Cassandra data center. * * @summary Update some of the properties of a managed Cassandra data center. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterPatch.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json */ async function cosmosDbManagedCassandraDataCenterUpdate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts index 8852b7800b07..850e8554e675 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB Cassandra keyspace * * @summary Create or update an Azure Cosmos DB Cassandra keyspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json */ async function cosmosDbCassandraKeyspaceCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesCreateUpdateCassandraTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesCreateUpdateCassandraTableSample.ts index 33d54648df1f..04ca68d90a36 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesCreateUpdateCassandraTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesCreateUpdateCassandraTableSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB Cassandra Table * * @summary Create or update an Azure Cosmos DB Cassandra Table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json */ async function cosmosDbCassandraTableCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -39,6 +37,7 @@ async function cosmosDbCassandraTableCreateUpdate() { columns: [{ name: "columnA", type: "Ascii" }], partitionKeys: [{ name: "columnA" }], }, + analyticalStorageTtl: 500, defaultTtl: 100, id: "tableName", }, diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesCreateUpdateCassandraViewSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesCreateUpdateCassandraViewSample.ts new file mode 100644 index 000000000000..7493aa2cb317 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesCreateUpdateCassandraViewSample.ts @@ -0,0 +1,57 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CassandraViewCreateUpdateParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB Cassandra View + * + * @summary Create or update an Azure Cosmos DB Cassandra View + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json + */ +async function cosmosDbCassandraViewCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const createUpdateCassandraViewParameters: CassandraViewCreateUpdateParameters = + { + options: {}, + resource: { + id: "viewname", + viewDefinition: + "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)", + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.cassandraResources.beginCreateUpdateCassandraViewAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + createUpdateCassandraViewParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesDeleteCassandraKeyspaceSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesDeleteCassandraKeyspaceSample.ts index c4da7654f91f..2fa4d45c7121 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesDeleteCassandraKeyspaceSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesDeleteCassandraKeyspaceSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @summary Deletes an existing Azure Cosmos DB Cassandra keyspace. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceDelete.json */ async function cosmosDbCassandraKeyspaceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesDeleteCassandraTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesDeleteCassandraTableSample.ts index 38f8a1a96595..e301c83486c3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesDeleteCassandraTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesDeleteCassandraTableSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Cassandra table. * * @summary Deletes an existing Azure Cosmos DB Cassandra table. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableDelete.json */ async function cosmosDbCassandraTableDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesDeleteCassandraViewSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesDeleteCassandraViewSample.ts new file mode 100644 index 000000000000..c6416a7c063e --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesDeleteCassandraViewSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Cassandra view. + * + * @summary Deletes an existing Azure Cosmos DB Cassandra view. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewDelete.json + */ +async function cosmosDbCassandraViewDelete() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.cassandraResources.beginDeleteCassandraViewAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraKeyspaceSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraKeyspaceSample.ts index d4409999eff6..522a96117a76 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraKeyspaceSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraKeyspaceSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json */ async function cosmosDbCassandraKeyspaceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts index 7bcfe6468efa..dbab1b9419f6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json */ async function cosmosDbCassandraKeyspaceThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraTableSample.ts index 86671e8836bc..2b878e6c585c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraTableSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Cassandra table under an existing Azure Cosmos DB database account. * * @summary Gets the Cassandra table under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json */ async function cosmosDbCassandraTableGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraTableThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraTableThroughputSample.ts index b7da9da74893..af13cc764f1a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraTableThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraTableThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputGet.json */ async function cosmosDbCassandraTableThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraViewSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraViewSample.ts new file mode 100644 index 000000000000..e3ead5198ba1 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraViewSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets the Cassandra view under an existing Azure Cosmos DB database account. + * + * @summary Gets the Cassandra view under an existing Azure Cosmos DB database account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewGet.json + */ +async function cosmosDbCassandraViewGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraResources.getCassandraView( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraViewThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraViewThroughputSample.ts new file mode 100644 index 000000000000..aefdec56e955 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesGetCassandraViewThroughputSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. + * + * @summary Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputGet.json + */ +async function cosmosDbCassandraViewThroughputGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraResources.getCassandraViewThroughput( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewThroughputGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesListCassandraKeyspacesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesListCassandraKeyspacesSample.ts index 3528b88c0cd2..eed74e2308c7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesListCassandraKeyspacesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesListCassandraKeyspacesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. * * @summary Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceList.json */ async function cosmosDbCassandraKeyspaceList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesListCassandraTablesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesListCassandraTablesSample.ts index dec60e9b51ac..5b41a97f2477 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesListCassandraTablesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesListCassandraTablesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the Cassandra table under an existing Azure Cosmos DB database account. * * @summary Lists the Cassandra table under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableList.json */ async function cosmosDbCassandraTableList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesListCassandraViewsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesListCassandraViewsSample.ts new file mode 100644 index 000000000000..89c8a01fad69 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesListCassandraViewsSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * + * @summary Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewList.json + */ +async function cosmosDbCassandraViewList() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cassandraResources.listCassandraViews( + resourceGroupName, + accountName, + keyspaceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbCassandraViewList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts index 040aa3e633a6..c06ce968e3bb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json */ async function cosmosDbCassandraKeyspaceMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts index 528ad35b9a01..d97927e0b2fc 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json */ async function cosmosDbCassandraKeyspaceMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts index eae2d7bcd56d..5f018418032c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json */ async function cosmosDbCassandraTableMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts index f8619f3a3ddf..c2a7bfa17349 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json */ async function cosmosDbCassandraTableMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraViewToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraViewToAutoscaleSample.ts new file mode 100644 index 000000000000..eab726f8ce01 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraViewToAutoscaleSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale + * + * @summary Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json + */ +async function cosmosDbCassandraViewMigrateToAutoscale() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.cassandraResources.beginMigrateCassandraViewToAutoscaleAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewMigrateToAutoscale(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraViewToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraViewToManualThroughputSample.ts new file mode 100644 index 000000000000..12c2ef9c1cf8 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesMigrateCassandraViewToManualThroughputSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput + * + * @summary Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json + */ +async function cosmosDbCassandraViewMigrateToManualThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.cassandraResources.beginMigrateCassandraViewToManualThroughputAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewMigrateToManualThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts index 79380043f650..d04206f87424 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Cassandra Keyspace * * @summary Update RUs per second of an Azure Cosmos DB Cassandra Keyspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json */ async function cosmosDbCassandraKeyspaceThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesUpdateCassandraTableThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesUpdateCassandraTableThroughputSample.ts index 4486041f9cac..1abd55d1ccb4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesUpdateCassandraTableThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesUpdateCassandraTableThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Cassandra table * * @summary Update RUs per second of an Azure Cosmos DB Cassandra table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputUpdate.json */ async function cosmosDbCassandraTableThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesUpdateCassandraViewThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesUpdateCassandraViewThroughputSample.ts new file mode 100644 index 000000000000..43ec3c94e686 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/cassandraResourcesUpdateCassandraViewThroughputSample.ts @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ThroughputSettingsUpdateParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Cassandra view + * + * @summary Update RUs per second of an Azure Cosmos DB Cassandra view + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputUpdate.json + */ +async function cosmosDbCassandraViewThroughputUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const updateThroughputParameters: ThroughputSettingsUpdateParameters = { + resource: { throughput: 400 }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.cassandraResources.beginUpdateCassandraViewThroughputAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + updateThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewThroughputUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/chaosFaultEnableDisableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/chaosFaultEnableDisableSample.ts new file mode 100644 index 000000000000..feeeed5bf950 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/chaosFaultEnableDisableSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ChaosFaultResource, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Enable, disable Chaos Fault in a CosmosDB account. + * + * @summary Enable, disable Chaos Fault in a CosmosDB account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultEnableDisable.json + */ +async function chaosFaultEnableDisable() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const chaosFault = "ServiceUnavailability"; + const chaosFaultRequest: ChaosFaultResource = { + action: "Enable", + containerName: "testCollection", + databaseName: "testDatabase", + region: "EastUS", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.chaosFault.beginEnableDisableAndWait( + resourceGroupName, + accountName, + chaosFault, + chaosFaultRequest, + ); + console.log(result); +} + +async function main() { + chaosFaultEnableDisable(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/chaosFaultGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/chaosFaultGetSample.ts new file mode 100644 index 000000000000..00c9822ad5db --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/chaosFaultGetSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @summary Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultGet.json + */ +async function chaosFaultGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const chaosFault = "ServiceUnavailability"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.chaosFault.get( + resourceGroupName, + accountName, + chaosFault, + ); + console.log(result); +} + +async function main() { + chaosFaultGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/chaosFaultListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/chaosFaultListSample.ts new file mode 100644 index 000000000000..c02aaa1aca78 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/chaosFaultListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to List Chaos Faults for CosmosDB account. + * + * @summary List Chaos Faults for CosmosDB account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultList.json + */ +async function chaosFaultList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.chaosFault.list( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + chaosFaultList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListMetricDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListMetricDefinitionsSample.ts index 23a5c1caf82b..031f6c048eb7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListMetricDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListMetricDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves metric definitions for the given collection. * * @summary Retrieves metric definitions for the given collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetricDefinitions.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetricDefinitions.json */ async function cosmosDbCollectionGetMetricDefinitions() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListMetricsSample.ts index 309e967251fc..720816bb3971 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account and collection. * * @summary Retrieves the metrics determined by the given filter for the given database account and collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetrics.json */ async function cosmosDbCollectionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListUsagesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListUsagesSample.ts index df5bbd097f9b..52ee5f8c9f28 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListUsagesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionListUsagesSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the usages (most recent storage data) for the given collection. * * @summary Retrieves the usages (most recent storage data) for the given collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetUsages.json */ async function cosmosDbCollectionGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionListMetricsSample.ts index f2dbf377db42..a7b8778715f9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given collection, split by partition. * * @summary Retrieves the metrics determined by the given filter for the given collection, split by partition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionListUsagesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionListUsagesSample.ts index de0deff0d157..767062d1fe30 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionListUsagesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionListUsagesSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the usages (most recent storage data) for the given collection, split by partition. * * @summary Retrieves the usages (most recent storage data) for the given collection, split by partition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetUsages.json */ async function cosmosDbCollectionGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionRegionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionRegionListMetricsSample.ts index 98412819df88..03d29014f5ba 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionRegionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionPartitionRegionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given collection and region, split by partition. * * @summary Retrieves the metrics determined by the given filter for the given collection and region, split by partition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionRegionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionRegionListMetricsSample.ts index d8f0a40976b7..34206260507c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionRegionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/collectionRegionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account, collection and region. * * @summary Retrieves the metrics determined by the given filter for the given database account, collection and region. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRegionCollectionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRegionCollectionGetMetrics.json */ async function cosmosDbRegionCollectionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsCancelSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsCancelSample.ts new file mode 100644 index 000000000000..2edc6a3da708 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsCancelSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Cancels a Data Transfer Job. + * + * @summary Cancels a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json + */ +async function cosmosDbDataTransferJobCancel() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.cancel( + resourceGroupName, + accountName, + jobName, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobCancel(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsCompleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsCompleteSample.ts new file mode 100644 index 000000000000..fb60cbec2f20 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsCompleteSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Completes a Data Transfer Online Job. + * + * @summary Completes a Data Transfer Online Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json + */ +async function cosmosDbDataTransferJobComplete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "e35cc6eb-c8e3-447b-8de6-b83328cd0098"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.complete( + resourceGroupName, + accountName, + jobName, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobComplete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsCreateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsCreateSample.ts new file mode 100644 index 000000000000..32ecbac87cf5 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsCreateSample.ts @@ -0,0 +1,58 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateJobRequest, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Creates a Data Transfer Job. + * + * @summary Creates a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json + */ +async function cosmosDbDataTransferJobCreate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const jobCreateParameters: CreateJobRequest = { + properties: { + destination: { + component: "AzureBlobStorage", + containerName: "blob_container", + endpointUrl: "https://blob.windows.net", + }, + source: { + component: "CosmosDBCassandra", + keyspaceName: "keyspace", + tableName: "table", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.create( + resourceGroupName, + accountName, + jobName, + jobCreateParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobCreate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsGetSample.ts new file mode 100644 index 000000000000..ed3584988c38 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsGetSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get a Data Transfer Job. + * + * @summary Get a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json + */ +async function cosmosDbDataTransferJobGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.get( + resourceGroupName, + accountName, + jobName, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsListByDatabaseAccountSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsListByDatabaseAccountSample.ts new file mode 100644 index 000000000000..c21ad829039d --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsListByDatabaseAccountSample.ts @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get a list of Data Transfer jobs. + * + * @summary Get a list of Data Transfer jobs. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json + */ +async function cosmosDbDataTransferJobFeed() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dataTransferJobs.listByDatabaseAccount( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbDataTransferJobFeed(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsPauseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsPauseSample.ts new file mode 100644 index 000000000000..53c1763dc616 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsPauseSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Pause a Data Transfer Job. + * + * @summary Pause a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json + */ +async function cosmosDbDataTransferJobPause() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.pause( + resourceGroupName, + accountName, + jobName, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobPause(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsResumeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsResumeSample.ts new file mode 100644 index 000000000000..fc65c0182f23 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/dataTransferJobsResumeSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Resumes a Data Transfer Job. + * + * @summary Resumes a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json + */ +async function cosmosDbDataTransferJobResume() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.resume( + resourceGroupName, + accountName, + jobName, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobResume(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountRegionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountRegionListMetricsSample.ts index 1a6451403d12..cafaf877d6be 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountRegionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountRegionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account and region. * * @summary Retrieves the metrics determined by the given filter for the given database account and region. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsCheckNameExistsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsCheckNameExistsSample.ts index b0c0947cbfb0..d72656f7eaa7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsCheckNameExistsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsCheckNameExistsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. * * @summary Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCheckNameExists.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json */ async function cosmosDbDatabaseAccountCheckNameExists() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsCreateOrUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsCreateOrUpdateSample.ts index 681afaed2ad1..7cbae53e8821 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsCreateOrUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsCreateOrUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @summary Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMax.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json */ async function cosmosDbDatabaseAccountCreateMax() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -39,6 +37,7 @@ async function cosmosDbDatabaseAccountCreateMax() { }, }, capacity: { totalThroughputLimit: 2000 }, + capacityMode: "Provisioned", consistencyPolicy: { defaultConsistencyLevel: "BoundedStaleness", maxIntervalInSeconds: 10, @@ -48,10 +47,13 @@ async function cosmosDbDatabaseAccountCreateMax() { createMode: "Default", databaseAccountOfferType: "Standard", defaultIdentity: "FirstPartyIdentity", + defaultPriorityLevel: "Low", enableAnalyticalStorage: true, enableBurstCapacity: true, enableFreeTier: false, + enableMaterializedViews: false, enablePerRegionPerPartitionAutoscale: true, + enablePriorityBasedExecution: true, identity: { type: "SystemAssigned,UserAssigned", userAssignedIdentities: { @@ -103,7 +105,7 @@ async function cosmosDbDatabaseAccountCreateMax() { * This sample demonstrates how to Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @summary Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMin.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMin.json */ async function cosmosDbDatabaseAccountCreateMin() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -135,7 +137,7 @@ async function cosmosDbDatabaseAccountCreateMin() { * This sample demonstrates how to Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @summary Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json */ async function cosmosDbRestoreDatabaseAccountCreateUpdateJson() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -156,6 +158,7 @@ async function cosmosDbRestoreDatabaseAccountCreateUpdateJson() { databaseAccountOfferType: "Standard", enableAnalyticalStorage: true, enableFreeTier: false, + enableMaterializedViews: false, keyVaultKeyUri: "https://myKeyVault.vault.azure.net", kind: "GlobalDocumentDB", location: "westus", @@ -183,6 +186,7 @@ async function cosmosDbRestoreDatabaseAccountCreateUpdateJson() { "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc", restoreTimestampInUtc: new Date("2021-03-11T22:05:09Z"), restoreWithTtlDisabled: false, + sourceBackupLocation: "westus", }, tags: {}, }; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsDeleteSample.ts index 631a75498e50..d47deda2d086 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB database account. * * @summary Deletes an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountDelete.json */ async function cosmosDbDatabaseAccountDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsFailoverPriorityChangeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsFailoverPriorityChangeSample.ts index 104a6a16a74e..d0c75c20a35b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsFailoverPriorityChangeSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsFailoverPriorityChangeSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * * @summary Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json */ async function cosmosDbDatabaseAccountFailoverPriorityChange() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsGetReadOnlyKeysSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsGetReadOnlyKeysSample.ts index a6f1ef65d080..e68c747df5aa 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsGetReadOnlyKeysSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsGetReadOnlyKeysSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @summary Lists the read-only access keys for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json */ async function cosmosDbDatabaseAccountListReadOnlyKeys() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsGetSample.ts index 50f4f4128aa7..810a9bdc5621 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB database account. * * @summary Retrieves the properties of an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json */ async function cosmosDbDatabaseAccountGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListByResourceGroupSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListByResourceGroupSample.ts index f01e63be0013..fd565e2067db 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListByResourceGroupSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListByResourceGroupSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @summary Lists all the Azure Cosmos DB database accounts available under the given resource group. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json */ async function cosmosDbDatabaseAccountListByResourceGroup() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListConnectionStringsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListConnectionStringsSample.ts index 660869b7eaa2..1b4476829790 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListConnectionStringsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListConnectionStringsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the connection strings for the specified Azure Cosmos DB database account. * * @summary Lists the connection strings for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json */ async function cosmosDbDatabaseAccountListConnectionStrings() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -37,7 +35,7 @@ async function cosmosDbDatabaseAccountListConnectionStrings() { * This sample demonstrates how to Lists the connection strings for the specified Azure Cosmos DB database account. * * @summary Lists the connection strings for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json */ async function cosmosDbDatabaseAccountListConnectionStringsMongo() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListKeysSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListKeysSample.ts index 36368b5112b7..2ae907d01f01 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListKeysSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListKeysSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the access keys for the specified Azure Cosmos DB database account. * * @summary Lists the access keys for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListKeys.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListKeys.json */ async function cosmosDbDatabaseAccountListKeys() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListMetricDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListMetricDefinitionsSample.ts index 5bba6a6c03cd..502cae4889b9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListMetricDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListMetricDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves metric definitions for the given database account. * * @summary Retrieves metric definitions for the given database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json */ async function cosmosDbDatabaseAccountGetMetricDefinitions() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListMetricsSample.ts index a799ef3a0bb0..542a81fdb045 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account. * * @summary Retrieves the metrics determined by the given filter for the given database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetrics.json */ async function cosmosDbDatabaseAccountGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListReadOnlyKeysSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListReadOnlyKeysSample.ts index 92f9088cc4dd..ffa597bb6dba 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListReadOnlyKeysSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListReadOnlyKeysSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @summary Lists the read-only access keys for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json */ async function cosmosDbDatabaseAccountListReadOnlyKeys() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListSample.ts index b03a250e3e6c..11218d77b6d8 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all the Azure Cosmos DB database accounts available under the subscription. * * @summary Lists all the Azure Cosmos DB database accounts available under the subscription. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountList.json */ async function cosmosDbDatabaseAccountList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListUsagesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListUsagesSample.ts index e90e1b9b51ca..65e393d731ba 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListUsagesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsListUsagesSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the usages (most recent data) for the given database account. * * @summary Retrieves the usages (most recent data) for the given database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetUsages.json */ async function cosmosDbDatabaseAccountGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsOfflineRegionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsOfflineRegionSample.ts index 5af9489949d3..371d0edb3998 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsOfflineRegionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsOfflineRegionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Offline the specified region for the specified Azure Cosmos DB database account. * * @summary Offline the specified region for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOfflineRegion.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json */ async function cosmosDbDatabaseAccountOfflineRegion() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsOnlineRegionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsOnlineRegionSample.ts index eb2bc8eb4eef..fccc010916f7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsOnlineRegionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsOnlineRegionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Online the specified region for the specified Azure Cosmos DB database account. * * @summary Online the specified region for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOnlineRegion.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json */ async function cosmosDbDatabaseAccountOnlineRegion() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsRegenerateKeySample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsRegenerateKeySample.ts index 9090bfa49673..9f15fde3d8ed 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsRegenerateKeySample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsRegenerateKeySample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Regenerates an access key for the specified Azure Cosmos DB database account. * * @summary Regenerates an access key for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegenerateKey.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json */ async function cosmosDbDatabaseAccountRegenerateKey() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsUpdateSample.ts index 00e20216ed8f..8b83424520b6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseAccountsUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Updates the properties of an existing Azure Cosmos DB database account. * * @summary Updates the properties of an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountPatch.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountPatch.json */ async function cosmosDbDatabaseAccountPatch() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -34,21 +32,25 @@ async function cosmosDbDatabaseAccountPatch() { periodicModeProperties: { backupIntervalInMinutes: 240, backupRetentionIntervalInHours: 720, - backupStorageRedundancy: "Local", + backupStorageRedundancy: "Geo", }, }, capacity: { totalThroughputLimit: 2000 }, + capacityMode: "Provisioned", consistencyPolicy: { defaultConsistencyLevel: "BoundedStaleness", maxIntervalInSeconds: 10, maxStalenessPrefix: 200, }, defaultIdentity: "FirstPartyIdentity", + defaultPriorityLevel: "Low", + diagnosticLogSettings: { enableFullTextQuery: "True" }, enableAnalyticalStorage: true, enableBurstCapacity: true, enableFreeTier: false, enablePartitionMerge: true, enablePerRegionPerPartitionAutoscale: true, + enablePriorityBasedExecution: true, identity: { type: "SystemAssigned,UserAssigned", userAssignedIdentities: { diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListMetricDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListMetricDefinitionsSample.ts index e49a4bab07c5..3276c1511551 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListMetricDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListMetricDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves metric definitions for the given database. * * @summary Retrieves metric definitions for the given database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetricDefinitions.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json */ async function cosmosDbDatabaseGetMetricDefinitions() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListMetricsSample.ts index fadb9e342724..1993a8866dca 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account and database. * * @summary Retrieves the metrics determined by the given filter for the given database account and database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetrics.json */ async function cosmosDbDatabaseGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListUsagesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListUsagesSample.ts index cf52875c6d75..3e68b651a35c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListUsagesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/databaseListUsagesSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the usages (most recent data) for the given database. * * @summary Retrieves the usages (most recent data) for the given database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetUsages.json */ async function cosmosDbDatabaseGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesCreateUpdateGraphSample.ts similarity index 62% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlDatabaseSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesCreateUpdateGraphSample.ts index 4468864647b2..d160d1aefac6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesCreateUpdateGraphSample.ts @@ -9,44 +9,42 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - SqlDatabaseCreateUpdateParameters, + GraphResourceCreateUpdateParameters, CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** - * This sample demonstrates how to Create or update an Azure Cosmos DB SQL database + * This sample demonstrates how to Create or update an Azure Cosmos DB Graph. * - * @summary Create or update an Azure Cosmos DB SQL database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseCreateUpdate.json + * @summary Create or update an Azure Cosmos DB Graph. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json */ -async function cosmosDbSqlDatabaseCreateUpdate() { +async function cosmosDbGraphCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; const accountName = "ddb1"; - const databaseName = "databaseName"; - const createUpdateSqlDatabaseParameters: SqlDatabaseCreateUpdateParameters = { + const graphName = "graphName"; + const createUpdateGraphParameters: GraphResourceCreateUpdateParameters = { location: "West US", options: {}, - resource: { id: "databaseName" }, + resource: { id: "graphName" }, tags: {}, }; const credential = new DefaultAzureCredential(); const client = new CosmosDBManagementClient(credential, subscriptionId); - const result = await client.sqlResources.beginCreateUpdateSqlDatabaseAndWait( + const result = await client.graphResources.beginCreateUpdateGraphAndWait( resourceGroupName, accountName, - databaseName, - createUpdateSqlDatabaseParameters, + graphName, + createUpdateGraphParameters, ); console.log(result); } async function main() { - cosmosDbSqlDatabaseCreateUpdate(); + cosmosDbGraphCreateUpdate(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesDeleteGraphResourceSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesDeleteGraphResourceSample.ts new file mode 100644 index 000000000000..f59275963a22 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesDeleteGraphResourceSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Graph Resource. + * + * @summary Deletes an existing Azure Cosmos DB Graph Resource. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceDelete.json + */ +async function cosmosDbSqlDatabaseDelete() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const graphName = "graphName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.graphResources.beginDeleteGraphResourceAndWait( + resourceGroupName, + accountName, + graphName, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesGetGraphSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesGetGraphSample.ts new file mode 100644 index 000000000000..c1f4d02a26a8 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesGetGraphSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @summary Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceGet.json + */ +async function cosmosDbSqlDatabaseGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const graphName = "graphName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.graphResources.getGraph( + resourceGroupName, + accountName, + graphName, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesListGraphsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesListGraphsSample.ts new file mode 100644 index 000000000000..b0b07a0a82c4 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/graphResourcesListGraphsSample.ts @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Lists the graphs under an existing Azure Cosmos DB database account. + * + * @summary Lists the graphs under an existing Azure Cosmos DB database account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceList.json + */ +async function cosmosDbSqlDatabaseList() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.graphResources.listGraphs( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbSqlDatabaseList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts index 1b45231aa4ea..8498b9eec8d9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB Gremlin database * * @summary Create or update an Azure Cosmos DB Gremlin database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json */ async function cosmosDbGremlinDatabaseCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesCreateUpdateGremlinGraphSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesCreateUpdateGremlinGraphSample.ts index 782fb365db85..a21aa6a506ae 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesCreateUpdateGremlinGraphSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesCreateUpdateGremlinGraphSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB Gremlin graph * * @summary Create or update an Azure Cosmos DB Gremlin graph - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json */ async function cosmosDbGremlinGraphCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesDeleteGremlinDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesDeleteGremlinDatabaseSample.ts index 4fd841d1cf2f..611d288306c0 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesDeleteGremlinDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesDeleteGremlinDatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Gremlin database. * * @summary Deletes an existing Azure Cosmos DB Gremlin database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseDelete.json */ async function cosmosDbGremlinDatabaseDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesDeleteGremlinGraphSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesDeleteGremlinGraphSample.ts index 5b79706d064a..eae07c031dd8 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesDeleteGremlinGraphSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesDeleteGremlinGraphSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Gremlin graph. * * @summary Deletes an existing Azure Cosmos DB Gremlin graph. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphDelete.json */ async function cosmosDbGremlinGraphDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinDatabaseSample.ts index 80977d644668..8dcfd129cfe4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinDatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json */ async function cosmosDbGremlinDatabaseGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinDatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinDatabaseThroughputSample.ts index 78194bec956f..307c7e1a9a8e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinDatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinDatabaseThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json */ async function cosmosDbGremlinDatabaseThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinGraphSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinGraphSample.ts index cb3d6e703415..d99fb8d126a1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinGraphSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinGraphSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Gremlin graph under an existing Azure Cosmos DB database account. * * @summary Gets the Gremlin graph under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json */ async function cosmosDbGremlinGraphGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinGraphThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinGraphThroughputSample.ts index 453afdb5c155..c716c0e18cae 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinGraphThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesGetGremlinGraphThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputGet.json */ async function cosmosDbGremlinGraphThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesListGremlinDatabasesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesListGremlinDatabasesSample.ts index 4236d592ce70..585723c384d5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesListGremlinDatabasesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesListGremlinDatabasesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the Gremlin databases under an existing Azure Cosmos DB database account. * * @summary Lists the Gremlin databases under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseList.json */ async function cosmosDbGremlinDatabaseList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesListGremlinGraphsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesListGremlinGraphsSample.ts index b5ce778c1314..9e7d7c519e2c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesListGremlinGraphsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesListGremlinGraphsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the Gremlin graph under an existing Azure Cosmos DB database account. * * @summary Lists the Gremlin graph under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphList.json */ async function cosmosDbGremlinGraphList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts index 69782c4fe58b..5d43d612a65d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json */ async function cosmosDbGremlinDatabaseMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts index d911a37643cb..8d047d30b873 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json */ async function cosmosDbGremlinDatabaseMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts index 67cdaf9dda00..e8eb2236e96d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json */ async function cosmosDbGremlinGraphMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts index 2ed863ef5b31..46c80d3f3512 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json */ async function cosmosDbGremlinGraphMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesRetrieveContinuousBackupInformationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesRetrieveContinuousBackupInformationSample.ts index ec4373512824..ee399e25decd 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesRetrieveContinuousBackupInformationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesRetrieveContinuousBackupInformationSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves continuous backup information for a gremlin graph. * * @summary Retrieves continuous backup information for a gremlin graph. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphBackupInformation.json */ async function cosmosDbGremlinGraphBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts index 0f5af07bc622..9854ba8010e5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Gremlin database * * @summary Update RUs per second of an Azure Cosmos DB Gremlin database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json */ async function cosmosDbGremlinDatabaseThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesUpdateGremlinGraphThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesUpdateGremlinGraphThroughputSample.ts index 45967ff8146c..33eb36b3f03a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesUpdateGremlinGraphThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/gremlinResourcesUpdateGremlinGraphThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Gremlin graph * * @summary Update RUs per second of an Azure Cosmos DB Gremlin graph - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json */ async function cosmosDbGremlinGraphThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/locationsGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/locationsGetSample.ts index 12b11c4a268f..88b93f2cf423 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/locationsGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/locationsGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the properties of an existing Cosmos DB location * * @summary Get the properties of an existing Cosmos DB location - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json */ async function cosmosDbLocationGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/locationsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/locationsListSample.ts index 827ef42592e3..18cf84ff8a98 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/locationsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/locationsListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to List Cosmos DB locations and their properties * * @summary List Cosmos DB locations and their properties - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationList.json */ async function cosmosDbLocationList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts index a5f5546a5919..1fc27ea90bb2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB MongoDB Collection * * @summary Create or update an Azure Cosmos DB MongoDB Collection - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json */ async function cosmosDbMongoDbcollectionCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -34,6 +32,7 @@ async function cosmosDbMongoDbcollectionCreateUpdate() { location: "West US", options: {}, resource: { + analyticalStorageTtl: 500, id: "collectionName", indexes: [ { @@ -59,8 +58,50 @@ async function cosmosDbMongoDbcollectionCreateUpdate() { console.log(result); } +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB MongoDB Collection + * + * @summary Create or update an Azure Cosmos DB MongoDB Collection + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRestore.json + */ +async function cosmosDbMongoDbcollectionRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const collectionName = "collectionName"; + const createUpdateMongoDBCollectionParameters: MongoDBCollectionCreateUpdateParameters = + { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "collectionName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: false, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginCreateUpdateMongoDBCollectionAndWait( + resourceGroupName, + accountName, + databaseName, + collectionName, + createUpdateMongoDBCollectionParameters, + ); + console.log(result); +} + async function main() { cosmosDbMongoDbcollectionCreateUpdate(); + cosmosDbMongoDbcollectionRestore(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts index 3644e29bcd81..ae469d804dd3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or updates Azure Cosmos DB MongoDB database * * @summary Create or updates Azure Cosmos DB MongoDB database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json */ async function cosmosDbMongoDbdatabaseCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -47,8 +45,48 @@ async function cosmosDbMongoDbdatabaseCreateUpdate() { console.log(result); } +/** + * This sample demonstrates how to Create or updates Azure Cosmos DB MongoDB database + * + * @summary Create or updates Azure Cosmos DB MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRestore.json + */ +async function cosmosDbMongoDbdatabaseRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const createUpdateMongoDBDatabaseParameters: MongoDBDatabaseCreateUpdateParameters = + { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "databaseName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: false, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginCreateUpdateMongoDBDatabaseAndWait( + resourceGroupName, + accountName, + databaseName, + createUpdateMongoDBDatabaseParameters, + ); + console.log(result); +} + async function main() { cosmosDbMongoDbdatabaseCreateUpdate(); + cosmosDbMongoDbdatabaseRestore(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts index 9070380cdaec..1df3c212e34d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB Mongo Role Definition. * * @summary Creates or updates an Azure Cosmos DB Mongo Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json */ async function cosmosDbMongoDbroleDefinitionCreateUpdate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts index 80ca764b78bb..87abf73550d2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB Mongo User Definition. * * @summary Creates or updates an Azure Cosmos DB Mongo User Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json */ async function cosmosDbMongoDbuserDefinitionCreateUpdate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoDbcollectionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoDbcollectionSample.ts index c6e379d1fbf9..72582d51c720 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoDbcollectionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoDbcollectionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB MongoDB Collection. * * @summary Deletes an existing Azure Cosmos DB MongoDB Collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionDelete.json */ async function cosmosDbMongoDbcollectionDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoDbdatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoDbdatabaseSample.ts index 7394eb59370d..c9b013246fd1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoDbdatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoDbdatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB MongoDB database. * * @summary Deletes an existing Azure Cosmos DB MongoDB database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseDelete.json */ async function cosmosDbMongoDbdatabaseDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts index 9f6ae4850ed5..f05a2cf85266 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Mongo Role Definition. * * @summary Deletes an existing Azure Cosmos DB Mongo Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json */ async function cosmosDbMongoDbroleDefinitionDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoUserDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoUserDefinitionSample.ts index 49e8c8b36ef2..ac3c6d24743d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoUserDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesDeleteMongoUserDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Mongo User Definition. * * @summary Deletes an existing Azure Cosmos DB Mongo User Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json */ async function cosmosDbMongoDbuserDefinitionDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbcollectionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbcollectionSample.ts index a370166595f7..0cbcbde7ea94 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbcollectionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbcollectionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the MongoDB collection under an existing Azure Cosmos DB database account. * * @summary Gets the MongoDB collection under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json */ async function cosmosDbMongoDbcollectionGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts index b5f5e06dce9f..4e5d7f523f41 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json */ async function cosmosDbMongoDbcollectionThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbdatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbdatabaseSample.ts index 14098475bad3..834b853e9612 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbdatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbdatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json */ async function cosmosDbMongoDbdatabaseGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts index 33c41172b961..fdeaee4e537f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json */ async function cosmosDbMongoDbdatabaseThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoRoleDefinitionSample.ts index 38cb717370c7..1d23c0c8319f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoRoleDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json */ async function cosmosDbMongoRoleDefinitionGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoUserDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoUserDefinitionSample.ts index 1c2afd267b4b..062aea39354f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoUserDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesGetMongoUserDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json */ async function cosmosDbMongoDbuserDefinitionGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoDbcollectionPartitionMergeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoDbcollectionPartitionMergeSample.ts new file mode 100644 index 000000000000..74d56a4b01ba --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoDbcollectionPartitionMergeSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { MergeParameters, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Merges the partitions of a MongoDB Collection + * + * @summary Merges the partitions of a MongoDB Collection + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json + */ +async function cosmosDbMongoDbcollectionPartitionMerge() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const collectionName = "collectionName"; + const mergeParameters: MergeParameters = { isDryRun: false }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginListMongoDBCollectionPartitionMergeAndWait( + resourceGroupName, + accountName, + databaseName, + collectionName, + mergeParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbcollectionPartitionMerge(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoDbcollectionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoDbcollectionsSample.ts index 54cf10855997..08b2319ec6d1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoDbcollectionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoDbcollectionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the MongoDB collection under an existing Azure Cosmos DB database account. * * @summary Lists the MongoDB collection under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionList.json */ async function cosmosDbMongoDbcollectionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoDbdatabasesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoDbdatabasesSample.ts index 02c8340434ef..943f38e06594 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoDbdatabasesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoDbdatabasesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the MongoDB databases under an existing Azure Cosmos DB database account. * * @summary Lists the MongoDB databases under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseList.json */ async function cosmosDbMongoDbdatabaseList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoRoleDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoRoleDefinitionsSample.ts index b75e8679aec0..12b9c855b487 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoRoleDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoRoleDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. * * @summary Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionList.json */ async function cosmosDbMongoDbroleDefinitionList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoUserDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoUserDefinitionsSample.ts index 7c83cd5f9d68..0c2ed7fe6b19 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoUserDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesListMongoUserDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Mongo User Definition. * * @summary Retrieves the list of all Azure Cosmos DB Mongo User Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionList.json */ async function cosmosDbMongoDbuserDefinitionList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts index fad37ea8c404..46d24de98cca 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json */ async function cosmosDbMongoDbcollectionMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts index 36dd9a502a6b..bdbec228a4e5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json */ async function cosmosDbMongoDbcollectionMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts index 1531798ead50..6c5643c14ccf 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json */ async function cosmosDbMongoDbdatabaseMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts index 8722cd024afd..9f6a49ed3084 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json */ async function cosmosDbMongoDbdatabaseMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.ts new file mode 100644 index 000000000000..0aee5ad27e0f --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.ts @@ -0,0 +1,60 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RedistributeThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB MongoDB container + * + * @summary Redistribute throughput for an Azure Cosmos DB MongoDB container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json + */ +async function cosmosDbMongoDbcollectionRedistributeThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const collectionName = "collectionName"; + const redistributeThroughputParameters: RedistributeThroughputParameters = { + resource: { + sourcePhysicalPartitionThroughputInfo: [ + { id: "2", throughput: 5000 }, + { id: "3" }, + ], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, + ], + throughputPolicy: "custom", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBContainerRedistributeThroughputAndWait( + resourceGroupName, + accountName, + databaseName, + collectionName, + redistributeThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbcollectionRedistributeThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.ts new file mode 100644 index 000000000000..c7c4876f6a66 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.ts @@ -0,0 +1,50 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RetrieveThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB MongoDB container + * + * @summary Retrieve throughput distribution for an Azure Cosmos DB MongoDB container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json + */ +async function cosmosDbMongoDbcollectionRetrieveThroughputDistribution() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const collectionName = "collectionName"; + const retrieveThroughputParameters: RetrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBContainerRetrieveThroughputDistributionAndWait( + resourceGroupName, + accountName, + databaseName, + collectionName, + retrieveThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbcollectionRetrieveThroughputDistribution(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbdatabasePartitionMergeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbdatabasePartitionMergeSample.ts new file mode 100644 index 000000000000..ba34a200e56d --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbdatabasePartitionMergeSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { MergeParameters, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Merges the partitions of a MongoDB database + * + * @summary Merges the partitions of a MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json + */ +async function cosmosDbMongoDbdatabasePartitionMerge() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const mergeParameters: MergeParameters = { isDryRun: false }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBDatabasePartitionMergeAndWait( + resourceGroupName, + accountName, + databaseName, + mergeParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbdatabasePartitionMerge(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.ts new file mode 100644 index 000000000000..e2f48b847d79 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.ts @@ -0,0 +1,58 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RedistributeThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB MongoDB database + * + * @summary Redistribute throughput for an Azure Cosmos DB MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json + */ +async function cosmosDbMongoDbdatabaseRedistributeThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const redistributeThroughputParameters: RedistributeThroughputParameters = { + resource: { + sourcePhysicalPartitionThroughputInfo: [ + { id: "2", throughput: 5000 }, + { id: "3" }, + ], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, + ], + throughputPolicy: "custom", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBDatabaseRedistributeThroughputAndWait( + resourceGroupName, + accountName, + databaseName, + redistributeThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbdatabaseRedistributeThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.ts new file mode 100644 index 000000000000..d4fd58df870e --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RetrieveThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB MongoDB database + * + * @summary Retrieve throughput distribution for an Azure Cosmos DB MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json + */ +async function cosmosDbMongoDbdatabaseRetrieveThroughputDistribution() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const retrieveThroughputParameters: RetrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBDatabaseRetrieveThroughputDistributionAndWait( + resourceGroupName, + accountName, + databaseName, + retrieveThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbdatabaseRetrieveThroughputDistribution(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts index a2017db506b0..4dfad00f3ccb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves continuous backup information for a Mongodb collection. * * @summary Retrieves continuous backup information for a Mongodb collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json */ async function cosmosDbMongoDbcollectionBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts index 9ee4de8a068e..79bfe48e603e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update the RUs per second of an Azure Cosmos DB MongoDB collection * * @summary Update the RUs per second of an Azure Cosmos DB MongoDB collection - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json */ async function cosmosDbMongoDbcollectionThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts index 2545c1e17d7e..fb5235739b17 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of the an Azure Cosmos DB MongoDB database * * @summary Update RUs per second of the an Azure Cosmos DB MongoDB database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json */ async function cosmosDbMongoDbdatabaseThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/networkSecurityPerimeterConfigurationsGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/networkSecurityPerimeterConfigurationsGetSample.ts new file mode 100644 index 000000000000..d265f3400e29 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/networkSecurityPerimeterConfigurationsGetSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets effective Network Security Perimeter Configuration for association + * + * @summary Gets effective Network Security Perimeter Configuration for association + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json + */ +async function namspaceNetworkSecurityPerimeterConfigurationList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "res4410"; + const accountName = "cosmosTest"; + const networkSecurityPerimeterConfigurationName = + "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.networkSecurityPerimeterConfigurations.get( + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + ); + console.log(result); +} + +async function main() { + namspaceNetworkSecurityPerimeterConfigurationList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/networkSecurityPerimeterConfigurationsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/networkSecurityPerimeterConfigurationsListSample.ts new file mode 100644 index 000000000000..222b53253c88 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/networkSecurityPerimeterConfigurationsListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets list of effective Network Security Perimeter Configuration for cosmos db account + * + * @summary Gets list of effective Network Security Perimeter Configuration for cosmos db account + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationList.json + */ +async function namspaceNetworkSecurityPerimeterConfigurationList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "res4410"; + const accountName = "cosmosTest"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.networkSecurityPerimeterConfigurations.list( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + namspaceNetworkSecurityPerimeterConfigurationList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/networkSecurityPerimeterConfigurationsReconcileSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/networkSecurityPerimeterConfigurationsReconcileSample.ts new file mode 100644 index 000000000000..841961eb1bcd --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/networkSecurityPerimeterConfigurationsReconcileSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Refreshes any information about the association. + * + * @summary Refreshes any information about the association. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json + */ +async function networkSecurityPerimeterConfigurationList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "res4410"; + const accountName = "sto8607"; + const networkSecurityPerimeterConfigurationName = + "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.networkSecurityPerimeterConfigurations.beginReconcileAndWait( + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + ); + console.log(result); +} + +async function main() { + networkSecurityPerimeterConfigurationList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesCreateOrUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesCreateOrUpdateSample.ts index 908adf7d05b9..a58b12afe3f5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesCreateOrUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesCreateOrUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates the notebook workspace for a Cosmos DB account. * * @summary Creates the notebook workspace for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceCreate.json */ async function cosmosDbNotebookWorkspaceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesDeleteSample.ts index f9a37b876750..28bf63e7d7e9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes the notebook workspace for a Cosmos DB account. * * @summary Deletes the notebook workspace for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceDelete.json */ async function cosmosDbNotebookWorkspaceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesGetSample.ts index 519f9e0a193a..5f18246f505d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the notebook workspace for a Cosmos DB account. * * @summary Gets the notebook workspace for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceGet.json */ async function cosmosDbNotebookWorkspaceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesListByDatabaseAccountSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesListByDatabaseAccountSample.ts index 87539e39c1b3..b6fce49dcc20 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesListByDatabaseAccountSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesListByDatabaseAccountSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the notebook workspace resources of an existing Cosmos DB account. * * @summary Gets the notebook workspace resources of an existing Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceList.json */ async function cosmosDbNotebookWorkspaceList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesListConnectionInfoSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesListConnectionInfoSample.ts index b7b164759ddd..e4e441d1f5f1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesListConnectionInfoSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesListConnectionInfoSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the connection info for the notebook workspace * * @summary Retrieves the connection info for the notebook workspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json */ async function cosmosDbNotebookWorkspaceListConnectionInfo() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesRegenerateAuthTokenSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesRegenerateAuthTokenSample.ts index 680d466acb9d..fe46ba3a17b9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesRegenerateAuthTokenSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesRegenerateAuthTokenSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Regenerates the auth token for the notebook workspace * * @summary Regenerates the auth token for the notebook workspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json */ async function cosmosDbNotebookWorkspaceRegenerateAuthToken() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesStartSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesStartSample.ts index fb8d32d9c255..d09bed7afe2a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesStartSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/notebookWorkspacesStartSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Starts the notebook workspace * * @summary Starts the notebook workspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceStart.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceStart.json */ async function cosmosDbNotebookWorkspaceStart() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/operationsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/operationsListSample.ts index 7eceff1a6c29..733fea16797c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/operationsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/operationsListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all of the available Cosmos DB Resource Provider operations. * * @summary Lists all of the available Cosmos DB Resource Provider operations. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBOperationsList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBOperationsList.json */ async function cosmosDbOperationsList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/partitionKeyRangeIdListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/partitionKeyRangeIdListMetricsSample.ts index 091a2619441f..f0ed2c640a53 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/partitionKeyRangeIdListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/partitionKeyRangeIdListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given partition key range id. * * @summary Retrieves the metrics determined by the given filter for the given partition key range id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/partitionKeyRangeIdRegionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/partitionKeyRangeIdRegionListMetricsSample.ts index d2967ae366e7..7f39e7efaebf 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/partitionKeyRangeIdRegionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/partitionKeyRangeIdRegionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given partition key range id and region. * * @summary Retrieves the metrics determined by the given filter for the given partition key range id and region. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileListMetricsSample.ts index d69d3e80ccdb..f1194d2cd676 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data * * @summary Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileSourceTargetListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileSourceTargetListMetricsSample.ts index 410612c76e28..b5c0e1e198eb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileSourceTargetListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileSourceTargetListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data * * @summary Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileTargetListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileTargetListMetricsSample.ts index 9fc6e89caba5..965d96d3e603 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileTargetListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/percentileTargetListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data * * @summary Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileTargetGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileTargetGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts index 1a77f6924db1..d8d57c0828c9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. * * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json */ async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsDeleteSample.ts index 4859ab59bcf3..0b99ba22859e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes a private endpoint connection with a given name. * * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json */ async function deletesAPrivateEndpointConnectionWithAGivenName() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsGetSample.ts index 34db25222933..03ad5df6f2e4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets a private endpoint connection. * * @summary Gets a private endpoint connection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsListByDatabaseAccountSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsListByDatabaseAccountSample.ts index 182b7d280852..7d603a761440 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsListByDatabaseAccountSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateEndpointConnectionsListByDatabaseAccountSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to List all private endpoint connections on a Cosmos DB account. * * @summary List all private endpoint connections on a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionListGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateLinkResourcesGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateLinkResourcesGetSample.ts index 0570d1584c85..7a6ffb2aa9bb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateLinkResourcesGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateLinkResourcesGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the private link resources that need to be created for a Cosmos DB account. * * @summary Gets the private link resources that need to be created for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateLinkResourcesListByDatabaseAccountSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateLinkResourcesListByDatabaseAccountSample.ts index 5052eaf5ed55..55a971f61b83 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateLinkResourcesListByDatabaseAccountSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/privateLinkResourcesListByDatabaseAccountSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the private link resources that need to be created for a Cosmos DB account. * * @summary Gets the private link resources that need to be created for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceListGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceListGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsGetByLocationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsGetByLocationSample.ts index 0a5fa126b434..8a4444b16bf8 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsGetByLocationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsGetByLocationSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. * * @summary Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json */ async function cosmosDbRestorableDatabaseAccountGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsListByLocationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsListByLocationSample.ts index a817b37b4407..1cf5a47b5468 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsListByLocationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsListByLocationSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. * * @summary Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json */ async function cosmosDbRestorableDatabaseAccountList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsListSample.ts index 9143ce37a4a6..77543b78e45c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableDatabaseAccountsListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. * * @summary Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json */ async function cosmosDbRestorableDatabaseAccountNoLocationList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinDatabasesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinDatabasesListSample.ts index 5fe1b0512347..7de641246f6d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinDatabasesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinDatabasesListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinDatabaseList.json */ async function cosmosDbRestorableGremlinDatabaseList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinGraphsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinGraphsListSample.ts index d8cb724cbd2d..49e7e79d81f5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinGraphsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinGraphsListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinGraphList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinGraphList.json */ async function cosmosDbRestorableGremlinGraphList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinResourcesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinResourcesListSample.ts index f725472179c5..e2c9f92bd893 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinResourcesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableGremlinResourcesListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinResourceList.json */ async function cosmosDbRestorableGremlinResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbCollectionsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbCollectionsListSample.ts index 3a8481a19a17..2c2664c90be5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbCollectionsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbCollectionsListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbCollectionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbCollectionList.json */ async function cosmosDbRestorableMongodbCollectionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbDatabasesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbDatabasesListSample.ts index 2d7f3518b028..bf106fecbbeb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbDatabasesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbDatabasesListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbDatabaseList.json */ async function cosmosDbRestorableMongodbDatabaseList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbResourcesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbResourcesListSample.ts index 84a4189b2aa1..4ce39ceaf317 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbResourcesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableMongodbResourcesListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbResourceList.json */ async function cosmosDbRestorableMongodbResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlContainersListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlContainersListSample.ts index 6e910768f681..1e817caa3218 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlContainersListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlContainersListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlContainerList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlContainerList.json */ async function cosmosDbRestorableSqlContainerList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlDatabasesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlDatabasesListSample.ts index d6ca881ff59f..7425bab6690e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlDatabasesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlDatabasesListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlDatabaseList.json */ async function cosmosDbRestorableSqlDatabaseList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlResourcesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlResourcesListSample.ts index 743de4fc0c35..04064c971400 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlResourcesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableSqlResourcesListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlResourceList.json */ async function cosmosDbRestorableSqlResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableTableResourcesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableTableResourcesListSample.ts index 411ce12e0ae1..be8694e65316 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableTableResourcesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableTableResourcesListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableResourceList.json */ async function cosmosDbRestorableTableResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableTablesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableTablesListSample.ts index 26c1f355dfbd..d1ef42b4a501 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableTablesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/restorableTablesListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableList.json */ async function cosmosDbRestorableTableList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceCreateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceCreateSample.ts index d1c053d2466c..c4968c07f416 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceCreateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceCreateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceCreate.json */ async function dataTransferServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -50,7 +48,7 @@ async function dataTransferServiceCreate() { * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json */ async function graphApiComputeServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -79,7 +77,7 @@ async function graphApiComputeServiceCreate() { * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json */ async function materializedViewsBuilderServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -108,7 +106,7 @@ async function materializedViewsBuilderServiceCreate() { * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json */ async function sqlDedicatedGatewayServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceDeleteSample.ts index 28833728c1ad..8fdc4d4cb3e6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceDelete.json */ async function dataTransferServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -39,7 +37,7 @@ async function dataTransferServiceDelete() { * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json */ async function graphApiComputeServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -60,7 +58,7 @@ async function graphApiComputeServiceDelete() { * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json */ async function materializedViewsBuilderServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -81,7 +79,7 @@ async function materializedViewsBuilderServiceDelete() { * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json */ async function sqlDedicatedGatewayServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceGetSample.ts index 390e1ae433c0..9ddc5d21695d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json */ async function dataTransferServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -39,7 +37,7 @@ async function dataTransferServiceGet() { * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json */ async function graphApiComputeServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -60,7 +58,7 @@ async function graphApiComputeServiceGet() { * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json */ async function materializedViewsBuilderServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -81,7 +79,7 @@ async function materializedViewsBuilderServiceGet() { * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json */ async function sqlDedicatedGatewayServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceListSample.ts index 5d37ae555d50..26c43e8fc460 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/serviceListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBServicesList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBServicesList.json */ async function cosmosDbServicesList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateClientEncryptionKeySample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateClientEncryptionKeySample.ts index 4249a213b249..69bc19ebcce9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateClientEncryptionKeySample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateClientEncryptionKeySample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). * * @summary Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json */ async function cosmosDbClientEncryptionKeyCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subId"; @@ -40,7 +38,9 @@ async function cosmosDbClientEncryptionKeyCreateUpdate() { algorithm: "RSA-OAEP", value: "AzureKeyVault Key URL", }, - wrappedDataEncryptionKey: Buffer.from("U3dhZ2dlciByb2Nrcw=="), + wrappedDataEncryptionKey: Buffer.from( + "VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU=", + ), }, }; const credential = new DefaultAzureCredential(); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlContainerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlContainerSample.ts index 387d67ec459f..93875393b1fc 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlContainerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlContainerSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL container * * @summary Create or update an Azure Cosmos DB SQL container - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json */ async function cosmosDbSqlContainerCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -112,8 +110,102 @@ async function cosmosDbSqlContainerCreateUpdate() { console.log(result); } +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB SQL container + * + * @summary Create or update an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRestore.json + */ +async function cosmosDbSqlContainerRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const createUpdateSqlContainerParameters: SqlContainerCreateUpdateParameters = + { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "containerName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: true, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginCreateUpdateSqlContainerAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + createUpdateSqlContainerParameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB SQL container + * + * @summary Create or update an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json + */ +async function cosmosDbSqlMaterializedViewCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "mvContainerName"; + const createUpdateSqlContainerParameters: SqlContainerCreateUpdateParameters = + { + location: "West US", + options: {}, + resource: { + id: "mvContainerName", + indexingPolicy: { + automatic: true, + excludedPaths: [], + includedPaths: [ + { + path: "/*", + indexes: [ + { dataType: "String", kind: "Range", precision: -1 }, + { dataType: "Number", kind: "Range", precision: -1 }, + ], + }, + ], + indexingMode: "consistent", + }, + materializedViewDefinition: { + definition: "select * from ROOT", + sourceCollectionId: "sourceContainerName", + }, + partitionKey: { kind: "Hash", paths: ["/mvpk"] }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginCreateUpdateSqlContainerAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + createUpdateSqlContainerParameters, + ); + console.log(result); +} + async function main() { cosmosDbSqlContainerCreateUpdate(); + cosmosDbSqlContainerRestore(); + cosmosDbSqlMaterializedViewCreateUpdate(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlDatabaseSample.ts index 4468864647b2..aee41e3e72b1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlDatabaseSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL database * * @summary Create or update an Azure Cosmos DB SQL database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json */ async function cosmosDbSqlDatabaseCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -45,8 +43,46 @@ async function cosmosDbSqlDatabaseCreateUpdate() { console.log(result); } +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB SQL database + * + * @summary Create or update an Azure Cosmos DB SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRestore.json + */ +async function cosmosDbSqlDatabaseRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const createUpdateSqlDatabaseParameters: SqlDatabaseCreateUpdateParameters = { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "databaseName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: true, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginCreateUpdateSqlDatabaseAndWait( + resourceGroupName, + accountName, + databaseName, + createUpdateSqlDatabaseParameters, + ); + console.log(result); +} + async function main() { cosmosDbSqlDatabaseCreateUpdate(); + cosmosDbSqlDatabaseRestore(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts index 644f2e5587ae..15764416b3fc 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB SQL Role Assignment. * * @summary Creates or updates an Azure Cosmos DB SQL Role Assignment. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json */ async function cosmosDbSqlRoleAssignmentCreateUpdate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts index 011fe662c2ce..de46cfe51251 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB SQL Role Definition. * * @summary Creates or updates an Azure Cosmos DB SQL Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json */ async function cosmosDbSqlRoleDefinitionCreateUpdate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts index 9edf562119a7..f6b740de59f9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL storedProcedure * * @summary Create or update an Azure Cosmos DB SQL storedProcedure - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json */ async function cosmosDbSqlStoredProcedureCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlTriggerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlTriggerSample.ts index 1e8055bfa4c3..88601055f5f9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlTriggerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlTriggerSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL trigger * * @summary Create or update an Azure Cosmos DB SQL trigger - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json */ async function cosmosDbSqlTriggerCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts index af7f30a448d9..b98443de1238 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL userDefinedFunction * * @summary Create or update an Azure Cosmos DB SQL userDefinedFunction - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json */ async function cosmosDbSqlUserDefinedFunctionCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlContainerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlContainerSample.ts index 9a72a925498f..c574c9359ab1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlContainerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlContainerSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL container. * * @summary Deletes an existing Azure Cosmos DB SQL container. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerDelete.json */ async function cosmosDbSqlContainerDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlDatabaseSample.ts index 21d9aefcc03c..ff3a5e53f618 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlDatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL database. * * @summary Deletes an existing Azure Cosmos DB SQL database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseDelete.json */ async function cosmosDbSqlDatabaseDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlRoleAssignmentSample.ts index f614dcffb3dc..d40bbe6e8700 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlRoleAssignmentSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlRoleAssignmentSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL Role Assignment. * * @summary Deletes an existing Azure Cosmos DB SQL Role Assignment. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json */ async function cosmosDbSqlRoleAssignmentDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlRoleDefinitionSample.ts index 5ae8e0f3f36e..fb5c60bdd580 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlRoleDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL Role Definition. * * @summary Deletes an existing Azure Cosmos DB SQL Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json */ async function cosmosDbSqlRoleDefinitionDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlStoredProcedureSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlStoredProcedureSample.ts index 8fe9920e9a59..7a5ae103d0c7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlStoredProcedureSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlStoredProcedureSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL storedProcedure. * * @summary Deletes an existing Azure Cosmos DB SQL storedProcedure. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureDelete.json */ async function cosmosDbSqlStoredProcedureDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlTriggerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlTriggerSample.ts index 1038bf68a3bf..2668b6d00544 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlTriggerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlTriggerSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL trigger. * * @summary Deletes an existing Azure Cosmos DB SQL trigger. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerDelete.json */ async function cosmosDbSqlTriggerDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts index ffa1ce204b3c..7a48e4cc98b9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * * @summary Deletes an existing Azure Cosmos DB SQL userDefinedFunction. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json */ async function cosmosDbSqlUserDefinedFunctionDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetClientEncryptionKeySample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetClientEncryptionKeySample.ts index b9d252657856..776b59511ee5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetClientEncryptionKeySample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetClientEncryptionKeySample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. * * @summary Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json */ async function cosmosDbClientEncryptionKeyGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlContainerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlContainerSample.ts index a10a556c43e1..a334025b1368 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlContainerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlContainerSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the SQL container under an existing Azure Cosmos DB database account. * * @summary Gets the SQL container under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json */ async function cosmosDbSqlContainerGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlContainerThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlContainerThroughputSample.ts index 8c1ca6c9cd00..001e6596b1a7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlContainerThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlContainerThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. * * @summary Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputGet.json */ async function cosmosDbSqlContainerThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlDatabaseSample.ts index 773d81ac43fa..b29b4990fb39 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlDatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json */ async function cosmosDbSqlDatabaseGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlDatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlDatabaseThroughputSample.ts index 99df276c5eb2..a17331412c5f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlDatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlDatabaseThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputGet.json */ async function cosmosDbSqlDatabaseThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlRoleAssignmentSample.ts index c3d3cedb1feb..4f5cf95f2c6b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlRoleAssignmentSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlRoleAssignmentSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json */ async function cosmosDbSqlRoleAssignmentGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlRoleDefinitionSample.ts index e2c888c6c160..f7cb3a99763a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlRoleDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json */ async function cosmosDbSqlRoleDefinitionGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlStoredProcedureSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlStoredProcedureSample.ts index 17a3fc0a13d9..d0313a507152 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlStoredProcedureSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlStoredProcedureSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. * * @summary Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json */ async function cosmosDbSqlStoredProcedureGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlTriggerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlTriggerSample.ts index 0ada7798453f..30ea6fd7e186 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlTriggerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlTriggerSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the SQL trigger under an existing Azure Cosmos DB database account. * * @summary Gets the SQL trigger under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json */ async function cosmosDbSqlTriggerGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlUserDefinedFunctionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlUserDefinedFunctionSample.ts index 819b3cd55e1b..fc0545fdd179 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlUserDefinedFunctionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesGetSqlUserDefinedFunctionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * * @summary Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json */ async function cosmosDbSqlUserDefinedFunctionGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListClientEncryptionKeysSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListClientEncryptionKeysSample.ts index 5386fc292734..6e7284e70021 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListClientEncryptionKeysSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListClientEncryptionKeysSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. * * @summary Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeysList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeysList.json */ async function cosmosDbClientEncryptionKeysList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlContainerPartitionMergeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlContainerPartitionMergeSample.ts new file mode 100644 index 000000000000..49d55c241776 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlContainerPartitionMergeSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { MergeParameters, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Merges the partitions of a SQL Container + * + * @summary Merges the partitions of a SQL Container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerPartitionMerge.json + */ +async function cosmosDbSqlContainerPartitionMerge() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const mergeParameters: MergeParameters = { isDryRun: false }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.sqlResources.beginListSqlContainerPartitionMergeAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + mergeParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlContainerPartitionMerge(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlContainersSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlContainersSample.ts index c8b4e713a6c8..d7d9c1735cd3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlContainersSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlContainersSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the SQL container under an existing Azure Cosmos DB database account. * * @summary Lists the SQL container under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerList.json */ async function cosmosDbSqlContainerList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlDatabasesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlDatabasesSample.ts index 8fdcbcd5420b..ba8f753263f4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlDatabasesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlDatabasesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the SQL databases under an existing Azure Cosmos DB database account. * * @summary Lists the SQL databases under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseList.json */ async function cosmosDbSqlDatabaseList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlRoleAssignmentsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlRoleAssignmentsSample.ts index 031f8528ffad..bb8baa381290 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlRoleAssignmentsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlRoleAssignmentsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB SQL Role Assignments. * * @summary Retrieves the list of all Azure Cosmos DB SQL Role Assignments. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentList.json */ async function cosmosDbSqlRoleAssignmentList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlRoleDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlRoleDefinitionsSample.ts index 60b680d26aef..8c870d4a7b2e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlRoleDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlRoleDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB SQL Role Definitions. * * @summary Retrieves the list of all Azure Cosmos DB SQL Role Definitions. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionList.json */ async function cosmosDbSqlRoleDefinitionList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlStoredProceduresSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlStoredProceduresSample.ts index 9eab0671efa6..26cdcb0878b9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlStoredProceduresSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlStoredProceduresSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. * * @summary Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureList.json */ async function cosmosDbSqlStoredProcedureList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlTriggersSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlTriggersSample.ts index 135179faf833..ff5316a00a5d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlTriggersSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlTriggersSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the SQL trigger under an existing Azure Cosmos DB database account. * * @summary Lists the SQL trigger under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerList.json */ async function cosmosDbSqlTriggerList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlUserDefinedFunctionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlUserDefinedFunctionsSample.ts index 7310f9cf4445..de73cd31a9a3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlUserDefinedFunctionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesListSqlUserDefinedFunctionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * * @summary Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionList.json */ async function cosmosDbSqlUserDefinedFunctionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts index 749db4702caf..322c116eb11d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json */ async function cosmosDbSqlContainerMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts index e4d687a7ef15..6ad91194f88a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json */ async function cosmosDbSqlContainerMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts index 288e57b80d14..65f5576a47a1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json */ async function cosmosDbSqlDatabaseMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts index 255c4027613b..74617f54969e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json */ async function cosmosDbSqlDatabaseMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesRetrieveContinuousBackupInformationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesRetrieveContinuousBackupInformationSample.ts index 4ed7d80b2fee..1a13a92be337 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesRetrieveContinuousBackupInformationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesRetrieveContinuousBackupInformationSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves continuous backup information for a container resource. * * @summary Retrieves continuous backup information for a container resource. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerBackupInformation.json */ async function cosmosDbSqlContainerBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlContainerRedistributeThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlContainerRedistributeThroughputSample.ts new file mode 100644 index 000000000000..7257e6bd3c10 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlContainerRedistributeThroughputSample.ts @@ -0,0 +1,60 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RedistributeThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB SQL container + * + * @summary Redistribute throughput for an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json + */ +async function cosmosDbSqlContainerRedistributeThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const redistributeThroughputParameters: RedistributeThroughputParameters = { + resource: { + sourcePhysicalPartitionThroughputInfo: [ + { id: "2", throughput: 5000 }, + { id: "3" }, + ], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, + ], + throughputPolicy: "custom", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.sqlResources.beginSqlContainerRedistributeThroughputAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + redistributeThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlContainerRedistributeThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlContainerRetrieveThroughputDistributionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlContainerRetrieveThroughputDistributionSample.ts new file mode 100644 index 000000000000..8dd7fcb86703 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlContainerRetrieveThroughputDistributionSample.ts @@ -0,0 +1,50 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RetrieveThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB SQL container + * + * @summary Retrieve throughput distribution for an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json + */ +async function cosmosDbSqlContainerRetrieveThroughputDistribution() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const retrieveThroughputParameters: RetrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.sqlResources.beginSqlContainerRetrieveThroughputDistributionAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + retrieveThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlContainerRetrieveThroughputDistribution(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlDatabasePartitionMergeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlDatabasePartitionMergeSample.ts new file mode 100644 index 000000000000..f1fb47d47c7a --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlDatabasePartitionMergeSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { MergeParameters, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Merges the partitions of a SQL database + * + * @summary Merges the partitions of a SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabasePartitionMerge.json + */ +async function cosmosDbSqlDatabasePartitionMerge() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const mergeParameters: MergeParameters = { isDryRun: false }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.sqlResources.beginSqlDatabasePartitionMergeAndWait( + resourceGroupName, + accountName, + databaseName, + mergeParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabasePartitionMerge(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlDatabaseRedistributeThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlDatabaseRedistributeThroughputSample.ts new file mode 100644 index 000000000000..c6b8f6b21750 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlDatabaseRedistributeThroughputSample.ts @@ -0,0 +1,58 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RedistributeThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB SQL database + * + * @summary Redistribute throughput for an Azure Cosmos DB SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json + */ +async function cosmosDbSqlDatabaseRedistributeThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const redistributeThroughputParameters: RedistributeThroughputParameters = { + resource: { + sourcePhysicalPartitionThroughputInfo: [ + { id: "2", throughput: 5000 }, + { id: "3" }, + ], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, + ], + throughputPolicy: "custom", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.sqlResources.beginSqlDatabaseRedistributeThroughputAndWait( + resourceGroupName, + accountName, + databaseName, + redistributeThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseRedistributeThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.ts similarity index 57% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.ts index 3644e29bcd81..b2fb85392d96 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.ts @@ -9,46 +9,40 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { - MongoDBDatabaseCreateUpdateParameters, + RetrieveThroughputParameters, CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** - * This sample demonstrates how to Create or updates Azure Cosmos DB MongoDB database + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB SQL database * - * @summary Create or updates Azure Cosmos DB MongoDB database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + * @summary Retrieve throughput distribution for an Azure Cosmos DB SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json */ -async function cosmosDbMongoDbdatabaseCreateUpdate() { +async function cosmosDbSqlDatabaseRetrieveThroughputDistribution() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; const accountName = "ddb1"; const databaseName = "databaseName"; - const createUpdateMongoDBDatabaseParameters: MongoDBDatabaseCreateUpdateParameters = - { - location: "West US", - options: {}, - resource: { id: "databaseName" }, - tags: {}, - }; + const retrieveThroughputParameters: RetrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; const credential = new DefaultAzureCredential(); const client = new CosmosDBManagementClient(credential, subscriptionId); const result = - await client.mongoDBResources.beginCreateUpdateMongoDBDatabaseAndWait( + await client.sqlResources.beginSqlDatabaseRetrieveThroughputDistributionAndWait( resourceGroupName, accountName, databaseName, - createUpdateMongoDBDatabaseParameters, + retrieveThroughputParameters, ); console.log(result); } async function main() { - cosmosDbMongoDbdatabaseCreateUpdate(); + cosmosDbSqlDatabaseRetrieveThroughputDistribution(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesUpdateSqlContainerThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesUpdateSqlContainerThroughputSample.ts index bf09b1bc5192..0871684a0f90 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesUpdateSqlContainerThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesUpdateSqlContainerThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB SQL container * * @summary Update RUs per second of an Azure Cosmos DB SQL container - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputUpdate.json */ async function cosmosDbSqlContainerThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesUpdateSqlDatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesUpdateSqlDatabaseThroughputSample.ts index f938c16ab62d..c7af11ab2ae2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesUpdateSqlDatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/sqlResourcesUpdateSqlDatabaseThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB SQL database * * @summary Update RUs per second of an Azure Cosmos DB SQL database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json */ async function cosmosDbSqlDatabaseThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesCreateUpdateTableRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesCreateUpdateTableRoleAssignmentSample.ts new file mode 100644 index 000000000000..04f9d9ebc582 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesCreateUpdateTableRoleAssignmentSample.ts @@ -0,0 +1,56 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TableRoleAssignmentResource, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB Table Role Assignment. + * + * @summary Creates or updates an Azure Cosmos DB Table Role Assignment. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json + */ +async function cosmosDbTableRoleAssignmentCreateUpdate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleAssignmentId = "myRoleAssignmentId"; + const createUpdateTableRoleAssignmentParameters: TableRoleAssignmentResource = + { + principalId: "myPrincipalId", + roleDefinitionId: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/tableRoleDefinitions/myRoleDefinitionId", + scope: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.tableResources.beginCreateUpdateTableRoleAssignmentAndWait( + resourceGroupName, + accountName, + roleAssignmentId, + createUpdateTableRoleAssignmentParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleAssignmentCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesCreateUpdateTableRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesCreateUpdateTableRoleDefinitionSample.ts new file mode 100644 index 000000000000..f48634ace8a3 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesCreateUpdateTableRoleDefinitionSample.ts @@ -0,0 +1,66 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TableRoleDefinitionResource, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB Table Role Definition. + * + * @summary Creates or updates an Azure Cosmos DB Table Role Definition. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json + */ +async function cosmosDbTableRoleDefinitionCreateUpdate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleDefinitionId = "myRoleDefinitionId"; + const createUpdateTableRoleDefinitionParameters: TableRoleDefinitionResource = + { + typePropertiesType: "CustomRole", + assignableScopes: [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases", + ], + permissions: [ + { + dataActions: [ + "Microsoft.DocumentDB/databaseAccounts/tableDatabases/containers/entities/create", + "Microsoft.DocumentDB/databaseAccounts/tableDatabases/containers/entities/read", + ], + notDataActions: [], + }, + ], + roleName: "myRoleName", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.tableResources.beginCreateUpdateTableRoleDefinitionAndWait( + resourceGroupName, + accountName, + roleDefinitionId, + createUpdateTableRoleDefinitionParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleDefinitionCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesCreateUpdateTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesCreateUpdateTableSample.ts index 7995b7e1dda6..c7603d6ee4a4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesCreateUpdateTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesCreateUpdateTableSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB Table * * @summary Create or update an Azure Cosmos DB Table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableCreateUpdate.json */ async function cosmosDbTableReplace() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesDeleteTableRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesDeleteTableRoleAssignmentSample.ts new file mode 100644 index 000000000000..472c1e01c61d --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesDeleteTableRoleAssignmentSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Table Role Assignment. + * + * @summary Deletes an existing Azure Cosmos DB Table Role Assignment. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentDelete.json + */ +async function cosmosDbTableRoleAssignmentDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleAssignmentId = "myRoleAssignmentId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.tableResources.beginDeleteTableRoleAssignmentAndWait( + resourceGroupName, + accountName, + roleAssignmentId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleAssignmentDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesDeleteTableRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesDeleteTableRoleDefinitionSample.ts new file mode 100644 index 000000000000..24f4abe17266 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesDeleteTableRoleDefinitionSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Table Role Definition. + * + * @summary Deletes an existing Azure Cosmos DB Table Role Definition. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionDelete.json + */ +async function cosmosDbTableRoleDefinitionDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleDefinitionId = "myRoleDefinitionId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.tableResources.beginDeleteTableRoleDefinitionAndWait( + resourceGroupName, + accountName, + roleDefinitionId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleDefinitionDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesDeleteTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesDeleteTableSample.ts index 4b98a6e095f9..92d99d92ce01 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesDeleteTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesDeleteTableSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Table. * * @summary Deletes an existing Azure Cosmos DB Table. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableDelete.json */ async function cosmosDbTableDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableRoleAssignmentSample.ts new file mode 100644 index 000000000000..bb44542fb9af --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableRoleAssignmentSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json + */ +async function cosmosDbTableRoleAssignmentGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleAssignmentId = "myRoleAssignmentId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.tableResources.getTableRoleAssignment( + resourceGroupName, + accountName, + roleAssignmentId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleAssignmentGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableRoleDefinitionSample.ts new file mode 100644 index 000000000000..81a9c5c48808 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableRoleDefinitionSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json + */ +async function cosmosDbTableRoleDefinitionGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleDefinitionId = "myRoleDefinitionId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.tableResources.getTableRoleDefinition( + resourceGroupName, + accountName, + roleDefinitionId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleDefinitionGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableSample.ts index a93f754dc1cc..2076eed43f65 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Tables under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Tables under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json */ async function cosmosDbTableGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableThroughputSample.ts index b69ff7564131..1d0f57c75c1d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesGetTableThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputGet.json */ async function cosmosDbTableThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesListTableRoleAssignmentsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesListTableRoleAssignmentsSample.ts new file mode 100644 index 000000000000..34c827de43cc --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesListTableRoleAssignmentsSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * + * @summary Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentList.json + */ +async function cosmosDbTableRoleAssignmentList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.tableResources.listTableRoleAssignments( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbTableRoleAssignmentList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesListTableRoleDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesListTableRoleDefinitionsSample.ts new file mode 100644 index 000000000000..6dd222724d6b --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesListTableRoleDefinitionsSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Table Role Definitions. + * + * @summary Retrieves the list of all Azure Cosmos DB Table Role Definitions. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionList.json + */ +async function cosmosDbTableRoleDefinitionList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.tableResources.listTableRoleDefinitions( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbTableRoleDefinitionList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesListTablesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesListTablesSample.ts index 8cc3a8c536ed..f2fade798236 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesListTablesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesListTablesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the Tables under an existing Azure Cosmos DB database account. * * @summary Lists the Tables under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableList.json */ async function cosmosDbTableList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesMigrateTableToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesMigrateTableToAutoscaleSample.ts index 3351c3d2dacc..1a03c2963466 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesMigrateTableToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesMigrateTableToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Table from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Table from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToAutoscale.json */ async function cosmosDbTableMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesMigrateTableToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesMigrateTableToManualThroughputSample.ts index 2f953cc797fc..9bc1e59b13a5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesMigrateTableToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesMigrateTableToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Table from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Table from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToManualThroughput.json */ async function cosmosDbTableMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesRetrieveContinuousBackupInformationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesRetrieveContinuousBackupInformationSample.ts index db5b04471043..d316ed5418e7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesRetrieveContinuousBackupInformationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesRetrieveContinuousBackupInformationSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves continuous backup information for a table. * * @summary Retrieves continuous backup information for a table. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableBackupInformation.json */ async function cosmosDbTableCollectionBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesUpdateTableThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesUpdateTableThroughputSample.ts index 1ea2878e68e3..3f95ed0fa16a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesUpdateTableThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/tableResourcesUpdateTableThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Table * * @summary Update RUs per second of an Azure Cosmos DB Table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputUpdate.json */ async function cosmosDbTableThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountCreateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountCreateSample.ts new file mode 100644 index 000000000000..2b189c064870 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountCreateSample.ts @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ThroughputPoolAccountResource, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * + * @summary Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json + */ +async function cosmosDbThroughputPoolAccountCreate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const throughputPoolName = "tp1"; + const throughputPoolAccountName = "db1"; + const body: ThroughputPoolAccountResource = { + accountLocation: "West US", + accountResourceIdentifier: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPoolAccount.beginCreateAndWait( + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + body, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolAccountCreate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountDeleteSample.ts new file mode 100644 index 000000000000..2ed118624d0f --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @summary Removes an existing Azure Cosmos DB database account from a throughput pool. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json + */ +async function cosmosDbThroughputPoolAccountDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const throughputPoolAccountName = "db1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPoolAccount.beginDeleteAndWait( + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolAccountDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountGetSample.ts new file mode 100644 index 000000000000..d5dfc891b6de --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountGetSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json + */ +async function cosmosDbThroughputPoolAccountGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const throughputPoolAccountName = "db1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPoolAccount.get( + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolAccountGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountsListSample.ts new file mode 100644 index 000000000000..9fce3a1d9c6a --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolAccountsListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @summary Lists all the Azure Cosmos DB accounts available under the subscription. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json + */ +async function cosmosDbThroughputPoolAccountList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.throughputPoolAccounts.list( + resourceGroupName, + throughputPoolName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbThroughputPoolAccountList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolCreateOrUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolCreateOrUpdateSample.ts new file mode 100644 index 000000000000..39d55fca4edb --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolCreateOrUpdateSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ThroughputPoolResource, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * + * @summary Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json + */ +async function cosmosDbThroughputPoolCreate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const throughputPoolName = "tp1"; + const body: ThroughputPoolResource = { + location: "westus2", + maxThroughput: 10000, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.beginCreateOrUpdateAndWait( + resourceGroupName, + throughputPoolName, + body, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolCreate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolDeleteSample.ts new file mode 100644 index 000000000000..ba95f40f84c0 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @summary Deletes an existing Azure Cosmos DB Throughput Pool. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json + */ +async function cosmosDbThroughputPoolDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.beginDeleteAndWait( + resourceGroupName, + throughputPoolName, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolGetSample.ts new file mode 100644 index 000000000000..f490c3ea474e --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolGetSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json + */ +async function cosmosDbThroughputPoolGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.get( + resourceGroupName, + throughputPoolName, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolUpdateSample.ts new file mode 100644 index 000000000000..08a2aeb2813f --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ThroughputPoolUpdate, + ThroughputPoolUpdateOptionalParams, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @summary Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json + */ +async function cosmosDbThroughputPoolUpdate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const throughputPoolName = "tp1"; + const body: ThroughputPoolUpdate = { maxThroughput: 10000 }; + const options: ThroughputPoolUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.beginUpdateAndWait( + resourceGroupName, + throughputPoolName, + options, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolsListByResourceGroupSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolsListByResourceGroupSample.ts new file mode 100644 index 000000000000..f122758ddbd8 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolsListByResourceGroupSample.ts @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to List all the ThroughputPools in a given resource group. + * + * @summary List all the ThroughputPools in a given resource group. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json + */ +async function cosmosDbThroughputPoolListByResourceGroup() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.throughputPools.listByResourceGroup( + resourceGroupName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbThroughputPoolListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolsListSample.ts new file mode 100644 index 000000000000..af755a712c72 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples-dev/throughputPoolsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @summary Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json + */ +async function cosmosDbThroughputPoolList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.throughputPools.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbThroughputPoolList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/README.md b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/README.md new file mode 100644 index 000000000000..09a6a223a3ce --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/README.md @@ -0,0 +1,548 @@ +# client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [cassandraClustersCreateUpdateSample.js][cassandraclusterscreateupdatesample] | Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterCreate.json | +| [cassandraClustersDeallocateSample.js][cassandraclustersdeallocatesample] | Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json | +| [cassandraClustersDeleteSample.js][cassandraclustersdeletesample] | Deletes a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDelete.json | +| [cassandraClustersGetBackupSample.js][cassandraclustersgetbackupsample] | Get the properties of an individual backup of this cluster that is available to restore. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackup.json | +| [cassandraClustersGetCommandAsyncSample.js][cassandraclustersgetcommandasyncsample] | Get details about a specified command that was run asynchronously. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandResult.json | +| [cassandraClustersGetSample.js][cassandraclustersgetsample] | Get the properties of a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json | +| [cassandraClustersInvokeCommandAsyncSample.js][cassandraclustersinvokecommandasyncsample] | Invoke a command like nodetool for cassandra maintenance asynchronously x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandAsync.json | +| [cassandraClustersInvokeCommandSample.js][cassandraclustersinvokecommandsample] | Invoke a command like nodetool for cassandra maintenance x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommand.json | +| [cassandraClustersListBackupsSample.js][cassandraclusterslistbackupssample] | List the backups of this cluster that are available to restore. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackupsList.json | +| [cassandraClustersListByResourceGroupSample.js][cassandraclusterslistbyresourcegroupsample] | List all managed Cassandra clusters in this resource group. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json | +| [cassandraClustersListBySubscriptionSample.js][cassandraclusterslistbysubscriptionsample] | List all managed Cassandra clusters in this subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json | +| [cassandraClustersListCommandSample.js][cassandraclusterslistcommandsample] | List all commands currently running on ring info x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraListCommand.json | +| [cassandraClustersStartSample.js][cassandraclustersstartsample] | Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterStart.json | +| [cassandraClustersStatusSample.js][cassandraclustersstatussample] | Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraStatus.json | +| [cassandraClustersUpdateSample.js][cassandraclustersupdatesample] | Updates some of the properties of a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterPatch.json | +| [cassandraDataCentersCreateUpdateSample.js][cassandradatacenterscreateupdatesample] | Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json | +| [cassandraDataCentersDeleteSample.js][cassandradatacentersdeletesample] | Delete a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json | +| [cassandraDataCentersGetSample.js][cassandradatacentersgetsample] | Get the properties of a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json | +| [cassandraDataCentersListSample.js][cassandradatacenterslistsample] | List all data centers in a particular managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterList.json | +| [cassandraDataCentersUpdateSample.js][cassandradatacentersupdatesample] | Update some of the properties of a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json | +| [cassandraResourcesCreateUpdateCassandraKeyspaceSample.js][cassandraresourcescreateupdatecassandrakeyspacesample] | Create or update an Azure Cosmos DB Cassandra keyspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json | +| [cassandraResourcesCreateUpdateCassandraTableSample.js][cassandraresourcescreateupdatecassandratablesample] | Create or update an Azure Cosmos DB Cassandra Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json | +| [cassandraResourcesCreateUpdateCassandraViewSample.js][cassandraresourcescreateupdatecassandraviewsample] | Create or update an Azure Cosmos DB Cassandra View x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json | +| [cassandraResourcesDeleteCassandraKeyspaceSample.js][cassandraresourcesdeletecassandrakeyspacesample] | Deletes an existing Azure Cosmos DB Cassandra keyspace. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceDelete.json | +| [cassandraResourcesDeleteCassandraTableSample.js][cassandraresourcesdeletecassandratablesample] | Deletes an existing Azure Cosmos DB Cassandra table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableDelete.json | +| [cassandraResourcesDeleteCassandraViewSample.js][cassandraresourcesdeletecassandraviewsample] | Deletes an existing Azure Cosmos DB Cassandra view. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewDelete.json | +| [cassandraResourcesGetCassandraKeyspaceSample.js][cassandraresourcesgetcassandrakeyspacesample] | Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json | +| [cassandraResourcesGetCassandraKeyspaceThroughputSample.js][cassandraresourcesgetcassandrakeyspacethroughputsample] | Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json | +| [cassandraResourcesGetCassandraTableSample.js][cassandraresourcesgetcassandratablesample] | Gets the Cassandra table under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json | +| [cassandraResourcesGetCassandraTableThroughputSample.js][cassandraresourcesgetcassandratablethroughputsample] | Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputGet.json | +| [cassandraResourcesGetCassandraViewSample.js][cassandraresourcesgetcassandraviewsample] | Gets the Cassandra view under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewGet.json | +| [cassandraResourcesGetCassandraViewThroughputSample.js][cassandraresourcesgetcassandraviewthroughputsample] | Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputGet.json | +| [cassandraResourcesListCassandraKeyspacesSample.js][cassandraresourceslistcassandrakeyspacessample] | Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceList.json | +| [cassandraResourcesListCassandraTablesSample.js][cassandraresourceslistcassandratablessample] | Lists the Cassandra table under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableList.json | +| [cassandraResourcesListCassandraViewsSample.js][cassandraresourceslistcassandraviewssample] | Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewList.json | +| [cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.js][cassandraresourcesmigratecassandrakeyspacetoautoscalesample] | Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json | +| [cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.js][cassandraresourcesmigratecassandrakeyspacetomanualthroughputsample] | Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json | +| [cassandraResourcesMigrateCassandraTableToAutoscaleSample.js][cassandraresourcesmigratecassandratabletoautoscalesample] | Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json | +| [cassandraResourcesMigrateCassandraTableToManualThroughputSample.js][cassandraresourcesmigratecassandratabletomanualthroughputsample] | Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json | +| [cassandraResourcesMigrateCassandraViewToAutoscaleSample.js][cassandraresourcesmigratecassandraviewtoautoscalesample] | Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json | +| [cassandraResourcesMigrateCassandraViewToManualThroughputSample.js][cassandraresourcesmigratecassandraviewtomanualthroughputsample] | Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json | +| [cassandraResourcesUpdateCassandraKeyspaceThroughputSample.js][cassandraresourcesupdatecassandrakeyspacethroughputsample] | Update RUs per second of an Azure Cosmos DB Cassandra Keyspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json | +| [cassandraResourcesUpdateCassandraTableThroughputSample.js][cassandraresourcesupdatecassandratablethroughputsample] | Update RUs per second of an Azure Cosmos DB Cassandra table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputUpdate.json | +| [cassandraResourcesUpdateCassandraViewThroughputSample.js][cassandraresourcesupdatecassandraviewthroughputsample] | Update RUs per second of an Azure Cosmos DB Cassandra view x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputUpdate.json | +| [chaosFaultEnableDisableSample.js][chaosfaultenabledisablesample] | Enable, disable Chaos Fault in a CosmosDB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultEnableDisable.json | +| [chaosFaultGetSample.js][chaosfaultgetsample] | Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultGet.json | +| [chaosFaultListSample.js][chaosfaultlistsample] | List Chaos Faults for CosmosDB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultList.json | +| [collectionListMetricDefinitionsSample.js][collectionlistmetricdefinitionssample] | Retrieves metric definitions for the given collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetricDefinitions.json | +| [collectionListMetricsSample.js][collectionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetrics.json | +| [collectionListUsagesSample.js][collectionlistusagessample] | Retrieves the usages (most recent storage data) for the given collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetUsages.json | +| [collectionPartitionListMetricsSample.js][collectionpartitionlistmetricssample] | Retrieves the metrics determined by the given filter for the given collection, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetMetrics.json | +| [collectionPartitionListUsagesSample.js][collectionpartitionlistusagessample] | Retrieves the usages (most recent storage data) for the given collection, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetUsages.json | +| [collectionPartitionRegionListMetricsSample.js][collectionpartitionregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given collection and region, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json | +| [collectionRegionListMetricsSample.js][collectionregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account, collection and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRegionCollectionGetMetrics.json | +| [dataTransferJobsCancelSample.js][datatransferjobscancelsample] | Cancels a Data Transfer Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json | +| [dataTransferJobsCompleteSample.js][datatransferjobscompletesample] | Completes a Data Transfer Online Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json | +| [dataTransferJobsCreateSample.js][datatransferjobscreatesample] | Creates a Data Transfer Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json | +| [dataTransferJobsGetSample.js][datatransferjobsgetsample] | Get a Data Transfer Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json | +| [dataTransferJobsListByDatabaseAccountSample.js][datatransferjobslistbydatabaseaccountsample] | Get a list of Data Transfer jobs. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json | +| [dataTransferJobsPauseSample.js][datatransferjobspausesample] | Pause a Data Transfer Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json | +| [dataTransferJobsResumeSample.js][datatransferjobsresumesample] | Resumes a Data Transfer Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json | +| [databaseAccountRegionListMetricsSample.js][databaseaccountregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json | +| [databaseAccountsCheckNameExistsSample.js][databaseaccountschecknameexistssample] | Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json | +| [databaseAccountsCreateOrUpdateSample.js][databaseaccountscreateorupdatesample] | Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json | +| [databaseAccountsDeleteSample.js][databaseaccountsdeletesample] | Deletes an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountDelete.json | +| [databaseAccountsFailoverPriorityChangeSample.js][databaseaccountsfailoverprioritychangesample] | Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json | +| [databaseAccountsGetReadOnlyKeysSample.js][databaseaccountsgetreadonlykeyssample] | Lists the read-only access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json | +| [databaseAccountsGetSample.js][databaseaccountsgetsample] | Retrieves the properties of an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json | +| [databaseAccountsListByResourceGroupSample.js][databaseaccountslistbyresourcegroupsample] | Lists all the Azure Cosmos DB database accounts available under the given resource group. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json | +| [databaseAccountsListConnectionStringsSample.js][databaseaccountslistconnectionstringssample] | Lists the connection strings for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json | +| [databaseAccountsListKeysSample.js][databaseaccountslistkeyssample] | Lists the access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListKeys.json | +| [databaseAccountsListMetricDefinitionsSample.js][databaseaccountslistmetricdefinitionssample] | Retrieves metric definitions for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json | +| [databaseAccountsListMetricsSample.js][databaseaccountslistmetricssample] | Retrieves the metrics determined by the given filter for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetrics.json | +| [databaseAccountsListReadOnlyKeysSample.js][databaseaccountslistreadonlykeyssample] | Lists the read-only access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json | +| [databaseAccountsListSample.js][databaseaccountslistsample] | Lists all the Azure Cosmos DB database accounts available under the subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountList.json | +| [databaseAccountsListUsagesSample.js][databaseaccountslistusagessample] | Retrieves the usages (most recent data) for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetUsages.json | +| [databaseAccountsOfflineRegionSample.js][databaseaccountsofflineregionsample] | Offline the specified region for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json | +| [databaseAccountsOnlineRegionSample.js][databaseaccountsonlineregionsample] | Online the specified region for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json | +| [databaseAccountsRegenerateKeySample.js][databaseaccountsregeneratekeysample] | Regenerates an access key for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json | +| [databaseAccountsUpdateSample.js][databaseaccountsupdatesample] | Updates the properties of an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountPatch.json | +| [databaseListMetricDefinitionsSample.js][databaselistmetricdefinitionssample] | Retrieves metric definitions for the given database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json | +| [databaseListMetricsSample.js][databaselistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetrics.json | +| [databaseListUsagesSample.js][databaselistusagessample] | Retrieves the usages (most recent data) for the given database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetUsages.json | +| [graphResourcesCreateUpdateGraphSample.js][graphresourcescreateupdategraphsample] | Create or update an Azure Cosmos DB Graph. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json | +| [graphResourcesDeleteGraphResourceSample.js][graphresourcesdeletegraphresourcesample] | Deletes an existing Azure Cosmos DB Graph Resource. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceDelete.json | +| [graphResourcesGetGraphSample.js][graphresourcesgetgraphsample] | Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceGet.json | +| [graphResourcesListGraphsSample.js][graphresourceslistgraphssample] | Lists the graphs under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceList.json | +| [gremlinResourcesCreateUpdateGremlinDatabaseSample.js][gremlinresourcescreateupdategremlindatabasesample] | Create or update an Azure Cosmos DB Gremlin database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json | +| [gremlinResourcesCreateUpdateGremlinGraphSample.js][gremlinresourcescreateupdategremlingraphsample] | Create or update an Azure Cosmos DB Gremlin graph x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json | +| [gremlinResourcesDeleteGremlinDatabaseSample.js][gremlinresourcesdeletegremlindatabasesample] | Deletes an existing Azure Cosmos DB Gremlin database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseDelete.json | +| [gremlinResourcesDeleteGremlinGraphSample.js][gremlinresourcesdeletegremlingraphsample] | Deletes an existing Azure Cosmos DB Gremlin graph. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphDelete.json | +| [gremlinResourcesGetGremlinDatabaseSample.js][gremlinresourcesgetgremlindatabasesample] | Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json | +| [gremlinResourcesGetGremlinDatabaseThroughputSample.js][gremlinresourcesgetgremlindatabasethroughputsample] | Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json | +| [gremlinResourcesGetGremlinGraphSample.js][gremlinresourcesgetgremlingraphsample] | Gets the Gremlin graph under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json | +| [gremlinResourcesGetGremlinGraphThroughputSample.js][gremlinresourcesgetgremlingraphthroughputsample] | Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputGet.json | +| [gremlinResourcesListGremlinDatabasesSample.js][gremlinresourceslistgremlindatabasessample] | Lists the Gremlin databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseList.json | +| [gremlinResourcesListGremlinGraphsSample.js][gremlinresourceslistgremlingraphssample] | Lists the Gremlin graph under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphList.json | +| [gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.js][gremlinresourcesmigrategremlindatabasetoautoscalesample] | Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json | +| [gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.js][gremlinresourcesmigrategremlindatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json | +| [gremlinResourcesMigrateGremlinGraphToAutoscaleSample.js][gremlinresourcesmigrategremlingraphtoautoscalesample] | Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json | +| [gremlinResourcesMigrateGremlinGraphToManualThroughputSample.js][gremlinresourcesmigrategremlingraphtomanualthroughputsample] | Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json | +| [gremlinResourcesRetrieveContinuousBackupInformationSample.js][gremlinresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a gremlin graph. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphBackupInformation.json | +| [gremlinResourcesUpdateGremlinDatabaseThroughputSample.js][gremlinresourcesupdategremlindatabasethroughputsample] | Update RUs per second of an Azure Cosmos DB Gremlin database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json | +| [gremlinResourcesUpdateGremlinGraphThroughputSample.js][gremlinresourcesupdategremlingraphthroughputsample] | Update RUs per second of an Azure Cosmos DB Gremlin graph x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json | +| [locationsGetSample.js][locationsgetsample] | Get the properties of an existing Cosmos DB location x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json | +| [locationsListSample.js][locationslistsample] | List Cosmos DB locations and their properties x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationList.json | +| [mongoDbResourcesCreateUpdateMongoDbcollectionSample.js][mongodbresourcescreateupdatemongodbcollectionsample] | Create or update an Azure Cosmos DB MongoDB Collection x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json | +| [mongoDbResourcesCreateUpdateMongoDbdatabaseSample.js][mongodbresourcescreateupdatemongodbdatabasesample] | Create or updates Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json | +| [mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.js][mongodbresourcescreateupdatemongoroledefinitionsample] | Creates or updates an Azure Cosmos DB Mongo Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json | +| [mongoDbResourcesCreateUpdateMongoUserDefinitionSample.js][mongodbresourcescreateupdatemongouserdefinitionsample] | Creates or updates an Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json | +| [mongoDbResourcesDeleteMongoDbcollectionSample.js][mongodbresourcesdeletemongodbcollectionsample] | Deletes an existing Azure Cosmos DB MongoDB Collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionDelete.json | +| [mongoDbResourcesDeleteMongoDbdatabaseSample.js][mongodbresourcesdeletemongodbdatabasesample] | Deletes an existing Azure Cosmos DB MongoDB database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseDelete.json | +| [mongoDbResourcesDeleteMongoRoleDefinitionSample.js][mongodbresourcesdeletemongoroledefinitionsample] | Deletes an existing Azure Cosmos DB Mongo Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json | +| [mongoDbResourcesDeleteMongoUserDefinitionSample.js][mongodbresourcesdeletemongouserdefinitionsample] | Deletes an existing Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json | +| [mongoDbResourcesGetMongoDbcollectionSample.js][mongodbresourcesgetmongodbcollectionsample] | Gets the MongoDB collection under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json | +| [mongoDbResourcesGetMongoDbcollectionThroughputSample.js][mongodbresourcesgetmongodbcollectionthroughputsample] | Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json | +| [mongoDbResourcesGetMongoDbdatabaseSample.js][mongodbresourcesgetmongodbdatabasesample] | Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json | +| [mongoDbResourcesGetMongoDbdatabaseThroughputSample.js][mongodbresourcesgetmongodbdatabasethroughputsample] | Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json | +| [mongoDbResourcesGetMongoRoleDefinitionSample.js][mongodbresourcesgetmongoroledefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json | +| [mongoDbResourcesGetMongoUserDefinitionSample.js][mongodbresourcesgetmongouserdefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json | +| [mongoDbResourcesListMongoDbcollectionPartitionMergeSample.js][mongodbresourceslistmongodbcollectionpartitionmergesample] | Merges the partitions of a MongoDB Collection x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json | +| [mongoDbResourcesListMongoDbcollectionsSample.js][mongodbresourceslistmongodbcollectionssample] | Lists the MongoDB collection under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionList.json | +| [mongoDbResourcesListMongoDbdatabasesSample.js][mongodbresourceslistmongodbdatabasessample] | Lists the MongoDB databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseList.json | +| [mongoDbResourcesListMongoRoleDefinitionsSample.js][mongodbresourceslistmongoroledefinitionssample] | Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionList.json | +| [mongoDbResourcesListMongoUserDefinitionsSample.js][mongodbresourceslistmongouserdefinitionssample] | Retrieves the list of all Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionList.json | +| [mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.js][mongodbresourcesmigratemongodbcollectiontoautoscalesample] | Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json | +| [mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.js][mongodbresourcesmigratemongodbcollectiontomanualthroughputsample] | Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json | +| [mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.js][mongodbresourcesmigratemongodbdatabasetoautoscalesample] | Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json | +| [mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.js][mongodbresourcesmigratemongodbdatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json | +| [mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.js][mongodbresourcesmongodbcontainerredistributethroughputsample] | Redistribute throughput for an Azure Cosmos DB MongoDB container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json | +| [mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.js][mongodbresourcesmongodbcontainerretrievethroughputdistributionsample] | Retrieve throughput distribution for an Azure Cosmos DB MongoDB container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json | +| [mongoDbResourcesMongoDbdatabasePartitionMergeSample.js][mongodbresourcesmongodbdatabasepartitionmergesample] | Merges the partitions of a MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json | +| [mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.js][mongodbresourcesmongodbdatabaseredistributethroughputsample] | Redistribute throughput for an Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json | +| [mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.js][mongodbresourcesmongodbdatabaseretrievethroughputdistributionsample] | Retrieve throughput distribution for an Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json | +| [mongoDbResourcesRetrieveContinuousBackupInformationSample.js][mongodbresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a Mongodb collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json | +| [mongoDbResourcesUpdateMongoDbcollectionThroughputSample.js][mongodbresourcesupdatemongodbcollectionthroughputsample] | Update the RUs per second of an Azure Cosmos DB MongoDB collection x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json | +| [mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.js][mongodbresourcesupdatemongodbdatabasethroughputsample] | Update RUs per second of the an Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json | +| [networkSecurityPerimeterConfigurationsGetSample.js][networksecurityperimeterconfigurationsgetsample] | Gets effective Network Security Perimeter Configuration for association x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json | +| [networkSecurityPerimeterConfigurationsListSample.js][networksecurityperimeterconfigurationslistsample] | Gets list of effective Network Security Perimeter Configuration for cosmos db account x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationList.json | +| [networkSecurityPerimeterConfigurationsReconcileSample.js][networksecurityperimeterconfigurationsreconcilesample] | Refreshes any information about the association. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json | +| [notebookWorkspacesCreateOrUpdateSample.js][notebookworkspacescreateorupdatesample] | Creates the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceCreate.json | +| [notebookWorkspacesDeleteSample.js][notebookworkspacesdeletesample] | Deletes the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceDelete.json | +| [notebookWorkspacesGetSample.js][notebookworkspacesgetsample] | Gets the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceGet.json | +| [notebookWorkspacesListByDatabaseAccountSample.js][notebookworkspaceslistbydatabaseaccountsample] | Gets the notebook workspace resources of an existing Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceList.json | +| [notebookWorkspacesListConnectionInfoSample.js][notebookworkspaceslistconnectioninfosample] | Retrieves the connection info for the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json | +| [notebookWorkspacesRegenerateAuthTokenSample.js][notebookworkspacesregenerateauthtokensample] | Regenerates the auth token for the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json | +| [notebookWorkspacesStartSample.js][notebookworkspacesstartsample] | Starts the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceStart.json | +| [operationsListSample.js][operationslistsample] | Lists all of the available Cosmos DB Resource Provider operations. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBOperationsList.json | +| [partitionKeyRangeIdListMetricsSample.js][partitionkeyrangeidlistmetricssample] | Retrieves the metrics determined by the given filter for the given partition key range id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json | +| [partitionKeyRangeIdRegionListMetricsSample.js][partitionkeyrangeidregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given partition key range id and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json | +| [percentileListMetricsSample.js][percentilelistmetricssample] | Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileGetMetrics.json | +| [percentileSourceTargetListMetricsSample.js][percentilesourcetargetlistmetricssample] | Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json | +| [percentileTargetListMetricsSample.js][percentiletargetlistmetricssample] | Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileTargetGetMetrics.json | +| [privateEndpointConnectionsCreateOrUpdateSample.js][privateendpointconnectionscreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json | +| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json | +| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json | +| [privateEndpointConnectionsListByDatabaseAccountSample.js][privateendpointconnectionslistbydatabaseaccountsample] | List all private endpoint connections on a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json | +| [privateLinkResourcesGetSample.js][privatelinkresourcesgetsample] | Gets the private link resources that need to be created for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json | +| [privateLinkResourcesListByDatabaseAccountSample.js][privatelinkresourceslistbydatabaseaccountsample] | Gets the private link resources that need to be created for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceListGet.json | +| [restorableDatabaseAccountsGetByLocationSample.js][restorabledatabaseaccountsgetbylocationsample] | Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/\*' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json | +| [restorableDatabaseAccountsListByLocationSample.js][restorabledatabaseaccountslistbylocationsample] | Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json | +| [restorableDatabaseAccountsListSample.js][restorabledatabaseaccountslistsample] | Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json | +| [restorableGremlinDatabasesListSample.js][restorablegremlindatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinDatabaseList.json | +| [restorableGremlinGraphsListSample.js][restorablegremlingraphslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinGraphList.json | +| [restorableGremlinResourcesListSample.js][restorablegremlinresourceslistsample] | Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinResourceList.json | +| [restorableMongodbCollectionsListSample.js][restorablemongodbcollectionslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbCollectionList.json | +| [restorableMongodbDatabasesListSample.js][restorablemongodbdatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbDatabaseList.json | +| [restorableMongodbResourcesListSample.js][restorablemongodbresourceslistsample] | Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbResourceList.json | +| [restorableSqlContainersListSample.js][restorablesqlcontainerslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlContainerList.json | +| [restorableSqlDatabasesListSample.js][restorablesqldatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlDatabaseList.json | +| [restorableSqlResourcesListSample.js][restorablesqlresourceslistsample] | Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlResourceList.json | +| [restorableTableResourcesListSample.js][restorabletableresourceslistsample] | Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableResourceList.json | +| [restorableTablesListSample.js][restorabletableslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableList.json | +| [serviceCreateSample.js][servicecreatesample] | Creates a service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceCreate.json | +| [serviceDeleteSample.js][servicedeletesample] | Deletes service with the given serviceName. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceDelete.json | +| [serviceGetSample.js][servicegetsample] | Gets the status of service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json | +| [serviceListSample.js][servicelistsample] | Gets the status of service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBServicesList.json | +| [sqlResourcesCreateUpdateClientEncryptionKeySample.js][sqlresourcescreateupdateclientencryptionkeysample] | Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlContainerSample.js][sqlresourcescreateupdatesqlcontainersample] | Create or update an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlDatabaseSample.js][sqlresourcescreateupdatesqldatabasesample] | Create or update an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlRoleAssignmentSample.js][sqlresourcescreateupdatesqlroleassignmentsample] | Creates or updates an Azure Cosmos DB SQL Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlRoleDefinitionSample.js][sqlresourcescreateupdatesqlroledefinitionsample] | Creates or updates an Azure Cosmos DB SQL Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlStoredProcedureSample.js][sqlresourcescreateupdatesqlstoredproceduresample] | Create or update an Azure Cosmos DB SQL storedProcedure x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlTriggerSample.js][sqlresourcescreateupdatesqltriggersample] | Create or update an Azure Cosmos DB SQL trigger x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.js][sqlresourcescreateupdatesqluserdefinedfunctionsample] | Create or update an Azure Cosmos DB SQL userDefinedFunction x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json | +| [sqlResourcesDeleteSqlContainerSample.js][sqlresourcesdeletesqlcontainersample] | Deletes an existing Azure Cosmos DB SQL container. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerDelete.json | +| [sqlResourcesDeleteSqlDatabaseSample.js][sqlresourcesdeletesqldatabasesample] | Deletes an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseDelete.json | +| [sqlResourcesDeleteSqlRoleAssignmentSample.js][sqlresourcesdeletesqlroleassignmentsample] | Deletes an existing Azure Cosmos DB SQL Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json | +| [sqlResourcesDeleteSqlRoleDefinitionSample.js][sqlresourcesdeletesqlroledefinitionsample] | Deletes an existing Azure Cosmos DB SQL Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json | +| [sqlResourcesDeleteSqlStoredProcedureSample.js][sqlresourcesdeletesqlstoredproceduresample] | Deletes an existing Azure Cosmos DB SQL storedProcedure. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureDelete.json | +| [sqlResourcesDeleteSqlTriggerSample.js][sqlresourcesdeletesqltriggersample] | Deletes an existing Azure Cosmos DB SQL trigger. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerDelete.json | +| [sqlResourcesDeleteSqlUserDefinedFunctionSample.js][sqlresourcesdeletesqluserdefinedfunctionsample] | Deletes an existing Azure Cosmos DB SQL userDefinedFunction. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json | +| [sqlResourcesGetClientEncryptionKeySample.js][sqlresourcesgetclientencryptionkeysample] | Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json | +| [sqlResourcesGetSqlContainerSample.js][sqlresourcesgetsqlcontainersample] | Gets the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json | +| [sqlResourcesGetSqlContainerThroughputSample.js][sqlresourcesgetsqlcontainerthroughputsample] | Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputGet.json | +| [sqlResourcesGetSqlDatabaseSample.js][sqlresourcesgetsqldatabasesample] | Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json | +| [sqlResourcesGetSqlDatabaseThroughputSample.js][sqlresourcesgetsqldatabasethroughputsample] | Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputGet.json | +| [sqlResourcesGetSqlRoleAssignmentSample.js][sqlresourcesgetsqlroleassignmentsample] | Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json | +| [sqlResourcesGetSqlRoleDefinitionSample.js][sqlresourcesgetsqlroledefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json | +| [sqlResourcesGetSqlStoredProcedureSample.js][sqlresourcesgetsqlstoredproceduresample] | Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json | +| [sqlResourcesGetSqlTriggerSample.js][sqlresourcesgetsqltriggersample] | Gets the SQL trigger under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json | +| [sqlResourcesGetSqlUserDefinedFunctionSample.js][sqlresourcesgetsqluserdefinedfunctionsample] | Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json | +| [sqlResourcesListClientEncryptionKeysSample.js][sqlresourceslistclientencryptionkeyssample] | Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeysList.json | +| [sqlResourcesListSqlContainerPartitionMergeSample.js][sqlresourceslistsqlcontainerpartitionmergesample] | Merges the partitions of a SQL Container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerPartitionMerge.json | +| [sqlResourcesListSqlContainersSample.js][sqlresourceslistsqlcontainerssample] | Lists the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerList.json | +| [sqlResourcesListSqlDatabasesSample.js][sqlresourceslistsqldatabasessample] | Lists the SQL databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseList.json | +| [sqlResourcesListSqlRoleAssignmentsSample.js][sqlresourceslistsqlroleassignmentssample] | Retrieves the list of all Azure Cosmos DB SQL Role Assignments. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentList.json | +| [sqlResourcesListSqlRoleDefinitionsSample.js][sqlresourceslistsqlroledefinitionssample] | Retrieves the list of all Azure Cosmos DB SQL Role Definitions. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionList.json | +| [sqlResourcesListSqlStoredProceduresSample.js][sqlresourceslistsqlstoredproceduressample] | Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureList.json | +| [sqlResourcesListSqlTriggersSample.js][sqlresourceslistsqltriggerssample] | Lists the SQL trigger under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerList.json | +| [sqlResourcesListSqlUserDefinedFunctionsSample.js][sqlresourceslistsqluserdefinedfunctionssample] | Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionList.json | +| [sqlResourcesMigrateSqlContainerToAutoscaleSample.js][sqlresourcesmigratesqlcontainertoautoscalesample] | Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json | +| [sqlResourcesMigrateSqlContainerToManualThroughputSample.js][sqlresourcesmigratesqlcontainertomanualthroughputsample] | Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json | +| [sqlResourcesMigrateSqlDatabaseToAutoscaleSample.js][sqlresourcesmigratesqldatabasetoautoscalesample] | Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json | +| [sqlResourcesMigrateSqlDatabaseToManualThroughputSample.js][sqlresourcesmigratesqldatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json | +| [sqlResourcesRetrieveContinuousBackupInformationSample.js][sqlresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a container resource. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerBackupInformation.json | +| [sqlResourcesSqlContainerRedistributeThroughputSample.js][sqlresourcessqlcontainerredistributethroughputsample] | Redistribute throughput for an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json | +| [sqlResourcesSqlContainerRetrieveThroughputDistributionSample.js][sqlresourcessqlcontainerretrievethroughputdistributionsample] | Retrieve throughput distribution for an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json | +| [sqlResourcesSqlDatabasePartitionMergeSample.js][sqlresourcessqldatabasepartitionmergesample] | Merges the partitions of a SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabasePartitionMerge.json | +| [sqlResourcesSqlDatabaseRedistributeThroughputSample.js][sqlresourcessqldatabaseredistributethroughputsample] | Redistribute throughput for an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json | +| [sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.js][sqlresourcessqldatabaseretrievethroughputdistributionsample] | Retrieve throughput distribution for an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json | +| [sqlResourcesUpdateSqlContainerThroughputSample.js][sqlresourcesupdatesqlcontainerthroughputsample] | Update RUs per second of an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputUpdate.json | +| [sqlResourcesUpdateSqlDatabaseThroughputSample.js][sqlresourcesupdatesqldatabasethroughputsample] | Update RUs per second of an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json | +| [tableResourcesCreateUpdateTableRoleAssignmentSample.js][tableresourcescreateupdatetableroleassignmentsample] | Creates or updates an Azure Cosmos DB Table Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json | +| [tableResourcesCreateUpdateTableRoleDefinitionSample.js][tableresourcescreateupdatetableroledefinitionsample] | Creates or updates an Azure Cosmos DB Table Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json | +| [tableResourcesCreateUpdateTableSample.js][tableresourcescreateupdatetablesample] | Create or update an Azure Cosmos DB Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableCreateUpdate.json | +| [tableResourcesDeleteTableRoleAssignmentSample.js][tableresourcesdeletetableroleassignmentsample] | Deletes an existing Azure Cosmos DB Table Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentDelete.json | +| [tableResourcesDeleteTableRoleDefinitionSample.js][tableresourcesdeletetableroledefinitionsample] | Deletes an existing Azure Cosmos DB Table Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionDelete.json | +| [tableResourcesDeleteTableSample.js][tableresourcesdeletetablesample] | Deletes an existing Azure Cosmos DB Table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableDelete.json | +| [tableResourcesGetTableRoleAssignmentSample.js][tableresourcesgettableroleassignmentsample] | Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json | +| [tableResourcesGetTableRoleDefinitionSample.js][tableresourcesgettableroledefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json | +| [tableResourcesGetTableSample.js][tableresourcesgettablesample] | Gets the Tables under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json | +| [tableResourcesGetTableThroughputSample.js][tableresourcesgettablethroughputsample] | Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputGet.json | +| [tableResourcesListTableRoleAssignmentsSample.js][tableresourceslisttableroleassignmentssample] | Retrieves the list of all Azure Cosmos DB Table Role Assignments. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentList.json | +| [tableResourcesListTableRoleDefinitionsSample.js][tableresourceslisttableroledefinitionssample] | Retrieves the list of all Azure Cosmos DB Table Role Definitions. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionList.json | +| [tableResourcesListTablesSample.js][tableresourceslisttablessample] | Lists the Tables under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableList.json | +| [tableResourcesMigrateTableToAutoscaleSample.js][tableresourcesmigratetabletoautoscalesample] | Migrate an Azure Cosmos DB Table from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToAutoscale.json | +| [tableResourcesMigrateTableToManualThroughputSample.js][tableresourcesmigratetabletomanualthroughputsample] | Migrate an Azure Cosmos DB Table from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToManualThroughput.json | +| [tableResourcesRetrieveContinuousBackupInformationSample.js][tableresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableBackupInformation.json | +| [tableResourcesUpdateTableThroughputSample.js][tableresourcesupdatetablethroughputsample] | Update RUs per second of an Azure Cosmos DB Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputUpdate.json | +| [throughputPoolAccountCreateSample.js][throughputpoolaccountcreatesample] | Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json | +| [throughputPoolAccountDeleteSample.js][throughputpoolaccountdeletesample] | Removes an existing Azure Cosmos DB database account from a throughput pool. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json | +| [throughputPoolAccountGetSample.js][throughputpoolaccountgetsample] | Retrieves the properties of an existing Azure Cosmos DB Throughput Pool x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json | +| [throughputPoolAccountsListSample.js][throughputpoolaccountslistsample] | Lists all the Azure Cosmos DB accounts available under the subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json | +| [throughputPoolCreateOrUpdateSample.js][throughputpoolcreateorupdatesample] | Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json | +| [throughputPoolDeleteSample.js][throughputpooldeletesample] | Deletes an existing Azure Cosmos DB Throughput Pool. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json | +| [throughputPoolGetSample.js][throughputpoolgetsample] | Retrieves the properties of an existing Azure Cosmos DB Throughput Pool x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json | +| [throughputPoolUpdateSample.js][throughputpoolupdatesample] | Updates the properties of an existing Azure Cosmos DB Throughput Pool. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json | +| [throughputPoolsListByResourceGroupSample.js][throughputpoolslistbyresourcegroupsample] | List all the ThroughputPools in a given resource group. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json | +| [throughputPoolsListSample.js][throughputpoolslistsample] | Lists all the Azure Cosmos DB Throughput Pools available under the subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node cassandraClustersCreateUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx dev-tool run vendored cross-env COSMOSDB_SUBSCRIPTION_ID="" COSMOSDB_RESOURCE_GROUP="" node cassandraClustersCreateUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[cassandraclusterscreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersCreateUpdateSample.js +[cassandraclustersdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersDeallocateSample.js +[cassandraclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersDeleteSample.js +[cassandraclustersgetbackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetBackupSample.js +[cassandraclustersgetcommandasyncsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetCommandAsyncSample.js +[cassandraclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetSample.js +[cassandraclustersinvokecommandasyncsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersInvokeCommandAsyncSample.js +[cassandraclustersinvokecommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersInvokeCommandSample.js +[cassandraclusterslistbackupssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListBackupsSample.js +[cassandraclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListByResourceGroupSample.js +[cassandraclusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListBySubscriptionSample.js +[cassandraclusterslistcommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListCommandSample.js +[cassandraclustersstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersStartSample.js +[cassandraclustersstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersStatusSample.js +[cassandraclustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersUpdateSample.js +[cassandradatacenterscreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersCreateUpdateSample.js +[cassandradatacentersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersDeleteSample.js +[cassandradatacentersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersGetSample.js +[cassandradatacenterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersListSample.js +[cassandradatacentersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersUpdateSample.js +[cassandraresourcescreateupdatecassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraKeyspaceSample.js +[cassandraresourcescreateupdatecassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraTableSample.js +[cassandraresourcescreateupdatecassandraviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraViewSample.js +[cassandraresourcesdeletecassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraKeyspaceSample.js +[cassandraresourcesdeletecassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraTableSample.js +[cassandraresourcesdeletecassandraviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraViewSample.js +[cassandraresourcesgetcassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraKeyspaceSample.js +[cassandraresourcesgetcassandrakeyspacethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraKeyspaceThroughputSample.js +[cassandraresourcesgetcassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraTableSample.js +[cassandraresourcesgetcassandratablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraTableThroughputSample.js +[cassandraresourcesgetcassandraviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraViewSample.js +[cassandraresourcesgetcassandraviewthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraViewThroughputSample.js +[cassandraresourceslistcassandrakeyspacessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraKeyspacesSample.js +[cassandraresourceslistcassandratablessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraTablesSample.js +[cassandraresourceslistcassandraviewssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraViewsSample.js +[cassandraresourcesmigratecassandrakeyspacetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.js +[cassandraresourcesmigratecassandrakeyspacetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.js +[cassandraresourcesmigratecassandratabletoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraTableToAutoscaleSample.js +[cassandraresourcesmigratecassandratabletomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraTableToManualThroughputSample.js +[cassandraresourcesmigratecassandraviewtoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraViewToAutoscaleSample.js +[cassandraresourcesmigratecassandraviewtomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraViewToManualThroughputSample.js +[cassandraresourcesupdatecassandrakeyspacethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.js +[cassandraresourcesupdatecassandratablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraTableThroughputSample.js +[cassandraresourcesupdatecassandraviewthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraViewThroughputSample.js +[chaosfaultenabledisablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultEnableDisableSample.js +[chaosfaultgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultGetSample.js +[chaosfaultlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultListSample.js +[collectionlistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListMetricDefinitionsSample.js +[collectionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListMetricsSample.js +[collectionlistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListUsagesSample.js +[collectionpartitionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionListMetricsSample.js +[collectionpartitionlistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionListUsagesSample.js +[collectionpartitionregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionRegionListMetricsSample.js +[collectionregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionRegionListMetricsSample.js +[datatransferjobscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCancelSample.js +[datatransferjobscompletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCompleteSample.js +[datatransferjobscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCreateSample.js +[datatransferjobsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsGetSample.js +[datatransferjobslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsListByDatabaseAccountSample.js +[datatransferjobspausesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsPauseSample.js +[datatransferjobsresumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsResumeSample.js +[databaseaccountregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountRegionListMetricsSample.js +[databaseaccountschecknameexistssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsCheckNameExistsSample.js +[databaseaccountscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsCreateOrUpdateSample.js +[databaseaccountsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsDeleteSample.js +[databaseaccountsfailoverprioritychangesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsFailoverPriorityChangeSample.js +[databaseaccountsgetreadonlykeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsGetReadOnlyKeysSample.js +[databaseaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsGetSample.js +[databaseaccountslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListByResourceGroupSample.js +[databaseaccountslistconnectionstringssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListConnectionStringsSample.js +[databaseaccountslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListKeysSample.js +[databaseaccountslistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListMetricDefinitionsSample.js +[databaseaccountslistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListMetricsSample.js +[databaseaccountslistreadonlykeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListReadOnlyKeysSample.js +[databaseaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListSample.js +[databaseaccountslistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListUsagesSample.js +[databaseaccountsofflineregionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsOfflineRegionSample.js +[databaseaccountsonlineregionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsOnlineRegionSample.js +[databaseaccountsregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsRegenerateKeySample.js +[databaseaccountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsUpdateSample.js +[databaselistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListMetricDefinitionsSample.js +[databaselistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListMetricsSample.js +[databaselistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListUsagesSample.js +[graphresourcescreateupdategraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesCreateUpdateGraphSample.js +[graphresourcesdeletegraphresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesDeleteGraphResourceSample.js +[graphresourcesgetgraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesGetGraphSample.js +[graphresourceslistgraphssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesListGraphsSample.js +[gremlinresourcescreateupdategremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesCreateUpdateGremlinDatabaseSample.js +[gremlinresourcescreateupdategremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesCreateUpdateGremlinGraphSample.js +[gremlinresourcesdeletegremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesDeleteGremlinDatabaseSample.js +[gremlinresourcesdeletegremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesDeleteGremlinGraphSample.js +[gremlinresourcesgetgremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinDatabaseSample.js +[gremlinresourcesgetgremlindatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinDatabaseThroughputSample.js +[gremlinresourcesgetgremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinGraphSample.js +[gremlinresourcesgetgremlingraphthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinGraphThroughputSample.js +[gremlinresourceslistgremlindatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesListGremlinDatabasesSample.js +[gremlinresourceslistgremlingraphssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesListGremlinGraphsSample.js +[gremlinresourcesmigrategremlindatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.js +[gremlinresourcesmigrategremlindatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.js +[gremlinresourcesmigrategremlingraphtoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.js +[gremlinresourcesmigrategremlingraphtomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.js +[gremlinresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesRetrieveContinuousBackupInformationSample.js +[gremlinresourcesupdategremlindatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesUpdateGremlinDatabaseThroughputSample.js +[gremlinresourcesupdategremlingraphthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesUpdateGremlinGraphThroughputSample.js +[locationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/locationsGetSample.js +[locationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/locationsListSample.js +[mongodbresourcescreateupdatemongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoDbcollectionSample.js +[mongodbresourcescreateupdatemongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.js +[mongodbresourcescreateupdatemongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.js +[mongodbresourcescreateupdatemongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.js +[mongodbresourcesdeletemongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoDbcollectionSample.js +[mongodbresourcesdeletemongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoDbdatabaseSample.js +[mongodbresourcesdeletemongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoRoleDefinitionSample.js +[mongodbresourcesdeletemongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoUserDefinitionSample.js +[mongodbresourcesgetmongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbcollectionSample.js +[mongodbresourcesgetmongodbcollectionthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbcollectionThroughputSample.js +[mongodbresourcesgetmongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbdatabaseSample.js +[mongodbresourcesgetmongodbdatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbdatabaseThroughputSample.js +[mongodbresourcesgetmongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoRoleDefinitionSample.js +[mongodbresourcesgetmongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoUserDefinitionSample.js +[mongodbresourceslistmongodbcollectionpartitionmergesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbcollectionPartitionMergeSample.js +[mongodbresourceslistmongodbcollectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbcollectionsSample.js +[mongodbresourceslistmongodbdatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbdatabasesSample.js +[mongodbresourceslistmongoroledefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoRoleDefinitionsSample.js +[mongodbresourceslistmongouserdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoUserDefinitionsSample.js +[mongodbresourcesmigratemongodbcollectiontoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.js +[mongodbresourcesmigratemongodbcollectiontomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.js +[mongodbresourcesmigratemongodbdatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.js +[mongodbresourcesmigratemongodbdatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.js +[mongodbresourcesmongodbcontainerredistributethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.js +[mongodbresourcesmongodbcontainerretrievethroughputdistributionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.js +[mongodbresourcesmongodbdatabasepartitionmergesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabasePartitionMergeSample.js +[mongodbresourcesmongodbdatabaseredistributethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.js +[mongodbresourcesmongodbdatabaseretrievethroughputdistributionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.js +[mongodbresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesRetrieveContinuousBackupInformationSample.js +[mongodbresourcesupdatemongodbcollectionthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.js +[mongodbresourcesupdatemongodbdatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.js +[networksecurityperimeterconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsGetSample.js +[networksecurityperimeterconfigurationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsListSample.js +[networksecurityperimeterconfigurationsreconcilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsReconcileSample.js +[notebookworkspacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesCreateOrUpdateSample.js +[notebookworkspacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesDeleteSample.js +[notebookworkspacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesGetSample.js +[notebookworkspaceslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesListByDatabaseAccountSample.js +[notebookworkspaceslistconnectioninfosample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesListConnectionInfoSample.js +[notebookworkspacesregenerateauthtokensample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesRegenerateAuthTokenSample.js +[notebookworkspacesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesStartSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/operationsListSample.js +[partitionkeyrangeidlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/partitionKeyRangeIdListMetricsSample.js +[partitionkeyrangeidregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/partitionKeyRangeIdRegionListMetricsSample.js +[percentilelistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileListMetricsSample.js +[percentilesourcetargetlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileSourceTargetListMetricsSample.js +[percentiletargetlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileTargetListMetricsSample.js +[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsDeleteSample.js +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsGetSample.js +[privateendpointconnectionslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsListByDatabaseAccountSample.js +[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateLinkResourcesGetSample.js +[privatelinkresourceslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateLinkResourcesListByDatabaseAccountSample.js +[restorabledatabaseaccountsgetbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsGetByLocationSample.js +[restorabledatabaseaccountslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsListByLocationSample.js +[restorabledatabaseaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsListSample.js +[restorablegremlindatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinDatabasesListSample.js +[restorablegremlingraphslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinGraphsListSample.js +[restorablegremlinresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinResourcesListSample.js +[restorablemongodbcollectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbCollectionsListSample.js +[restorablemongodbdatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbDatabasesListSample.js +[restorablemongodbresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbResourcesListSample.js +[restorablesqlcontainerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlContainersListSample.js +[restorablesqldatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlDatabasesListSample.js +[restorablesqlresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlResourcesListSample.js +[restorabletableresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableTableResourcesListSample.js +[restorabletableslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableTablesListSample.js +[servicecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceCreateSample.js +[servicedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceDeleteSample.js +[servicegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceGetSample.js +[servicelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceListSample.js +[sqlresourcescreateupdateclientencryptionkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateClientEncryptionKeySample.js +[sqlresourcescreateupdatesqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlContainerSample.js +[sqlresourcescreateupdatesqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlDatabaseSample.js +[sqlresourcescreateupdatesqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlRoleAssignmentSample.js +[sqlresourcescreateupdatesqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlRoleDefinitionSample.js +[sqlresourcescreateupdatesqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlStoredProcedureSample.js +[sqlresourcescreateupdatesqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlTriggerSample.js +[sqlresourcescreateupdatesqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.js +[sqlresourcesdeletesqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlContainerSample.js +[sqlresourcesdeletesqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlDatabaseSample.js +[sqlresourcesdeletesqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlRoleAssignmentSample.js +[sqlresourcesdeletesqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlRoleDefinitionSample.js +[sqlresourcesdeletesqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlStoredProcedureSample.js +[sqlresourcesdeletesqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlTriggerSample.js +[sqlresourcesdeletesqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlUserDefinedFunctionSample.js +[sqlresourcesgetclientencryptionkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetClientEncryptionKeySample.js +[sqlresourcesgetsqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlContainerSample.js +[sqlresourcesgetsqlcontainerthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlContainerThroughputSample.js +[sqlresourcesgetsqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlDatabaseSample.js +[sqlresourcesgetsqldatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlDatabaseThroughputSample.js +[sqlresourcesgetsqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlRoleAssignmentSample.js +[sqlresourcesgetsqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlRoleDefinitionSample.js +[sqlresourcesgetsqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlStoredProcedureSample.js +[sqlresourcesgetsqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlTriggerSample.js +[sqlresourcesgetsqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlUserDefinedFunctionSample.js +[sqlresourceslistclientencryptionkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListClientEncryptionKeysSample.js +[sqlresourceslistsqlcontainerpartitionmergesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlContainerPartitionMergeSample.js +[sqlresourceslistsqlcontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlContainersSample.js +[sqlresourceslistsqldatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlDatabasesSample.js +[sqlresourceslistsqlroleassignmentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlRoleAssignmentsSample.js +[sqlresourceslistsqlroledefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlRoleDefinitionsSample.js +[sqlresourceslistsqlstoredproceduressample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlStoredProceduresSample.js +[sqlresourceslistsqltriggerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlTriggersSample.js +[sqlresourceslistsqluserdefinedfunctionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlUserDefinedFunctionsSample.js +[sqlresourcesmigratesqlcontainertoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlContainerToAutoscaleSample.js +[sqlresourcesmigratesqlcontainertomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlContainerToManualThroughputSample.js +[sqlresourcesmigratesqldatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.js +[sqlresourcesmigratesqldatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.js +[sqlresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesRetrieveContinuousBackupInformationSample.js +[sqlresourcessqlcontainerredistributethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlContainerRedistributeThroughputSample.js +[sqlresourcessqlcontainerretrievethroughputdistributionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlContainerRetrieveThroughputDistributionSample.js +[sqlresourcessqldatabasepartitionmergesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabasePartitionMergeSample.js +[sqlresourcessqldatabaseredistributethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabaseRedistributeThroughputSample.js +[sqlresourcessqldatabaseretrievethroughputdistributionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.js +[sqlresourcesupdatesqlcontainerthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesUpdateSqlContainerThroughputSample.js +[sqlresourcesupdatesqldatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesUpdateSqlDatabaseThroughputSample.js +[tableresourcescreateupdatetableroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableRoleAssignmentSample.js +[tableresourcescreateupdatetableroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableRoleDefinitionSample.js +[tableresourcescreateupdatetablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableSample.js +[tableresourcesdeletetableroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableRoleAssignmentSample.js +[tableresourcesdeletetableroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableRoleDefinitionSample.js +[tableresourcesdeletetablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableSample.js +[tableresourcesgettableroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableRoleAssignmentSample.js +[tableresourcesgettableroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableRoleDefinitionSample.js +[tableresourcesgettablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableSample.js +[tableresourcesgettablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableThroughputSample.js +[tableresourceslisttableroleassignmentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTableRoleAssignmentsSample.js +[tableresourceslisttableroledefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTableRoleDefinitionsSample.js +[tableresourceslisttablessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTablesSample.js +[tableresourcesmigratetabletoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesMigrateTableToAutoscaleSample.js +[tableresourcesmigratetabletomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesMigrateTableToManualThroughputSample.js +[tableresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesRetrieveContinuousBackupInformationSample.js +[tableresourcesupdatetablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesUpdateTableThroughputSample.js +[throughputpoolaccountcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountCreateSample.js +[throughputpoolaccountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountDeleteSample.js +[throughputpoolaccountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountGetSample.js +[throughputpoolaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountsListSample.js +[throughputpoolcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolCreateOrUpdateSample.js +[throughputpooldeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolDeleteSample.js +[throughputpoolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolGetSample.js +[throughputpoolupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolUpdateSample.js +[throughputpoolslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolsListByResourceGroupSample.js +[throughputpoolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolsListSample.js +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-cosmosdb?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/arm-cosmosdb/README.md diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersCreateUpdateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersCreateUpdateSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersCreateUpdateSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersCreateUpdateSample.js index b9fd3bf98cbe..6cbafba5e941 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersCreateUpdateSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersCreateUpdateSample.js @@ -10,17 +10,17 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. * * @summary Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterCreate.json */ async function cosmosDbManagedCassandraClusterCreate() { const subscriptionId = - process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; const body = { diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersDeallocateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersDeallocateSample.js similarity index 88% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersDeallocateSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersDeallocateSample.js index b7ada7bcf8ac..2361019c05d8 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersDeallocateSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersDeallocateSample.js @@ -10,17 +10,17 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. * * @summary Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDeallocate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json */ async function cosmosDbManagedCassandraClusterDeallocate() { const subscriptionId = - process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; const credential = new DefaultAzureCredential(); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersDeleteSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersDeleteSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersDeleteSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersDeleteSample.js index fdeb0a5f6047..586c04039edb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersDeleteSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersDeleteSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes a managed Cassandra cluster. * * @summary Deletes a managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDelete.json */ async function cosmosDbManagedCassandraClusterDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetBackupSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetBackupSample.js new file mode 100644 index 000000000000..aeecd2c2f81a --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetBackupSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Get the properties of an individual backup of this cluster that is available to restore. + * + * @summary Get the properties of an individual backup of this cluster that is available to restore. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackup.json + */ +async function cosmosDbManagedCassandraBackup() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const backupId = "1611250348"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraClusters.getBackup(resourceGroupName, clusterName, backupId); + console.log(result); +} + +async function main() { + cosmosDbManagedCassandraBackup(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetCommandAsyncSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetCommandAsyncSample.js new file mode 100644 index 000000000000..f6cc7b9e2b98 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetCommandAsyncSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Get details about a specified command that was run asynchronously. + * + * @summary Get details about a specified command that was run asynchronously. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandResult.json + */ +async function cosmosDbManagedCassandraCommandResult() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const commandId = "318653d0-3da5-4814-b8f6-429f2af0b2a4"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraClusters.getCommandAsync( + resourceGroupName, + clusterName, + commandId, + ); + console.log(result); +} + +async function main() { + cosmosDbManagedCassandraCommandResult(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersGetSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetSample.js index 3566f8c70cf6..bc372675e4a5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersGetSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersGetSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Get the properties of a managed Cassandra cluster. * * @summary Get the properties of a managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json */ async function cosmosDbManagedCassandraClusterGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersInvokeCommandAsyncSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersInvokeCommandAsyncSample.js new file mode 100644 index 000000000000..5bfd236a3d28 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersInvokeCommandAsyncSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Invoke a command like nodetool for cassandra maintenance asynchronously + * + * @summary Invoke a command like nodetool for cassandra maintenance asynchronously + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandAsync.json + */ +async function cosmosDbManagedCassandraCommandAsync() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const body = { + arguments: { status: "" }, + command: "nodetool", + host: "10.0.1.12", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraClusters.beginInvokeCommandAsyncAndWait( + resourceGroupName, + clusterName, + body, + ); + console.log(result); +} + +async function main() { + cosmosDbManagedCassandraCommandAsync(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersInvokeCommandSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersInvokeCommandSample.js similarity index 83% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersInvokeCommandSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersInvokeCommandSample.js index 30c74dfc0a81..94074755210f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersInvokeCommandSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersInvokeCommandSample.js @@ -10,21 +10,22 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Invoke a command like nodetool for cassandra maintenance * * @summary Invoke a command like nodetool for cassandra maintenance - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraCommand.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommand.json */ async function cosmosDbManagedCassandraCommand() { const subscriptionId = - process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; const body = { - command: "nodetool status", + arguments: { status: "" }, + command: "nodetool", host: "10.0.1.12", }; const credential = new DefaultAzureCredential(); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListBackupsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListBackupsSample.js new file mode 100644 index 000000000000..22d2c8081f5d --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListBackupsSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to List the backups of this cluster that are available to restore. + * + * @summary List the backups of this cluster that are available to restore. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackupsList.json + */ +async function cosmosDbManagedCassandraBackupsList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cassandraClusters.listBackups(resourceGroupName, clusterName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbManagedCassandraBackupsList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersListByResourceGroupSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListByResourceGroupSample.js similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersListByResourceGroupSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListByResourceGroupSample.js index 03be7bb3238c..23ed8c642f22 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersListByResourceGroupSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListByResourceGroupSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to List all managed Cassandra clusters in this resource group. * * @summary List all managed Cassandra clusters in this resource group. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json */ async function cosmosDbManagedCassandraClusterListByResourceGroup() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersListBySubscriptionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListBySubscriptionSample.js similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersListBySubscriptionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListBySubscriptionSample.js index 99fd406183cb..fed61defac12 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersListBySubscriptionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListBySubscriptionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to List all managed Cassandra clusters in this subscription. * * @summary List all managed Cassandra clusters in this subscription. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json */ async function cosmosDbManagedCassandraClusterListBySubscription() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListCommandSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListCommandSample.js new file mode 100644 index 000000000000..90f4a24f6199 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersListCommandSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to List all commands currently running on ring info + * + * @summary List all commands currently running on ring info + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraListCommand.json + */ +async function cosmosDbManagedCassandraListCommand() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cassandraClusters.listCommand(resourceGroupName, clusterName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbManagedCassandraListCommand(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersStartSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersStartSample.js similarity index 88% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersStartSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersStartSample.js index 8cee7e883ba3..89e4553c649d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersStartSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersStartSample.js @@ -10,17 +10,17 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. * * @summary Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterStart.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterStart.json */ async function cosmosDbManagedCassandraClusterStart() { const subscriptionId = - process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; const credential = new DefaultAzureCredential(); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersStatusSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersStatusSample.js similarity index 86% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersStatusSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersStatusSample.js index d423f93c98f0..c0d6a7231ec7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersStatusSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersStatusSample.js @@ -10,17 +10,17 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. * * @summary Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraStatus.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraStatus.json */ async function cosmosDbManagedCassandraStatus() { const subscriptionId = - process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; const credential = new DefaultAzureCredential(); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersUpdateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersUpdateSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersUpdateSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersUpdateSample.js index 3e832bee71f6..02ed12fcdd98 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersUpdateSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraClustersUpdateSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Updates some of the properties of a managed Cassandra cluster. * * @summary Updates some of the properties of a managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterPatch.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterPatch.json */ async function cosmosDbManagedCassandraClusterPatch() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersCreateUpdateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersCreateUpdateSample.js similarity index 94% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersCreateUpdateSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersCreateUpdateSample.js index 8c2cc790ffef..2705bc688d11 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersCreateUpdateSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersCreateUpdateSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. * * @summary Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json */ async function cosmosDbManagedCassandraDataCenterCreate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersDeleteSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersDeleteSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersDeleteSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersDeleteSample.js index 92ed4b1fddba..a29ba38b9e15 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersDeleteSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersDeleteSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Delete a managed Cassandra data center. * * @summary Delete a managed Cassandra data center. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json */ async function cosmosDbManagedCassandraDataCenterDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersGetSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersGetSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersGetSample.js index becaeb9348b8..7b0486f9aab5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersGetSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersGetSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Get the properties of a managed Cassandra data center. * * @summary Get the properties of a managed Cassandra data center. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json */ async function cosmosDbManagedCassandraDataCenterGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersListSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersListSample.js index eadfb139da3c..9a53a7cd5f7e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to List all data centers in a particular managed Cassandra cluster. * * @summary List all data centers in a particular managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterList.json */ async function cosmosDbManagedCassandraDataCenterList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersUpdateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersUpdateSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersUpdateSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersUpdateSample.js index 14a98fdf2a5d..a5b72e52281a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersUpdateSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraDataCentersUpdateSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Update some of the properties of a managed Cassandra data center. * * @summary Update some of the properties of a managed Cassandra data center. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterPatch.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json */ async function cosmosDbManagedCassandraDataCenterUpdate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesCreateUpdateCassandraKeyspaceSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraKeyspaceSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesCreateUpdateCassandraKeyspaceSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraKeyspaceSample.js index 75c872a1fd63..f5602c677470 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesCreateUpdateCassandraKeyspaceSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraKeyspaceSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update an Azure Cosmos DB Cassandra keyspace * * @summary Create or update an Azure Cosmos DB Cassandra keyspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json */ async function cosmosDbCassandraKeyspaceCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesCreateUpdateCassandraTableSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraTableSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesCreateUpdateCassandraTableSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraTableSample.js index 7572b969c298..01e8c44a81b1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesCreateUpdateCassandraTableSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraTableSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update an Azure Cosmos DB Cassandra Table * * @summary Create or update an Azure Cosmos DB Cassandra Table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json */ async function cosmosDbCassandraTableCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -33,6 +33,7 @@ async function cosmosDbCassandraTableCreateUpdate() { columns: [{ name: "columnA", type: "Ascii" }], partitionKeys: [{ name: "columnA" }], }, + analyticalStorageTtl: 500, defaultTtl: 100, id: "tableName", }, diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraViewSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraViewSample.js new file mode 100644 index 000000000000..6dca97ad3950 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesCreateUpdateCassandraViewSample.js @@ -0,0 +1,52 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB Cassandra View + * + * @summary Create or update an Azure Cosmos DB Cassandra View + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json + */ +async function cosmosDbCassandraViewCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const createUpdateCassandraViewParameters = { + options: {}, + resource: { + id: "viewname", + viewDefinition: + "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)", + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraResources.beginCreateUpdateCassandraViewAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + createUpdateCassandraViewParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesDeleteCassandraKeyspaceSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraKeyspaceSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesDeleteCassandraKeyspaceSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraKeyspaceSample.js index 6f047987ac1e..7746cb2ecca8 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesDeleteCassandraKeyspaceSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraKeyspaceSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @summary Deletes an existing Azure Cosmos DB Cassandra keyspace. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceDelete.json */ async function cosmosDbCassandraKeyspaceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesDeleteCassandraTableSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraTableSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesDeleteCassandraTableSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraTableSample.js index 90e0557713e9..6effd6ebdce1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesDeleteCassandraTableSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraTableSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Cassandra table. * * @summary Deletes an existing Azure Cosmos DB Cassandra table. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableDelete.json */ async function cosmosDbCassandraTableDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraViewSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraViewSample.js new file mode 100644 index 000000000000..0b8358701b9a --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesDeleteCassandraViewSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Cassandra view. + * + * @summary Deletes an existing Azure Cosmos DB Cassandra view. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewDelete.json + */ +async function cosmosDbCassandraViewDelete() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraResources.beginDeleteCassandraViewAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraKeyspaceSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraKeyspaceSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraKeyspaceSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraKeyspaceSample.js index 98e2fc5c2414..c1a87bcd7d80 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraKeyspaceSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraKeyspaceSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json */ async function cosmosDbCassandraKeyspaceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraKeyspaceThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraKeyspaceThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraKeyspaceThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraKeyspaceThroughputSample.js index b4c8bc3fb92f..4603bd2481d3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraKeyspaceThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraKeyspaceThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json */ async function cosmosDbCassandraKeyspaceThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraTableSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraTableSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraTableSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraTableSample.js index 09b1283dbf61..e164bff1374e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraTableSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraTableSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the Cassandra table under an existing Azure Cosmos DB database account. * * @summary Gets the Cassandra table under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json */ async function cosmosDbCassandraTableGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraTableThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraTableThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraTableThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraTableThroughputSample.js index dc70546f10bf..05eecb07404e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraTableThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraTableThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputGet.json */ async function cosmosDbCassandraTableThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraViewSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraViewSample.js new file mode 100644 index 000000000000..6cc1c04cf897 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraViewSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Gets the Cassandra view under an existing Azure Cosmos DB database account. + * + * @summary Gets the Cassandra view under an existing Azure Cosmos DB database account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewGet.json + */ +async function cosmosDbCassandraViewGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraResources.getCassandraView( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraViewThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraViewThroughputSample.js new file mode 100644 index 000000000000..c4159ec8453c --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesGetCassandraViewThroughputSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. + * + * @summary Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputGet.json + */ +async function cosmosDbCassandraViewThroughputGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraResources.getCassandraViewThroughput( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewThroughputGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesListCassandraKeyspacesSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraKeyspacesSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesListCassandraKeyspacesSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraKeyspacesSample.js index 2a3b276b60d4..4eb40b44a809 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesListCassandraKeyspacesSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraKeyspacesSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. * * @summary Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceList.json */ async function cosmosDbCassandraKeyspaceList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesListCassandraTablesSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraTablesSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesListCassandraTablesSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraTablesSample.js index 56032010ba7e..9d9187d69543 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesListCassandraTablesSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraTablesSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the Cassandra table under an existing Azure Cosmos DB database account. * * @summary Lists the Cassandra table under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableList.json */ async function cosmosDbCassandraTableList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraViewsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraViewsSample.js new file mode 100644 index 000000000000..227caab0fd93 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesListCassandraViewsSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * + * @summary Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewList.json + */ +async function cosmosDbCassandraViewList() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cassandraResources.listCassandraViews( + resourceGroupName, + accountName, + keyspaceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbCassandraViewList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.js index 188d47c3e3f6..fe1547b16d8d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json */ async function cosmosDbCassandraKeyspaceMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.js index a90830bb40bc..73731dd98b5b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json */ async function cosmosDbCassandraKeyspaceMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraTableToAutoscaleSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraTableToAutoscaleSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraTableToAutoscaleSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraTableToAutoscaleSample.js index 8cf37c1ccbd0..23f2b37aecbf 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraTableToAutoscaleSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraTableToAutoscaleSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json */ async function cosmosDbCassandraTableMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraTableToManualThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraTableToManualThroughputSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraTableToManualThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraTableToManualThroughputSample.js index 2fb2d22f9345..084a6da18313 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraTableToManualThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraTableToManualThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json */ async function cosmosDbCassandraTableMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraViewToAutoscaleSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraViewToAutoscaleSample.js new file mode 100644 index 000000000000..f6685caa48da --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraViewToAutoscaleSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale + * + * @summary Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json + */ +async function cosmosDbCassandraViewMigrateToAutoscale() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraResources.beginMigrateCassandraViewToAutoscaleAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewMigrateToAutoscale(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraViewToManualThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraViewToManualThroughputSample.js new file mode 100644 index 000000000000..133b04fab9a5 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesMigrateCassandraViewToManualThroughputSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput + * + * @summary Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json + */ +async function cosmosDbCassandraViewMigrateToManualThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraResources.beginMigrateCassandraViewToManualThroughputAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewMigrateToManualThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.js index 4df94f50fe18..5ba9f3e5ce1a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Cassandra Keyspace * * @summary Update RUs per second of an Azure Cosmos DB Cassandra Keyspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json */ async function cosmosDbCassandraKeyspaceThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesUpdateCassandraTableThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraTableThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesUpdateCassandraTableThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraTableThroughputSample.js index ddc84da0b7bd..dfa669e4c491 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesUpdateCassandraTableThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraTableThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Cassandra table * * @summary Update RUs per second of an Azure Cosmos DB Cassandra table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputUpdate.json */ async function cosmosDbCassandraTableThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraViewThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraViewThroughputSample.js new file mode 100644 index 000000000000..a3d6b822e84a --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/cassandraResourcesUpdateCassandraViewThroughputSample.js @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Cassandra view + * + * @summary Update RUs per second of an Azure Cosmos DB Cassandra view + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputUpdate.json + */ +async function cosmosDbCassandraViewThroughputUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const updateThroughputParameters = { + resource: { throughput: 400 }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraResources.beginUpdateCassandraViewThroughputAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + updateThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewThroughputUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultEnableDisableSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultEnableDisableSample.js new file mode 100644 index 000000000000..af3e49a33865 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultEnableDisableSample.js @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Enable, disable Chaos Fault in a CosmosDB account. + * + * @summary Enable, disable Chaos Fault in a CosmosDB account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultEnableDisable.json + */ +async function chaosFaultEnableDisable() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const chaosFault = "ServiceUnavailability"; + const chaosFaultRequest = { + action: "Enable", + containerName: "testCollection", + databaseName: "testDatabase", + region: "EastUS", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.chaosFault.beginEnableDisableAndWait( + resourceGroupName, + accountName, + chaosFault, + chaosFaultRequest, + ); + console.log(result); +} + +async function main() { + chaosFaultEnableDisable(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultGetSample.js new file mode 100644 index 000000000000..36925c68c9ee --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @summary Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultGet.json + */ +async function chaosFaultGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const chaosFault = "ServiceUnavailability"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.chaosFault.get(resourceGroupName, accountName, chaosFault); + console.log(result); +} + +async function main() { + chaosFaultGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultListSample.js new file mode 100644 index 000000000000..81e4afda8247 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/chaosFaultListSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to List Chaos Faults for CosmosDB account. + * + * @summary List Chaos Faults for CosmosDB account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultList.json + */ +async function chaosFaultList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.chaosFault.list(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + chaosFaultList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListMetricDefinitionsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListMetricDefinitionsSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListMetricDefinitionsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListMetricDefinitionsSample.js index 4c7ac855a649..73aeeb568158 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListMetricDefinitionsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListMetricDefinitionsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves metric definitions for the given collection. * * @summary Retrieves metric definitions for the given collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetricDefinitions.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetricDefinitions.json */ async function cosmosDbCollectionGetMetricDefinitions() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListMetricsSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListMetricsSample.js index bc2c1612c4f0..8714948cd16a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account and collection. * * @summary Retrieves the metrics determined by the given filter for the given database account and collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetrics.json */ async function cosmosDbCollectionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListUsagesSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListUsagesSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListUsagesSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListUsagesSample.js index 57ac3cd4bfe9..a82f6bee6885 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListUsagesSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionListUsagesSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the usages (most recent storage data) for the given collection. * * @summary Retrieves the usages (most recent storage data) for the given collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetUsages.json */ async function cosmosDbCollectionGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionListMetricsSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionListMetricsSample.js index 4dcb270f8b6c..7b0c993581fc 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given collection, split by partition. * * @summary Retrieves the metrics determined by the given filter for the given collection, split by partition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionListUsagesSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionListUsagesSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionListUsagesSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionListUsagesSample.js index a4d77dd966fa..1558088c4d49 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionListUsagesSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionListUsagesSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the usages (most recent storage data) for the given collection, split by partition. * * @summary Retrieves the usages (most recent storage data) for the given collection, split by partition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetUsages.json */ async function cosmosDbCollectionGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionRegionListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionRegionListMetricsSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionRegionListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionRegionListMetricsSample.js index 935206c99c42..684f273b1a69 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionRegionListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionPartitionRegionListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given collection and region, split by partition. * * @summary Retrieves the metrics determined by the given filter for the given collection and region, split by partition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionRegionListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionRegionListMetricsSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionRegionListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionRegionListMetricsSample.js index c1f64fb6f1c2..a636f928c4d1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionRegionListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/collectionRegionListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account, collection and region. * * @summary Retrieves the metrics determined by the given filter for the given database account, collection and region. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRegionCollectionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRegionCollectionGetMetrics.json */ async function cosmosDbRegionCollectionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCancelSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCancelSample.js new file mode 100644 index 000000000000..20128e8a854d --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCancelSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Cancels a Data Transfer Job. + * + * @summary Cancels a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json + */ +async function cosmosDbDataTransferJobCancel() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.cancel(resourceGroupName, accountName, jobName); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobCancel(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCompleteSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCompleteSample.js new file mode 100644 index 000000000000..efbb3ea56d91 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCompleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Completes a Data Transfer Online Job. + * + * @summary Completes a Data Transfer Online Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json + */ +async function cosmosDbDataTransferJobComplete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "e35cc6eb-c8e3-447b-8de6-b83328cd0098"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.complete(resourceGroupName, accountName, jobName); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobComplete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCreateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCreateSample.js new file mode 100644 index 000000000000..f259d7471591 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsCreateSample.js @@ -0,0 +1,55 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Creates a Data Transfer Job. + * + * @summary Creates a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json + */ +async function cosmosDbDataTransferJobCreate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const jobCreateParameters = { + properties: { + destination: { + component: "AzureBlobStorage", + containerName: "blob_container", + endpointUrl: "https://blob.windows.net", + }, + source: { + component: "CosmosDBCassandra", + keyspaceName: "keyspace", + tableName: "table", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.create( + resourceGroupName, + accountName, + jobName, + jobCreateParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobCreate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsGetSample.js new file mode 100644 index 000000000000..da3e92ee839c --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsGetSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Get a Data Transfer Job. + * + * @summary Get a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json + */ +async function cosmosDbDataTransferJobGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.get(resourceGroupName, accountName, jobName); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsListByDatabaseAccountSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsListByDatabaseAccountSample.js new file mode 100644 index 000000000000..cc8ae47a8c76 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsListByDatabaseAccountSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Get a list of Data Transfer jobs. + * + * @summary Get a list of Data Transfer jobs. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json + */ +async function cosmosDbDataTransferJobFeed() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dataTransferJobs.listByDatabaseAccount( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbDataTransferJobFeed(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsPauseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsPauseSample.js new file mode 100644 index 000000000000..b8ec2ad887c3 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsPauseSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Pause a Data Transfer Job. + * + * @summary Pause a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json + */ +async function cosmosDbDataTransferJobPause() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.pause(resourceGroupName, accountName, jobName); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobPause(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsResumeSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsResumeSample.js new file mode 100644 index 000000000000..1a482c71f5be --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/dataTransferJobsResumeSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Resumes a Data Transfer Job. + * + * @summary Resumes a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json + */ +async function cosmosDbDataTransferJobResume() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.resume(resourceGroupName, accountName, jobName); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobResume(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountRegionListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountRegionListMetricsSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountRegionListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountRegionListMetricsSample.js index dddb22d2e741..42ea940bf34d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountRegionListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountRegionListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account and region. * * @summary Retrieves the metrics determined by the given filter for the given database account and region. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsCheckNameExistsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsCheckNameExistsSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsCheckNameExistsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsCheckNameExistsSample.js index a67689832f97..36f30ab019c9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsCheckNameExistsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsCheckNameExistsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. * * @summary Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCheckNameExists.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json */ async function cosmosDbDatabaseAccountCheckNameExists() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsCreateOrUpdateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsCreateOrUpdateSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsCreateOrUpdateSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsCreateOrUpdateSample.js index 51cfc4b060ec..958a10cd2dbb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsCreateOrUpdateSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsCreateOrUpdateSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @summary Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMax.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json */ async function cosmosDbDatabaseAccountCreateMax() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -34,6 +34,7 @@ async function cosmosDbDatabaseAccountCreateMax() { }, }, capacity: { totalThroughputLimit: 2000 }, + capacityMode: "Provisioned", consistencyPolicy: { defaultConsistencyLevel: "BoundedStaleness", maxIntervalInSeconds: 10, @@ -43,10 +44,13 @@ async function cosmosDbDatabaseAccountCreateMax() { createMode: "Default", databaseAccountOfferType: "Standard", defaultIdentity: "FirstPartyIdentity", + defaultPriorityLevel: "Low", enableAnalyticalStorage: true, enableBurstCapacity: true, enableFreeTier: false, + enableMaterializedViews: false, enablePerRegionPerPartitionAutoscale: true, + enablePriorityBasedExecution: true, identity: { type: "SystemAssigned,UserAssigned", userAssignedIdentities: { @@ -95,7 +99,7 @@ async function cosmosDbDatabaseAccountCreateMax() { * This sample demonstrates how to Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @summary Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMin.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMin.json */ async function cosmosDbDatabaseAccountCreateMin() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -127,7 +131,7 @@ async function cosmosDbDatabaseAccountCreateMin() { * This sample demonstrates how to Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @summary Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json */ async function cosmosDbRestoreDatabaseAccountCreateUpdateJson() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -148,6 +152,7 @@ async function cosmosDbRestoreDatabaseAccountCreateUpdateJson() { databaseAccountOfferType: "Standard", enableAnalyticalStorage: true, enableFreeTier: false, + enableMaterializedViews: false, keyVaultKeyUri: "https://myKeyVault.vault.azure.net", kind: "GlobalDocumentDB", location: "westus", @@ -175,6 +180,7 @@ async function cosmosDbRestoreDatabaseAccountCreateUpdateJson() { "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc", restoreTimestampInUtc: new Date("2021-03-11T22:05:09Z"), restoreWithTtlDisabled: false, + sourceBackupLocation: "westus", }, tags: {}, }; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsDeleteSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsDeleteSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsDeleteSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsDeleteSample.js index 5eec7aaca868..60f058c3817f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsDeleteSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsDeleteSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB database account. * * @summary Deletes an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountDelete.json */ async function cosmosDbDatabaseAccountDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsFailoverPriorityChangeSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsFailoverPriorityChangeSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsFailoverPriorityChangeSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsFailoverPriorityChangeSample.js index e03b58f1a047..97c8a6bcc513 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsFailoverPriorityChangeSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsFailoverPriorityChangeSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * * @summary Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json */ async function cosmosDbDatabaseAccountFailoverPriorityChange() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsGetReadOnlyKeysSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsGetReadOnlyKeysSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsGetReadOnlyKeysSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsGetReadOnlyKeysSample.js index 7ed19166ab2f..a0bf63364b18 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsGetReadOnlyKeysSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsGetReadOnlyKeysSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @summary Lists the read-only access keys for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json */ async function cosmosDbDatabaseAccountListReadOnlyKeys() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsGetSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsGetSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsGetSample.js index bc52be9e90cd..13321e50bfda 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsGetSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsGetSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB database account. * * @summary Retrieves the properties of an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json */ async function cosmosDbDatabaseAccountGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListByResourceGroupSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListByResourceGroupSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListByResourceGroupSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListByResourceGroupSample.js index 6604863eba9f..c01e7e93f3ea 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListByResourceGroupSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListByResourceGroupSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @summary Lists all the Azure Cosmos DB database accounts available under the given resource group. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json */ async function cosmosDbDatabaseAccountListByResourceGroup() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListConnectionStringsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListConnectionStringsSample.js similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListConnectionStringsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListConnectionStringsSample.js index 486628d9f778..57032fbb6d70 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListConnectionStringsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListConnectionStringsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the connection strings for the specified Azure Cosmos DB database account. * * @summary Lists the connection strings for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json */ async function cosmosDbDatabaseAccountListConnectionStrings() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -35,7 +35,7 @@ async function cosmosDbDatabaseAccountListConnectionStrings() { * This sample demonstrates how to Lists the connection strings for the specified Azure Cosmos DB database account. * * @summary Lists the connection strings for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json */ async function cosmosDbDatabaseAccountListConnectionStringsMongo() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListKeysSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListKeysSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListKeysSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListKeysSample.js index 9eba471449e5..55a505301cf6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListKeysSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListKeysSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the access keys for the specified Azure Cosmos DB database account. * * @summary Lists the access keys for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListKeys.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListKeys.json */ async function cosmosDbDatabaseAccountListKeys() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListMetricDefinitionsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListMetricDefinitionsSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListMetricDefinitionsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListMetricDefinitionsSample.js index 3a8933cc23d6..56201d655130 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListMetricDefinitionsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListMetricDefinitionsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves metric definitions for the given database account. * * @summary Retrieves metric definitions for the given database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json */ async function cosmosDbDatabaseAccountGetMetricDefinitions() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListMetricsSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListMetricsSample.js index ed94f5fddfd4..7eb52e6ad474 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account. * * @summary Retrieves the metrics determined by the given filter for the given database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetrics.json */ async function cosmosDbDatabaseAccountGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListReadOnlyKeysSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListReadOnlyKeysSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListReadOnlyKeysSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListReadOnlyKeysSample.js index 0a07d7188641..05a73820466f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListReadOnlyKeysSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListReadOnlyKeysSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @summary Lists the read-only access keys for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json */ async function cosmosDbDatabaseAccountListReadOnlyKeys() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListSample.js index 3d35a656a638..60c69f7bc282 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists all the Azure Cosmos DB database accounts available under the subscription. * * @summary Lists all the Azure Cosmos DB database accounts available under the subscription. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountList.json */ async function cosmosDbDatabaseAccountList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListUsagesSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListUsagesSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListUsagesSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListUsagesSample.js index ce296c465d90..256f4231ac7c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListUsagesSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsListUsagesSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the usages (most recent data) for the given database account. * * @summary Retrieves the usages (most recent data) for the given database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetUsages.json */ async function cosmosDbDatabaseAccountGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsOfflineRegionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsOfflineRegionSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsOfflineRegionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsOfflineRegionSample.js index c3542abbe5e7..72b8d7039845 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsOfflineRegionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsOfflineRegionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Offline the specified region for the specified Azure Cosmos DB database account. * * @summary Offline the specified region for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOfflineRegion.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json */ async function cosmosDbDatabaseAccountOfflineRegion() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsOnlineRegionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsOnlineRegionSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsOnlineRegionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsOnlineRegionSample.js index 2c5565f9d774..5bd874f7512d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsOnlineRegionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsOnlineRegionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Online the specified region for the specified Azure Cosmos DB database account. * * @summary Online the specified region for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOnlineRegion.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json */ async function cosmosDbDatabaseAccountOnlineRegion() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsRegenerateKeySample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsRegenerateKeySample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsRegenerateKeySample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsRegenerateKeySample.js index ad241fc09daa..836004bec25f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsRegenerateKeySample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsRegenerateKeySample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Regenerates an access key for the specified Azure Cosmos DB database account. * * @summary Regenerates an access key for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegenerateKey.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json */ async function cosmosDbDatabaseAccountRegenerateKey() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsUpdateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsUpdateSample.js similarity index 89% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsUpdateSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsUpdateSample.js index 0a00976fa205..8f893d206049 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsUpdateSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseAccountsUpdateSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Updates the properties of an existing Azure Cosmos DB database account. * * @summary Updates the properties of an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountPatch.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountPatch.json */ async function cosmosDbDatabaseAccountPatch() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -29,21 +29,25 @@ async function cosmosDbDatabaseAccountPatch() { periodicModeProperties: { backupIntervalInMinutes: 240, backupRetentionIntervalInHours: 720, - backupStorageRedundancy: "Local", + backupStorageRedundancy: "Geo", }, }, capacity: { totalThroughputLimit: 2000 }, + capacityMode: "Provisioned", consistencyPolicy: { defaultConsistencyLevel: "BoundedStaleness", maxIntervalInSeconds: 10, maxStalenessPrefix: 200, }, defaultIdentity: "FirstPartyIdentity", + defaultPriorityLevel: "Low", + diagnosticLogSettings: { enableFullTextQuery: "True" }, enableAnalyticalStorage: true, enableBurstCapacity: true, enableFreeTier: false, enablePartitionMerge: true, enablePerRegionPerPartitionAutoscale: true, + enablePriorityBasedExecution: true, identity: { type: "SystemAssigned,UserAssigned", userAssignedIdentities: { diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListMetricDefinitionsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListMetricDefinitionsSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListMetricDefinitionsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListMetricDefinitionsSample.js index b1afc78064f6..0b497d2a9f1b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListMetricDefinitionsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListMetricDefinitionsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves metric definitions for the given database. * * @summary Retrieves metric definitions for the given database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetricDefinitions.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json */ async function cosmosDbDatabaseGetMetricDefinitions() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListMetricsSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListMetricsSample.js index 3f43a4147c5e..bb3b0cefa93b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account and database. * * @summary Retrieves the metrics determined by the given filter for the given database account and database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetrics.json */ async function cosmosDbDatabaseGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListUsagesSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListUsagesSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListUsagesSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListUsagesSample.js index 14fc2168d90f..ecb4d6c2b088 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListUsagesSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/databaseListUsagesSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the usages (most recent data) for the given database. * * @summary Retrieves the usages (most recent data) for the given database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetUsages.json */ async function cosmosDbDatabaseGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlDatabaseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesCreateUpdateGraphSample.js similarity index 66% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlDatabaseSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesCreateUpdateGraphSample.js index 8669e8137620..95d37d93ef28 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlDatabaseSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesCreateUpdateGraphSample.js @@ -10,38 +10,38 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** - * This sample demonstrates how to Create or update an Azure Cosmos DB SQL database + * This sample demonstrates how to Create or update an Azure Cosmos DB Graph. * - * @summary Create or update an Azure Cosmos DB SQL database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseCreateUpdate.json + * @summary Create or update an Azure Cosmos DB Graph. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json */ -async function cosmosDbSqlDatabaseCreateUpdate() { +async function cosmosDbGraphCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; const accountName = "ddb1"; - const databaseName = "databaseName"; - const createUpdateSqlDatabaseParameters = { + const graphName = "graphName"; + const createUpdateGraphParameters = { location: "West US", options: {}, - resource: { id: "databaseName" }, + resource: { id: "graphName" }, tags: {}, }; const credential = new DefaultAzureCredential(); const client = new CosmosDBManagementClient(credential, subscriptionId); - const result = await client.sqlResources.beginCreateUpdateSqlDatabaseAndWait( + const result = await client.graphResources.beginCreateUpdateGraphAndWait( resourceGroupName, accountName, - databaseName, - createUpdateSqlDatabaseParameters, + graphName, + createUpdateGraphParameters, ); console.log(result); } async function main() { - cosmosDbSqlDatabaseCreateUpdate(); + cosmosDbGraphCreateUpdate(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesDeleteGraphResourceSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesDeleteGraphResourceSample.js new file mode 100644 index 000000000000..bbbee1260e4d --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesDeleteGraphResourceSample.js @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Graph Resource. + * + * @summary Deletes an existing Azure Cosmos DB Graph Resource. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceDelete.json + */ +async function cosmosDbSqlDatabaseDelete() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const graphName = "graphName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.graphResources.beginDeleteGraphResourceAndWait( + resourceGroupName, + accountName, + graphName, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesGetGraphSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesGetGraphSample.js new file mode 100644 index 000000000000..f46cc313de1d --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesGetGraphSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @summary Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceGet.json + */ +async function cosmosDbSqlDatabaseGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const graphName = "graphName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.graphResources.getGraph(resourceGroupName, accountName, graphName); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesListGraphsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesListGraphsSample.js new file mode 100644 index 000000000000..6bcd5abffba9 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/graphResourcesListGraphsSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Lists the graphs under an existing Azure Cosmos DB database account. + * + * @summary Lists the graphs under an existing Azure Cosmos DB database account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceList.json + */ +async function cosmosDbSqlDatabaseList() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.graphResources.listGraphs(resourceGroupName, accountName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbSqlDatabaseList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesCreateUpdateGremlinDatabaseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesCreateUpdateGremlinDatabaseSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesCreateUpdateGremlinDatabaseSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesCreateUpdateGremlinDatabaseSample.js index f108fd6366a5..d5565d88ba79 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesCreateUpdateGremlinDatabaseSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesCreateUpdateGremlinDatabaseSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update an Azure Cosmos DB Gremlin database * * @summary Create or update an Azure Cosmos DB Gremlin database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json */ async function cosmosDbGremlinDatabaseCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesCreateUpdateGremlinGraphSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesCreateUpdateGremlinGraphSample.js similarity index 94% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesCreateUpdateGremlinGraphSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesCreateUpdateGremlinGraphSample.js index 18076e859b7d..cfe7bf6aafef 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesCreateUpdateGremlinGraphSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesCreateUpdateGremlinGraphSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update an Azure Cosmos DB Gremlin graph * * @summary Create or update an Azure Cosmos DB Gremlin graph - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json */ async function cosmosDbGremlinGraphCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesDeleteGremlinDatabaseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesDeleteGremlinDatabaseSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesDeleteGremlinDatabaseSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesDeleteGremlinDatabaseSample.js index f55b844e37cd..26a5ee087a9f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesDeleteGremlinDatabaseSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesDeleteGremlinDatabaseSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Gremlin database. * * @summary Deletes an existing Azure Cosmos DB Gremlin database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseDelete.json */ async function cosmosDbGremlinDatabaseDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesDeleteGremlinGraphSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesDeleteGremlinGraphSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesDeleteGremlinGraphSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesDeleteGremlinGraphSample.js index 7e70a4586b00..a0a4a9a1f0fa 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesDeleteGremlinGraphSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesDeleteGremlinGraphSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Gremlin graph. * * @summary Deletes an existing Azure Cosmos DB Gremlin graph. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphDelete.json */ async function cosmosDbGremlinGraphDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinDatabaseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinDatabaseSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinDatabaseSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinDatabaseSample.js index 7c74817f39b9..b106070b3924 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinDatabaseSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinDatabaseSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json */ async function cosmosDbGremlinDatabaseGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinDatabaseThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinDatabaseThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinDatabaseThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinDatabaseThroughputSample.js index 18a1ad773fcd..e07be0ffeee6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinDatabaseThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinDatabaseThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json */ async function cosmosDbGremlinDatabaseThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinGraphSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinGraphSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinGraphSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinGraphSample.js index 3349f7dbb8c8..5e0a78080e03 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinGraphSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinGraphSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the Gremlin graph under an existing Azure Cosmos DB database account. * * @summary Gets the Gremlin graph under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json */ async function cosmosDbGremlinGraphGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinGraphThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinGraphThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinGraphThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinGraphThroughputSample.js index 86a75584baf7..7c0d94263388 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinGraphThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesGetGremlinGraphThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputGet.json */ async function cosmosDbGremlinGraphThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesListGremlinDatabasesSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesListGremlinDatabasesSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesListGremlinDatabasesSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesListGremlinDatabasesSample.js index 9264558c56b7..c179708b1198 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesListGremlinDatabasesSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesListGremlinDatabasesSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the Gremlin databases under an existing Azure Cosmos DB database account. * * @summary Lists the Gremlin databases under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseList.json */ async function cosmosDbGremlinDatabaseList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesListGremlinGraphsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesListGremlinGraphsSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesListGremlinGraphsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesListGremlinGraphsSample.js index 7f1c5ab7f880..562ae12e8909 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesListGremlinGraphsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesListGremlinGraphsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the Gremlin graph under an existing Azure Cosmos DB database account. * * @summary Lists the Gremlin graph under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphList.json */ async function cosmosDbGremlinGraphList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.js index 7219ffe3fc9f..8397cc4b18f6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json */ async function cosmosDbGremlinDatabaseMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.js index 316330a34e53..045ad59d0c2a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json */ async function cosmosDbGremlinDatabaseMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.js index d0e478238f72..5efdb3a74ea4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json */ async function cosmosDbGremlinGraphMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.js index 539c09c4ef4a..c48bf94d9c27 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json */ async function cosmosDbGremlinGraphMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesRetrieveContinuousBackupInformationSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesRetrieveContinuousBackupInformationSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesRetrieveContinuousBackupInformationSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesRetrieveContinuousBackupInformationSample.js index db0a3108b677..0b523a3dc24b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesRetrieveContinuousBackupInformationSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesRetrieveContinuousBackupInformationSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves continuous backup information for a gremlin graph. * * @summary Retrieves continuous backup information for a gremlin graph. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphBackupInformation.json */ async function cosmosDbGremlinGraphBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesUpdateGremlinDatabaseThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesUpdateGremlinDatabaseThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesUpdateGremlinDatabaseThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesUpdateGremlinDatabaseThroughputSample.js index a71d570d0341..ab8795eed207 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesUpdateGremlinDatabaseThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesUpdateGremlinDatabaseThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Gremlin database * * @summary Update RUs per second of an Azure Cosmos DB Gremlin database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json */ async function cosmosDbGremlinDatabaseThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesUpdateGremlinGraphThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesUpdateGremlinGraphThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesUpdateGremlinGraphThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesUpdateGremlinGraphThroughputSample.js index 2555ace08cf6..ab1d95054cd6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesUpdateGremlinGraphThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/gremlinResourcesUpdateGremlinGraphThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Gremlin graph * * @summary Update RUs per second of an Azure Cosmos DB Gremlin graph - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json */ async function cosmosDbGremlinGraphThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/locationsGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/locationsGetSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/locationsGetSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/locationsGetSample.js index 590eb249205e..c51ba01f03d8 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/locationsGetSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/locationsGetSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Get the properties of an existing Cosmos DB location * * @summary Get the properties of an existing Cosmos DB location - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json */ async function cosmosDbLocationGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/locationsListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/locationsListSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/locationsListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/locationsListSample.js index 471d4b9efee6..a0840725df04 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/locationsListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/locationsListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to List Cosmos DB locations and their properties * * @summary List Cosmos DB locations and their properties - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationList.json */ async function cosmosDbLocationList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoDbcollectionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoDbcollectionSample.js new file mode 100644 index 000000000000..11a745354d7e --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoDbcollectionSample.js @@ -0,0 +1,100 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB MongoDB Collection + * + * @summary Create or update an Azure Cosmos DB MongoDB Collection + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json + */ +async function cosmosDbMongoDbcollectionCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const collectionName = "collectionName"; + const createUpdateMongoDBCollectionParameters = { + location: "West US", + options: {}, + resource: { + analyticalStorageTtl: 500, + id: "collectionName", + indexes: [ + { + key: { keys: ["_ts"] }, + options: { expireAfterSeconds: 100, unique: true }, + }, + { key: { keys: ["_id"] } }, + ], + shardKey: { testKey: "Hash" }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.mongoDBResources.beginCreateUpdateMongoDBCollectionAndWait( + resourceGroupName, + accountName, + databaseName, + collectionName, + createUpdateMongoDBCollectionParameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB MongoDB Collection + * + * @summary Create or update an Azure Cosmos DB MongoDB Collection + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRestore.json + */ +async function cosmosDbMongoDbcollectionRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const collectionName = "collectionName"; + const createUpdateMongoDBCollectionParameters = { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "collectionName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: false, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.mongoDBResources.beginCreateUpdateMongoDBCollectionAndWait( + resourceGroupName, + accountName, + databaseName, + collectionName, + createUpdateMongoDBCollectionParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbcollectionCreateUpdate(); + cosmosDbMongoDbcollectionRestore(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.js new file mode 100644 index 000000000000..eb435883f72f --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.js @@ -0,0 +1,85 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Create or updates Azure Cosmos DB MongoDB database + * + * @summary Create or updates Azure Cosmos DB MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + */ +async function cosmosDbMongoDbdatabaseCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const createUpdateMongoDBDatabaseParameters = { + location: "West US", + options: {}, + resource: { id: "databaseName" }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.mongoDBResources.beginCreateUpdateMongoDBDatabaseAndWait( + resourceGroupName, + accountName, + databaseName, + createUpdateMongoDBDatabaseParameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create or updates Azure Cosmos DB MongoDB database + * + * @summary Create or updates Azure Cosmos DB MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRestore.json + */ +async function cosmosDbMongoDbdatabaseRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const createUpdateMongoDBDatabaseParameters = { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "databaseName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: false, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.mongoDBResources.beginCreateUpdateMongoDBDatabaseAndWait( + resourceGroupName, + accountName, + databaseName, + createUpdateMongoDBDatabaseParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbdatabaseCreateUpdate(); + cosmosDbMongoDbdatabaseRestore(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.js index 155ac2841980..a94ccd9748f7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB Mongo Role Definition. * * @summary Creates or updates an Azure Cosmos DB Mongo Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json */ async function cosmosDbMongoDbroleDefinitionCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.js index 1e58ef79efa8..48c5499d0d2e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB Mongo User Definition. * * @summary Creates or updates an Azure Cosmos DB Mongo User Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json */ async function cosmosDbMongoDbuserDefinitionCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoDbcollectionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoDbcollectionSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoDbcollectionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoDbcollectionSample.js index c7ccec5db59c..74a0415c7acb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoDbcollectionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoDbcollectionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB MongoDB Collection. * * @summary Deletes an existing Azure Cosmos DB MongoDB Collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionDelete.json */ async function cosmosDbMongoDbcollectionDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoDbdatabaseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoDbdatabaseSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoDbdatabaseSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoDbdatabaseSample.js index 7a69cbe5d03d..67222cdc1337 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoDbdatabaseSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoDbdatabaseSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB MongoDB database. * * @summary Deletes an existing Azure Cosmos DB MongoDB database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseDelete.json */ async function cosmosDbMongoDbdatabaseDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoRoleDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoRoleDefinitionSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoRoleDefinitionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoRoleDefinitionSample.js index eb1d422d0d7f..99055ee1949c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoRoleDefinitionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoRoleDefinitionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Mongo Role Definition. * * @summary Deletes an existing Azure Cosmos DB Mongo Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json */ async function cosmosDbMongoDbroleDefinitionDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoUserDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoUserDefinitionSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoUserDefinitionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoUserDefinitionSample.js index 57381afaf976..b07bfe9a1b42 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoUserDefinitionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesDeleteMongoUserDefinitionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Mongo User Definition. * * @summary Deletes an existing Azure Cosmos DB Mongo User Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json */ async function cosmosDbMongoDbuserDefinitionDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbcollectionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbcollectionSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbcollectionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbcollectionSample.js index 2402e6ea469c..be4e945692e3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbcollectionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbcollectionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the MongoDB collection under an existing Azure Cosmos DB database account. * * @summary Gets the MongoDB collection under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json */ async function cosmosDbMongoDbcollectionGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbcollectionThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbcollectionThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbcollectionThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbcollectionThroughputSample.js index d39057ebaa35..7194224880bf 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbcollectionThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbcollectionThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json */ async function cosmosDbMongoDbcollectionThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbdatabaseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbdatabaseSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbdatabaseSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbdatabaseSample.js index 43215a8864b5..b0e921dd085f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbdatabaseSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbdatabaseSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json */ async function cosmosDbMongoDbdatabaseGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbdatabaseThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbdatabaseThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbdatabaseThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbdatabaseThroughputSample.js index 414ac58f5f73..a035bc1ea464 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbdatabaseThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoDbdatabaseThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json */ async function cosmosDbMongoDbdatabaseThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoRoleDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoRoleDefinitionSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoRoleDefinitionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoRoleDefinitionSample.js index 59362a08037f..8031d96b84ae 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoRoleDefinitionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoRoleDefinitionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json */ async function cosmosDbMongoRoleDefinitionGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoUserDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoUserDefinitionSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoUserDefinitionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoUserDefinitionSample.js index bd0f5d4e0bba..efcbae015de3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoUserDefinitionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesGetMongoUserDefinitionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json */ async function cosmosDbMongoDbuserDefinitionGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbcollectionPartitionMergeSample.js similarity index 60% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbcollectionPartitionMergeSample.js index 664f2d6326d8..1ec7149c2b18 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbcollectionPartitionMergeSample.js @@ -10,38 +10,35 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** - * This sample demonstrates how to Create or updates Azure Cosmos DB MongoDB database + * This sample demonstrates how to Merges the partitions of a MongoDB Collection * - * @summary Create or updates Azure Cosmos DB MongoDB database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + * @summary Merges the partitions of a MongoDB Collection + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json */ -async function cosmosDbMongoDbdatabaseCreateUpdate() { +async function cosmosDbMongoDbcollectionPartitionMerge() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; const accountName = "ddb1"; const databaseName = "databaseName"; - const createUpdateMongoDBDatabaseParameters = { - location: "West US", - options: {}, - resource: { id: "databaseName" }, - tags: {}, - }; + const collectionName = "collectionName"; + const mergeParameters = { isDryRun: false }; const credential = new DefaultAzureCredential(); const client = new CosmosDBManagementClient(credential, subscriptionId); - const result = await client.mongoDBResources.beginCreateUpdateMongoDBDatabaseAndWait( + const result = await client.mongoDBResources.beginListMongoDBCollectionPartitionMergeAndWait( resourceGroupName, accountName, databaseName, - createUpdateMongoDBDatabaseParameters, + collectionName, + mergeParameters, ); console.log(result); } async function main() { - cosmosDbMongoDbdatabaseCreateUpdate(); + cosmosDbMongoDbcollectionPartitionMerge(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoDbcollectionsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbcollectionsSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoDbcollectionsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbcollectionsSample.js index a3b307a7b07f..9f14775843f3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoDbcollectionsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbcollectionsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the MongoDB collection under an existing Azure Cosmos DB database account. * * @summary Lists the MongoDB collection under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionList.json */ async function cosmosDbMongoDbcollectionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoDbdatabasesSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbdatabasesSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoDbdatabasesSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbdatabasesSample.js index e4e62c26e83d..32273f0bd85f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoDbdatabasesSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoDbdatabasesSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the MongoDB databases under an existing Azure Cosmos DB database account. * * @summary Lists the MongoDB databases under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseList.json */ async function cosmosDbMongoDbdatabaseList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoRoleDefinitionsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoRoleDefinitionsSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoRoleDefinitionsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoRoleDefinitionsSample.js index 1df1f54db5ee..ad67e55d5ca0 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoRoleDefinitionsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoRoleDefinitionsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. * * @summary Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionList.json */ async function cosmosDbMongoDbroleDefinitionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoUserDefinitionsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoUserDefinitionsSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoUserDefinitionsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoUserDefinitionsSample.js index 3e2565d5129c..2ab824ed2a5a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoUserDefinitionsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesListMongoUserDefinitionsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Mongo User Definition. * * @summary Retrieves the list of all Azure Cosmos DB Mongo User Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionList.json */ async function cosmosDbMongoDbuserDefinitionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.js index 3e791ac43939..492625d93d33 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json */ async function cosmosDbMongoDbcollectionMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.js index d270376e15f8..7f328c86701b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json */ async function cosmosDbMongoDbcollectionMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.js index 0fda11c6df2c..3f0212548752 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json */ async function cosmosDbMongoDbdatabaseMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.js index 3eb78fd2ed25..2495e76e2a82 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json */ async function cosmosDbMongoDbdatabaseMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoDbcollectionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.js similarity index 56% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoDbcollectionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.js index 8b2328380bb8..0f088c08b824 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoDbcollectionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.js @@ -10,50 +10,44 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** - * This sample demonstrates how to Create or update an Azure Cosmos DB MongoDB Collection + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB MongoDB container * - * @summary Create or update an Azure Cosmos DB MongoDB Collection - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json + * @summary Redistribute throughput for an Azure Cosmos DB MongoDB container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json */ -async function cosmosDbMongoDbcollectionCreateUpdate() { +async function cosmosDbMongoDbcollectionRedistributeThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; const accountName = "ddb1"; const databaseName = "databaseName"; const collectionName = "collectionName"; - const createUpdateMongoDBCollectionParameters = { - location: "West US", - options: {}, + const redistributeThroughputParameters = { resource: { - id: "collectionName", - indexes: [ - { - key: { keys: ["_ts"] }, - options: { expireAfterSeconds: 100, unique: true }, - }, - { key: { keys: ["_id"] } }, + sourcePhysicalPartitionThroughputInfo: [{ id: "2", throughput: 5000 }, { id: "3" }], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, ], - shardKey: { testKey: "Hash" }, + throughputPolicy: "custom", }, - tags: {}, }; const credential = new DefaultAzureCredential(); const client = new CosmosDBManagementClient(credential, subscriptionId); - const result = await client.mongoDBResources.beginCreateUpdateMongoDBCollectionAndWait( + const result = await client.mongoDBResources.beginMongoDBContainerRedistributeThroughputAndWait( resourceGroupName, accountName, databaseName, collectionName, - createUpdateMongoDBCollectionParameters, + redistributeThroughputParameters, ); console.log(result); } async function main() { - cosmosDbMongoDbcollectionCreateUpdate(); + cosmosDbMongoDbcollectionRedistributeThroughput(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.js new file mode 100644 index 000000000000..9e99462f6589 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.js @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB MongoDB container + * + * @summary Retrieve throughput distribution for an Azure Cosmos DB MongoDB container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json + */ +async function cosmosDbMongoDbcollectionRetrieveThroughputDistribution() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const collectionName = "collectionName"; + const retrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBContainerRetrieveThroughputDistributionAndWait( + resourceGroupName, + accountName, + databaseName, + collectionName, + retrieveThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbcollectionRetrieveThroughputDistribution(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabasePartitionMergeSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabasePartitionMergeSample.js new file mode 100644 index 000000000000..a92660b37022 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabasePartitionMergeSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Merges the partitions of a MongoDB database + * + * @summary Merges the partitions of a MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json + */ +async function cosmosDbMongoDbdatabasePartitionMerge() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const mergeParameters = { isDryRun: false }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.mongoDBResources.beginMongoDBDatabasePartitionMergeAndWait( + resourceGroupName, + accountName, + databaseName, + mergeParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbdatabasePartitionMerge(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.js new file mode 100644 index 000000000000..357eed0c0770 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.js @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB MongoDB database + * + * @summary Redistribute throughput for an Azure Cosmos DB MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json + */ +async function cosmosDbMongoDbdatabaseRedistributeThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const redistributeThroughputParameters = { + resource: { + sourcePhysicalPartitionThroughputInfo: [{ id: "2", throughput: 5000 }, { id: "3" }], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, + ], + throughputPolicy: "custom", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.mongoDBResources.beginMongoDBDatabaseRedistributeThroughputAndWait( + resourceGroupName, + accountName, + databaseName, + redistributeThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbdatabaseRedistributeThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.js new file mode 100644 index 000000000000..ba3d38f07121 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB MongoDB database + * + * @summary Retrieve throughput distribution for an Azure Cosmos DB MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json + */ +async function cosmosDbMongoDbdatabaseRetrieveThroughputDistribution() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const retrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBDatabaseRetrieveThroughputDistributionAndWait( + resourceGroupName, + accountName, + databaseName, + retrieveThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbdatabaseRetrieveThroughputDistribution(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesRetrieveContinuousBackupInformationSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesRetrieveContinuousBackupInformationSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesRetrieveContinuousBackupInformationSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesRetrieveContinuousBackupInformationSample.js index 72e5bcc1f955..81391bfe5fbe 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesRetrieveContinuousBackupInformationSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesRetrieveContinuousBackupInformationSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves continuous backup information for a Mongodb collection. * * @summary Retrieves continuous backup information for a Mongodb collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json */ async function cosmosDbMongoDbcollectionBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.js index 2723e479b74e..23ef3dda0e74 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Update the RUs per second of an Azure Cosmos DB MongoDB collection * * @summary Update the RUs per second of an Azure Cosmos DB MongoDB collection - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json */ async function cosmosDbMongoDbcollectionThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.js index be74156bfe16..d5aea2c83f1f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Update RUs per second of the an Azure Cosmos DB MongoDB database * * @summary Update RUs per second of the an Azure Cosmos DB MongoDB database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json */ async function cosmosDbMongoDbdatabaseThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsGetSample.js new file mode 100644 index 000000000000..a8f06b151e30 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsGetSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Gets effective Network Security Perimeter Configuration for association + * + * @summary Gets effective Network Security Perimeter Configuration for association + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json + */ +async function namspaceNetworkSecurityPerimeterConfigurationList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "res4410"; + const accountName = "cosmosTest"; + const networkSecurityPerimeterConfigurationName = + "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.networkSecurityPerimeterConfigurations.get( + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + ); + console.log(result); +} + +async function main() { + namspaceNetworkSecurityPerimeterConfigurationList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsListSample.js new file mode 100644 index 000000000000..0f5abb37b137 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsListSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Gets list of effective Network Security Perimeter Configuration for cosmos db account + * + * @summary Gets list of effective Network Security Perimeter Configuration for cosmos db account + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationList.json + */ +async function namspaceNetworkSecurityPerimeterConfigurationList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "res4410"; + const accountName = "cosmosTest"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.networkSecurityPerimeterConfigurations.list( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + namspaceNetworkSecurityPerimeterConfigurationList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsReconcileSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsReconcileSample.js new file mode 100644 index 000000000000..b33d61825760 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/networkSecurityPerimeterConfigurationsReconcileSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Refreshes any information about the association. + * + * @summary Refreshes any information about the association. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json + */ +async function networkSecurityPerimeterConfigurationList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "res4410"; + const accountName = "sto8607"; + const networkSecurityPerimeterConfigurationName = + "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.networkSecurityPerimeterConfigurations.beginReconcileAndWait( + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + ); + console.log(result); +} + +async function main() { + networkSecurityPerimeterConfigurationList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesCreateOrUpdateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesCreateOrUpdateSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesCreateOrUpdateSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesCreateOrUpdateSample.js index c383405001bd..413f6f90f02b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesCreateOrUpdateSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesCreateOrUpdateSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Creates the notebook workspace for a Cosmos DB account. * * @summary Creates the notebook workspace for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceCreate.json */ async function cosmosDbNotebookWorkspaceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesDeleteSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesDeleteSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesDeleteSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesDeleteSample.js index e10477a9f31c..395150416e0f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesDeleteSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesDeleteSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes the notebook workspace for a Cosmos DB account. * * @summary Deletes the notebook workspace for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceDelete.json */ async function cosmosDbNotebookWorkspaceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesGetSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesGetSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesGetSample.js index 2676c701ee40..dadd8c4b290b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesGetSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesGetSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the notebook workspace for a Cosmos DB account. * * @summary Gets the notebook workspace for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceGet.json */ async function cosmosDbNotebookWorkspaceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesListByDatabaseAccountSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesListByDatabaseAccountSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesListByDatabaseAccountSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesListByDatabaseAccountSample.js index 13f0f78dda26..dd41dc949c77 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesListByDatabaseAccountSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesListByDatabaseAccountSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the notebook workspace resources of an existing Cosmos DB account. * * @summary Gets the notebook workspace resources of an existing Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceList.json */ async function cosmosDbNotebookWorkspaceList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesListConnectionInfoSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesListConnectionInfoSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesListConnectionInfoSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesListConnectionInfoSample.js index 0e5aa1e81eb3..3e46aa01a541 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesListConnectionInfoSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesListConnectionInfoSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the connection info for the notebook workspace * * @summary Retrieves the connection info for the notebook workspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json */ async function cosmosDbNotebookWorkspaceListConnectionInfo() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesRegenerateAuthTokenSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesRegenerateAuthTokenSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesRegenerateAuthTokenSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesRegenerateAuthTokenSample.js index edd51413b696..e8e62e47751c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesRegenerateAuthTokenSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesRegenerateAuthTokenSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Regenerates the auth token for the notebook workspace * * @summary Regenerates the auth token for the notebook workspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json */ async function cosmosDbNotebookWorkspaceRegenerateAuthToken() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesStartSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesStartSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesStartSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesStartSample.js index 874ae75f8948..883e35627157 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesStartSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/notebookWorkspacesStartSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Starts the notebook workspace * * @summary Starts the notebook workspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceStart.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceStart.json */ async function cosmosDbNotebookWorkspaceStart() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/operationsListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/operationsListSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/operationsListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/operationsListSample.js index d9ff430aeb0f..636a9075619a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/operationsListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/operationsListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists all of the available Cosmos DB Resource Provider operations. * * @summary Lists all of the available Cosmos DB Resource Provider operations. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBOperationsList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBOperationsList.json */ async function cosmosDbOperationsList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/package.json b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/package.json similarity index 81% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/package.json rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/package.json index 9c55bdd39071..aab6362d0b05 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/package.json +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/package.json @@ -1,8 +1,8 @@ { - "name": "@azure-samples/arm-cosmosdb-js", + "name": "@azure-samples/arm-cosmosdb-js-beta", "private": true, "version": "1.0.0", - "description": " client library samples for JavaScript", + "description": " client library samples for JavaScript (Beta)", "engines": { "node": ">=18.0.0" }, @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/arm-cosmosdb", "dependencies": { - "@azure/arm-cosmosdb": "latest", + "@azure/arm-cosmosdb": "next", "dotenv": "latest", "@azure/identity": "^4.2.1" } diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/partitionKeyRangeIdListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/partitionKeyRangeIdListMetricsSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/partitionKeyRangeIdListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/partitionKeyRangeIdListMetricsSample.js index 41765ddea78c..e700ea84093f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/partitionKeyRangeIdListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/partitionKeyRangeIdListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given partition key range id. * * @summary Retrieves the metrics determined by the given filter for the given partition key range id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/partitionKeyRangeIdRegionListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/partitionKeyRangeIdRegionListMetricsSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/partitionKeyRangeIdRegionListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/partitionKeyRangeIdRegionListMetricsSample.js index 2e7707500855..49b95b289212 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/partitionKeyRangeIdRegionListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/partitionKeyRangeIdRegionListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given partition key range id and region. * * @summary Retrieves the metrics determined by the given filter for the given partition key range id and region. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileListMetricsSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileListMetricsSample.js index 00334cc73dd9..2f73a2816c88 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data * * @summary Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileSourceTargetListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileSourceTargetListMetricsSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileSourceTargetListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileSourceTargetListMetricsSample.js index 0110282ff179..5e749ebe7514 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileSourceTargetListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileSourceTargetListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data * * @summary Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileTargetListMetricsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileTargetListMetricsSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileTargetListMetricsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileTargetListMetricsSample.js index f257b862495a..03046ccb1a83 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileTargetListMetricsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/percentileTargetListMetricsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data * * @summary Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileTargetGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileTargetGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsCreateOrUpdateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsCreateOrUpdateSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js index e778c6513bed..4acab13ae1c7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsCreateOrUpdateSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsCreateOrUpdateSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. * * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json */ async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsDeleteSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsDeleteSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsDeleteSample.js index 45bf69e33f5f..02dded9cc211 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsDeleteSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsDeleteSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes a private endpoint connection with a given name. * * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json */ async function deletesAPrivateEndpointConnectionWithAGivenName() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsGetSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsGetSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsGetSample.js index 802608d9393d..d03fccef270e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsGetSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsGetSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets a private endpoint connection. * * @summary Gets a private endpoint connection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsListByDatabaseAccountSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsListByDatabaseAccountSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsListByDatabaseAccountSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsListByDatabaseAccountSample.js index f0fe7b198428..b535f228d707 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsListByDatabaseAccountSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateEndpointConnectionsListByDatabaseAccountSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to List all private endpoint connections on a Cosmos DB account. * * @summary List all private endpoint connections on a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionListGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateLinkResourcesGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateLinkResourcesGetSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateLinkResourcesGetSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateLinkResourcesGetSample.js index 2dfbadfa0540..a93143e1a356 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateLinkResourcesGetSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateLinkResourcesGetSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the private link resources that need to be created for a Cosmos DB account. * * @summary Gets the private link resources that need to be created for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateLinkResourcesListByDatabaseAccountSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateLinkResourcesListByDatabaseAccountSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateLinkResourcesListByDatabaseAccountSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateLinkResourcesListByDatabaseAccountSample.js index 54e709d33e26..61fd9f2f660a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateLinkResourcesListByDatabaseAccountSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/privateLinkResourcesListByDatabaseAccountSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the private link resources that need to be created for a Cosmos DB account. * * @summary Gets the private link resources that need to be created for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceListGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceListGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsGetByLocationSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsGetByLocationSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsGetByLocationSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsGetByLocationSample.js index 621d60008d43..a33f661831c2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsGetByLocationSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsGetByLocationSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. * * @summary Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json */ async function cosmosDbRestorableDatabaseAccountGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsListByLocationSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsListByLocationSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsListByLocationSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsListByLocationSample.js index 3358eb658bc2..e218ca1b5aeb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsListByLocationSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsListByLocationSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. * * @summary Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json */ async function cosmosDbRestorableDatabaseAccountList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsListSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsListSample.js index 599de972d089..eb055de2d181 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableDatabaseAccountsListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. * * @summary Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json */ async function cosmosDbRestorableDatabaseAccountNoLocationList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinDatabasesListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinDatabasesListSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinDatabasesListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinDatabasesListSample.js index c8daac3d6d69..53636c7d2b20 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinDatabasesListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinDatabasesListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinDatabaseList.json */ async function cosmosDbRestorableGremlinDatabaseList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinGraphsListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinGraphsListSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinGraphsListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinGraphsListSample.js index a7432bfcb92d..0bddd4982da3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinGraphsListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinGraphsListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinGraphList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinGraphList.json */ async function cosmosDbRestorableGremlinGraphList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinResourcesListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinResourcesListSample.js similarity index 94% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinResourcesListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinResourcesListSample.js index 56d737f5734f..81bd48622ade 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinResourcesListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableGremlinResourcesListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinResourceList.json */ async function cosmosDbRestorableGremlinResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbCollectionsListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbCollectionsListSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbCollectionsListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbCollectionsListSample.js index 558b21319e60..cec5808097b9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbCollectionsListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbCollectionsListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbCollectionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbCollectionList.json */ async function cosmosDbRestorableMongodbCollectionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbDatabasesListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbDatabasesListSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbDatabasesListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbDatabasesListSample.js index bd5dd03e24c7..f1d25e7dfce9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbDatabasesListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbDatabasesListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbDatabaseList.json */ async function cosmosDbRestorableMongodbDatabaseList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbResourcesListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbResourcesListSample.js similarity index 94% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbResourcesListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbResourcesListSample.js index fb06f32fc31a..e2dc5180d040 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbResourcesListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableMongodbResourcesListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbResourceList.json */ async function cosmosDbRestorableMongodbResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlContainersListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlContainersListSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlContainersListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlContainersListSample.js index 9a2132828c7a..d76fed88c410 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlContainersListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlContainersListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlContainerList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlContainerList.json */ async function cosmosDbRestorableSqlContainerList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlDatabasesListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlDatabasesListSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlDatabasesListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlDatabasesListSample.js index 551bfbade006..2a6f06d94a8e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlDatabasesListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlDatabasesListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlDatabaseList.json */ async function cosmosDbRestorableSqlDatabaseList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlResourcesListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlResourcesListSample.js similarity index 94% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlResourcesListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlResourcesListSample.js index d283c0f070e7..cd6d673e54ff 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlResourcesListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableSqlResourcesListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlResourceList.json */ async function cosmosDbRestorableSqlResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableTableResourcesListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableTableResourcesListSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableTableResourcesListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableTableResourcesListSample.js index c425d6bca770..701a1887c69c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableTableResourcesListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableTableResourcesListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableResourceList.json */ async function cosmosDbRestorableTableResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableTablesListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableTablesListSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableTablesListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableTablesListSample.js index 10b1b75a8d5e..9923e0ead19e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableTablesListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/restorableTablesListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableList.json */ async function cosmosDbRestorableTableList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sample.env b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sample.env similarity index 100% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sample.env rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sample.env diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceCreateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceCreateSample.js similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceCreateSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceCreateSample.js index 0960c1038857..4d69f2d32d61 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceCreateSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceCreateSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceCreate.json */ async function dataTransferServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -45,7 +45,7 @@ async function dataTransferServiceCreate() { * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json */ async function graphApiComputeServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -74,7 +74,7 @@ async function graphApiComputeServiceCreate() { * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json */ async function materializedViewsBuilderServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -103,7 +103,7 @@ async function materializedViewsBuilderServiceCreate() { * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json */ async function sqlDedicatedGatewayServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceDeleteSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceDeleteSample.js similarity index 88% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceDeleteSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceDeleteSample.js index a9e6a7683fd3..6844b5d3caff 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceDeleteSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceDeleteSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceDelete.json */ async function dataTransferServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -37,7 +37,7 @@ async function dataTransferServiceDelete() { * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json */ async function graphApiComputeServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -58,7 +58,7 @@ async function graphApiComputeServiceDelete() { * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json */ async function materializedViewsBuilderServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -79,7 +79,7 @@ async function materializedViewsBuilderServiceDelete() { * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json */ async function sqlDedicatedGatewayServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceGetSample.js similarity index 88% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceGetSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceGetSample.js index 312c6a2c6b9e..5056cf962fe2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceGetSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceGetSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json */ async function dataTransferServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -33,7 +33,7 @@ async function dataTransferServiceGet() { * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json */ async function graphApiComputeServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -50,7 +50,7 @@ async function graphApiComputeServiceGet() { * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json */ async function materializedViewsBuilderServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -67,7 +67,7 @@ async function materializedViewsBuilderServiceGet() { * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json */ async function sqlDedicatedGatewayServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceListSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceListSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceListSample.js index 57771160366c..c240843453fa 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceListSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/serviceListSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBServicesList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBServicesList.json */ async function cosmosDbServicesList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateClientEncryptionKeySample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateClientEncryptionKeySample.js similarity index 84% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateClientEncryptionKeySample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateClientEncryptionKeySample.js index c360e42b7adb..ca995c3db001 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateClientEncryptionKeySample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateClientEncryptionKeySample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). * * @summary Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json */ async function cosmosDbClientEncryptionKeyCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subId"; @@ -34,7 +34,9 @@ async function cosmosDbClientEncryptionKeyCreateUpdate() { algorithm: "RSA-OAEP", value: "AzureKeyVault Key URL", }, - wrappedDataEncryptionKey: Buffer.from("U3dhZ2dlciByb2Nrcw=="), + wrappedDataEncryptionKey: Buffer.from( + "VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU=", + ), }, }; const credential = new DefaultAzureCredential(); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlContainerSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlContainerSample.js similarity index 50% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlContainerSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlContainerSample.js index 9506a2bab704..b2df1827752b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlContainerSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlContainerSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL container * * @summary Create or update an Azure Cosmos DB SQL container - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json */ async function cosmosDbSqlContainerCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -104,8 +104,100 @@ async function cosmosDbSqlContainerCreateUpdate() { console.log(result); } +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB SQL container + * + * @summary Create or update an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRestore.json + */ +async function cosmosDbSqlContainerRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const createUpdateSqlContainerParameters = { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "containerName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: true, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginCreateUpdateSqlContainerAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + createUpdateSqlContainerParameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB SQL container + * + * @summary Create or update an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json + */ +async function cosmosDbSqlMaterializedViewCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "mvContainerName"; + const createUpdateSqlContainerParameters = { + location: "West US", + options: {}, + resource: { + id: "mvContainerName", + indexingPolicy: { + automatic: true, + excludedPaths: [], + includedPaths: [ + { + path: "/*", + indexes: [ + { dataType: "String", kind: "Range", precision: -1 }, + { dataType: "Number", kind: "Range", precision: -1 }, + ], + }, + ], + indexingMode: "consistent", + }, + materializedViewDefinition: { + definition: "select * from ROOT", + sourceCollectionId: "sourceContainerName", + }, + partitionKey: { kind: "Hash", paths: ["/mvpk"] }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginCreateUpdateSqlContainerAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + createUpdateSqlContainerParameters, + ); + console.log(result); +} + async function main() { cosmosDbSqlContainerCreateUpdate(); + cosmosDbSqlContainerRestore(); + cosmosDbSqlMaterializedViewCreateUpdate(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlDatabaseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlDatabaseSample.js new file mode 100644 index 000000000000..d153d5d06394 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlDatabaseSample.js @@ -0,0 +1,85 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB SQL database + * + * @summary Create or update an Azure Cosmos DB SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + */ +async function cosmosDbSqlDatabaseCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const createUpdateSqlDatabaseParameters = { + location: "West US", + options: {}, + resource: { id: "databaseName" }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginCreateUpdateSqlDatabaseAndWait( + resourceGroupName, + accountName, + databaseName, + createUpdateSqlDatabaseParameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB SQL database + * + * @summary Create or update an Azure Cosmos DB SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRestore.json + */ +async function cosmosDbSqlDatabaseRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const createUpdateSqlDatabaseParameters = { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "databaseName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: true, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginCreateUpdateSqlDatabaseAndWait( + resourceGroupName, + accountName, + databaseName, + createUpdateSqlDatabaseParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseCreateUpdate(); + cosmosDbSqlDatabaseRestore(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlRoleAssignmentSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlRoleAssignmentSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlRoleAssignmentSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlRoleAssignmentSample.js index 746a99ef711e..4cad5896d433 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlRoleAssignmentSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlRoleAssignmentSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB SQL Role Assignment. * * @summary Creates or updates an Azure Cosmos DB SQL Role Assignment. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json */ async function cosmosDbSqlRoleAssignmentCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlRoleDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlRoleDefinitionSample.js similarity index 94% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlRoleDefinitionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlRoleDefinitionSample.js index d1b7f7a861c0..d15797e14649 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlRoleDefinitionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlRoleDefinitionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB SQL Role Definition. * * @summary Creates or updates an Azure Cosmos DB SQL Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json */ async function cosmosDbSqlRoleDefinitionCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlStoredProcedureSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlStoredProcedureSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlStoredProcedureSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlStoredProcedureSample.js index bc16a7c359af..035420f6e02a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlStoredProcedureSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlStoredProcedureSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL storedProcedure * * @summary Create or update an Azure Cosmos DB SQL storedProcedure - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json */ async function cosmosDbSqlStoredProcedureCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlTriggerSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlTriggerSample.js similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlTriggerSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlTriggerSample.js index 8aca545ca589..bba8f9c4c5ff 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlTriggerSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlTriggerSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL trigger * * @summary Create or update an Azure Cosmos DB SQL trigger - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json */ async function cosmosDbSqlTriggerCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.js index afa5206baaae..49fd9057a917 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL userDefinedFunction * * @summary Create or update an Azure Cosmos DB SQL userDefinedFunction - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json */ async function cosmosDbSqlUserDefinedFunctionCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlContainerSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlContainerSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlContainerSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlContainerSample.js index 6d0b6702b945..e12dda56033b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlContainerSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlContainerSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL container. * * @summary Deletes an existing Azure Cosmos DB SQL container. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerDelete.json */ async function cosmosDbSqlContainerDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlDatabaseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlDatabaseSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlDatabaseSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlDatabaseSample.js index ddf621158520..64ce7cb80462 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlDatabaseSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlDatabaseSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL database. * * @summary Deletes an existing Azure Cosmos DB SQL database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseDelete.json */ async function cosmosDbSqlDatabaseDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlRoleAssignmentSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlRoleAssignmentSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlRoleAssignmentSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlRoleAssignmentSample.js index 0ff31c91f9bb..49d93c0e6f7e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlRoleAssignmentSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlRoleAssignmentSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL Role Assignment. * * @summary Deletes an existing Azure Cosmos DB SQL Role Assignment. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json */ async function cosmosDbSqlRoleAssignmentDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlRoleDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlRoleDefinitionSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlRoleDefinitionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlRoleDefinitionSample.js index f5695ac3abfa..706b6b19dbd6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlRoleDefinitionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlRoleDefinitionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL Role Definition. * * @summary Deletes an existing Azure Cosmos DB SQL Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json */ async function cosmosDbSqlRoleDefinitionDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlStoredProcedureSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlStoredProcedureSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlStoredProcedureSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlStoredProcedureSample.js index 94206b5fdcf4..62144497f946 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlStoredProcedureSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlStoredProcedureSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL storedProcedure. * * @summary Deletes an existing Azure Cosmos DB SQL storedProcedure. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureDelete.json */ async function cosmosDbSqlStoredProcedureDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlTriggerSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlTriggerSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlTriggerSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlTriggerSample.js index 323cbba510da..da100d1d78e2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlTriggerSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlTriggerSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL trigger. * * @summary Deletes an existing Azure Cosmos DB SQL trigger. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerDelete.json */ async function cosmosDbSqlTriggerDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlUserDefinedFunctionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlUserDefinedFunctionSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlUserDefinedFunctionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlUserDefinedFunctionSample.js index b36d6a732f5b..8d1a97bc2f6d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlUserDefinedFunctionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesDeleteSqlUserDefinedFunctionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * * @summary Deletes an existing Azure Cosmos DB SQL userDefinedFunction. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json */ async function cosmosDbSqlUserDefinedFunctionDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetClientEncryptionKeySample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetClientEncryptionKeySample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetClientEncryptionKeySample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetClientEncryptionKeySample.js index 851aa47b7357..07117baf8a83 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetClientEncryptionKeySample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetClientEncryptionKeySample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. * * @summary Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json */ async function cosmosDbClientEncryptionKeyGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlContainerSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlContainerSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlContainerSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlContainerSample.js index 2162f5ca9e2f..cd1432129ce7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlContainerSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlContainerSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the SQL container under an existing Azure Cosmos DB database account. * * @summary Gets the SQL container under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json */ async function cosmosDbSqlContainerGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlContainerThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlContainerThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlContainerThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlContainerThroughputSample.js index cb5d2f27c9aa..4024e6bb440d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlContainerThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlContainerThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. * * @summary Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputGet.json */ async function cosmosDbSqlContainerThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlDatabaseSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlDatabaseSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlDatabaseSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlDatabaseSample.js index 62e0058917f0..31f678c58e14 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlDatabaseSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlDatabaseSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json */ async function cosmosDbSqlDatabaseGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlDatabaseThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlDatabaseThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlDatabaseThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlDatabaseThroughputSample.js index c411b4e5de78..fb5042e82bf3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlDatabaseThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlDatabaseThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputGet.json */ async function cosmosDbSqlDatabaseThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlRoleAssignmentSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlRoleAssignmentSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlRoleAssignmentSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlRoleAssignmentSample.js index 246a5f6b727e..b2e0d7c377f5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlRoleAssignmentSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlRoleAssignmentSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json */ async function cosmosDbSqlRoleAssignmentGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlRoleDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlRoleDefinitionSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlRoleDefinitionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlRoleDefinitionSample.js index c367a646883e..3be75cb0cb48 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlRoleDefinitionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlRoleDefinitionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json */ async function cosmosDbSqlRoleDefinitionGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlStoredProcedureSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlStoredProcedureSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlStoredProcedureSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlStoredProcedureSample.js index a69967fdd7db..e1de5a157af6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlStoredProcedureSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlStoredProcedureSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. * * @summary Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json */ async function cosmosDbSqlStoredProcedureGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlTriggerSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlTriggerSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlTriggerSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlTriggerSample.js index cbdeabe551a7..0cedf119e794 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlTriggerSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlTriggerSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the SQL trigger under an existing Azure Cosmos DB database account. * * @summary Gets the SQL trigger under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json */ async function cosmosDbSqlTriggerGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlUserDefinedFunctionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlUserDefinedFunctionSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlUserDefinedFunctionSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlUserDefinedFunctionSample.js index 8c042931dbc9..ffe192a3daba 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlUserDefinedFunctionSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesGetSqlUserDefinedFunctionSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * * @summary Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json */ async function cosmosDbSqlUserDefinedFunctionGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListClientEncryptionKeysSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListClientEncryptionKeysSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListClientEncryptionKeysSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListClientEncryptionKeysSample.js index 551934752f9f..25e701cc4505 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListClientEncryptionKeysSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListClientEncryptionKeysSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. * * @summary Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeysList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeysList.json */ async function cosmosDbClientEncryptionKeysList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlContainerPartitionMergeSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlContainerPartitionMergeSample.js new file mode 100644 index 000000000000..de01e3b1a90f --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlContainerPartitionMergeSample.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Merges the partitions of a SQL Container + * + * @summary Merges the partitions of a SQL Container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerPartitionMerge.json + */ +async function cosmosDbSqlContainerPartitionMerge() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const mergeParameters = { isDryRun: false }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginListSqlContainerPartitionMergeAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + mergeParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlContainerPartitionMerge(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlContainersSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlContainersSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlContainersSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlContainersSample.js index 8d7acac8e12f..87cc987e4f6f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlContainersSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlContainersSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the SQL container under an existing Azure Cosmos DB database account. * * @summary Lists the SQL container under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerList.json */ async function cosmosDbSqlContainerList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlDatabasesSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlDatabasesSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlDatabasesSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlDatabasesSample.js index 3d56df278011..a9629432f4e1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlDatabasesSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlDatabasesSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the SQL databases under an existing Azure Cosmos DB database account. * * @summary Lists the SQL databases under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseList.json */ async function cosmosDbSqlDatabaseList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlRoleAssignmentsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlRoleAssignmentsSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlRoleAssignmentsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlRoleAssignmentsSample.js index b067d669bd64..cf6a8d117f41 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlRoleAssignmentsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlRoleAssignmentsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB SQL Role Assignments. * * @summary Retrieves the list of all Azure Cosmos DB SQL Role Assignments. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentList.json */ async function cosmosDbSqlRoleAssignmentList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlRoleDefinitionsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlRoleDefinitionsSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlRoleDefinitionsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlRoleDefinitionsSample.js index 9e3e8d577553..c64df84d2bf1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlRoleDefinitionsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlRoleDefinitionsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB SQL Role Definitions. * * @summary Retrieves the list of all Azure Cosmos DB SQL Role Definitions. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionList.json */ async function cosmosDbSqlRoleDefinitionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "mySubscriptionId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlStoredProceduresSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlStoredProceduresSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlStoredProceduresSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlStoredProceduresSample.js index bb39f9ccc576..fc623287e504 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlStoredProceduresSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlStoredProceduresSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. * * @summary Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureList.json */ async function cosmosDbSqlStoredProcedureList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlTriggersSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlTriggersSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlTriggersSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlTriggersSample.js index 4986eecfc79e..fae03bd55ea5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlTriggersSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlTriggersSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the SQL trigger under an existing Azure Cosmos DB database account. * * @summary Lists the SQL trigger under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerList.json */ async function cosmosDbSqlTriggerList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlUserDefinedFunctionsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlUserDefinedFunctionsSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlUserDefinedFunctionsSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlUserDefinedFunctionsSample.js index f228aa2c0e37..d0734179adc2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlUserDefinedFunctionsSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesListSqlUserDefinedFunctionsSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * * @summary Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionList.json */ async function cosmosDbSqlUserDefinedFunctionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlContainerToAutoscaleSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlContainerToAutoscaleSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlContainerToAutoscaleSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlContainerToAutoscaleSample.js index 6b900f75d476..a0179fa2365a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlContainerToAutoscaleSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlContainerToAutoscaleSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json */ async function cosmosDbSqlContainerMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlContainerToManualThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlContainerToManualThroughputSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlContainerToManualThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlContainerToManualThroughputSample.js index 64c27f3cd7a5..ec728c5b9f60 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlContainerToManualThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlContainerToManualThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json */ async function cosmosDbSqlContainerMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.js index bc87569d4947..f30038919d93 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json */ async function cosmosDbSqlDatabaseMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.js index fbd8f664fc78..10d57531e497 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json */ async function cosmosDbSqlDatabaseMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesRetrieveContinuousBackupInformationSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesRetrieveContinuousBackupInformationSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesRetrieveContinuousBackupInformationSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesRetrieveContinuousBackupInformationSample.js index 1f9a52eae7c5..53b10a948671 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesRetrieveContinuousBackupInformationSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesRetrieveContinuousBackupInformationSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves continuous backup information for a container resource. * * @summary Retrieves continuous backup information for a container resource. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerBackupInformation.json */ async function cosmosDbSqlContainerBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlContainerRedistributeThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlContainerRedistributeThroughputSample.js new file mode 100644 index 000000000000..96940ce4a565 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlContainerRedistributeThroughputSample.js @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB SQL container + * + * @summary Redistribute throughput for an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json + */ +async function cosmosDbSqlContainerRedistributeThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const redistributeThroughputParameters = { + resource: { + sourcePhysicalPartitionThroughputInfo: [{ id: "2", throughput: 5000 }, { id: "3" }], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, + ], + throughputPolicy: "custom", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginSqlContainerRedistributeThroughputAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + redistributeThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlContainerRedistributeThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlContainerRetrieveThroughputDistributionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlContainerRetrieveThroughputDistributionSample.js new file mode 100644 index 000000000000..0869034a1a20 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlContainerRetrieveThroughputDistributionSample.js @@ -0,0 +1,46 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB SQL container + * + * @summary Retrieve throughput distribution for an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json + */ +async function cosmosDbSqlContainerRetrieveThroughputDistribution() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const retrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginSqlContainerRetrieveThroughputDistributionAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + retrieveThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlContainerRetrieveThroughputDistribution(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabasePartitionMergeSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabasePartitionMergeSample.js new file mode 100644 index 000000000000..925b47c4a1b5 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabasePartitionMergeSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Merges the partitions of a SQL database + * + * @summary Merges the partitions of a SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabasePartitionMerge.json + */ +async function cosmosDbSqlDatabasePartitionMerge() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const mergeParameters = { isDryRun: false }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginSqlDatabasePartitionMergeAndWait( + resourceGroupName, + accountName, + databaseName, + mergeParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabasePartitionMerge(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabaseRedistributeThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabaseRedistributeThroughputSample.js new file mode 100644 index 000000000000..3d19fe64b28c --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabaseRedistributeThroughputSample.js @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB SQL database + * + * @summary Redistribute throughput for an Azure Cosmos DB SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json + */ +async function cosmosDbSqlDatabaseRedistributeThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const redistributeThroughputParameters = { + resource: { + sourcePhysicalPartitionThroughputInfo: [{ id: "2", throughput: 5000 }, { id: "3" }], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, + ], + throughputPolicy: "custom", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginSqlDatabaseRedistributeThroughputAndWait( + resourceGroupName, + accountName, + databaseName, + redistributeThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseRedistributeThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.js new file mode 100644 index 000000000000..fa23dc53c0d2 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB SQL database + * + * @summary Retrieve throughput distribution for an Azure Cosmos DB SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json + */ +async function cosmosDbSqlDatabaseRetrieveThroughputDistribution() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const retrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginSqlDatabaseRetrieveThroughputDistributionAndWait( + resourceGroupName, + accountName, + databaseName, + retrieveThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseRetrieveThroughputDistribution(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesUpdateSqlContainerThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesUpdateSqlContainerThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesUpdateSqlContainerThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesUpdateSqlContainerThroughputSample.js index 74deb7f3695b..9b460eef6ec5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesUpdateSqlContainerThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesUpdateSqlContainerThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB SQL container * * @summary Update RUs per second of an Azure Cosmos DB SQL container - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputUpdate.json */ async function cosmosDbSqlContainerThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesUpdateSqlDatabaseThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesUpdateSqlDatabaseThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesUpdateSqlDatabaseThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesUpdateSqlDatabaseThroughputSample.js index 067d3b329e1f..08726d072dec 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesUpdateSqlDatabaseThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/sqlResourcesUpdateSqlDatabaseThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB SQL database * * @summary Update RUs per second of an Azure Cosmos DB SQL database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json */ async function cosmosDbSqlDatabaseThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableRoleAssignmentSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableRoleAssignmentSample.js new file mode 100644 index 000000000000..b19201a6524c --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableRoleAssignmentSample.js @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB Table Role Assignment. + * + * @summary Creates or updates an Azure Cosmos DB Table Role Assignment. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json + */ +async function cosmosDbTableRoleAssignmentCreateUpdate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleAssignmentId = "myRoleAssignmentId"; + const createUpdateTableRoleAssignmentParameters = { + principalId: "myPrincipalId", + roleDefinitionId: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/tableRoleDefinitions/myRoleDefinitionId", + scope: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.tableResources.beginCreateUpdateTableRoleAssignmentAndWait( + resourceGroupName, + accountName, + roleAssignmentId, + createUpdateTableRoleAssignmentParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleAssignmentCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableRoleDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableRoleDefinitionSample.js new file mode 100644 index 000000000000..d17b7cbed3d2 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableRoleDefinitionSample.js @@ -0,0 +1,59 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB Table Role Definition. + * + * @summary Creates or updates an Azure Cosmos DB Table Role Definition. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json + */ +async function cosmosDbTableRoleDefinitionCreateUpdate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleDefinitionId = "myRoleDefinitionId"; + const createUpdateTableRoleDefinitionParameters = { + typePropertiesType: "CustomRole", + assignableScopes: [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases", + ], + permissions: [ + { + dataActions: [ + "Microsoft.DocumentDB/databaseAccounts/tableDatabases/containers/entities/create", + "Microsoft.DocumentDB/databaseAccounts/tableDatabases/containers/entities/read", + ], + notDataActions: [], + }, + ], + roleName: "myRoleName", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.tableResources.beginCreateUpdateTableRoleDefinitionAndWait( + resourceGroupName, + accountName, + roleDefinitionId, + createUpdateTableRoleDefinitionParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleDefinitionCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesCreateUpdateTableSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesCreateUpdateTableSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableSample.js index 00340cbf704b..fb29eb49e656 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesCreateUpdateTableSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesCreateUpdateTableSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Create or update an Azure Cosmos DB Table * * @summary Create or update an Azure Cosmos DB Table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableCreateUpdate.json */ async function cosmosDbTableReplace() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableRoleAssignmentSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableRoleAssignmentSample.js new file mode 100644 index 000000000000..2af0b975a8df --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableRoleAssignmentSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Table Role Assignment. + * + * @summary Deletes an existing Azure Cosmos DB Table Role Assignment. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentDelete.json + */ +async function cosmosDbTableRoleAssignmentDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleAssignmentId = "myRoleAssignmentId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.tableResources.beginDeleteTableRoleAssignmentAndWait( + resourceGroupName, + accountName, + roleAssignmentId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleAssignmentDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableRoleDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableRoleDefinitionSample.js new file mode 100644 index 000000000000..f76438a0063b --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableRoleDefinitionSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Table Role Definition. + * + * @summary Deletes an existing Azure Cosmos DB Table Role Definition. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionDelete.json + */ +async function cosmosDbTableRoleDefinitionDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleDefinitionId = "myRoleDefinitionId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.tableResources.beginDeleteTableRoleDefinitionAndWait( + resourceGroupName, + accountName, + roleDefinitionId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleDefinitionDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesDeleteTableSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesDeleteTableSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableSample.js index 4439bdb7ccaa..e4c5a7d50d97 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesDeleteTableSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesDeleteTableSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Table. * * @summary Deletes an existing Azure Cosmos DB Table. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableDelete.json */ async function cosmosDbTableDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableRoleAssignmentSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableRoleAssignmentSample.js new file mode 100644 index 000000000000..9b6d7b887f64 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableRoleAssignmentSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json + */ +async function cosmosDbTableRoleAssignmentGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleAssignmentId = "myRoleAssignmentId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.tableResources.getTableRoleAssignment( + resourceGroupName, + accountName, + roleAssignmentId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleAssignmentGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableRoleDefinitionSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableRoleDefinitionSample.js new file mode 100644 index 000000000000..bffd551f7dcd --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableRoleDefinitionSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json + */ +async function cosmosDbTableRoleDefinitionGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleDefinitionId = "myRoleDefinitionId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.tableResources.getTableRoleDefinition( + resourceGroupName, + accountName, + roleDefinitionId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleDefinitionGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesGetTableSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesGetTableSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableSample.js index 0c74e91bec19..a0da2e80fc54 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesGetTableSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the Tables under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Tables under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json */ async function cosmosDbTableGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesGetTableThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesGetTableThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableThroughputSample.js index cae2b8e475a0..a222127a9f88 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesGetTableThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesGetTableThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputGet.json */ async function cosmosDbTableThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTableRoleAssignmentsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTableRoleAssignmentsSample.js new file mode 100644 index 000000000000..318f2e2105ca --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTableRoleAssignmentsSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * + * @summary Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentList.json + */ +async function cosmosDbTableRoleAssignmentList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.tableResources.listTableRoleAssignments( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbTableRoleAssignmentList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTableRoleDefinitionsSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTableRoleDefinitionsSample.js new file mode 100644 index 000000000000..4d3f3a863fab --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTableRoleDefinitionsSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Table Role Definitions. + * + * @summary Retrieves the list of all Azure Cosmos DB Table Role Definitions. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionList.json + */ +async function cosmosDbTableRoleDefinitionList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.tableResources.listTableRoleDefinitions( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbTableRoleDefinitionList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesListTablesSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTablesSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesListTablesSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTablesSample.js index 79234ec6bc98..30106cb9d621 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesListTablesSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesListTablesSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Lists the Tables under an existing Azure Cosmos DB database account. * * @summary Lists the Tables under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableList.json */ async function cosmosDbTableList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesMigrateTableToAutoscaleSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesMigrateTableToAutoscaleSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesMigrateTableToAutoscaleSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesMigrateTableToAutoscaleSample.js index 84b7776599b8..596e2058e5be 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesMigrateTableToAutoscaleSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesMigrateTableToAutoscaleSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB Table from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Table from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToAutoscale.json */ async function cosmosDbTableMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesMigrateTableToManualThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesMigrateTableToManualThroughputSample.js similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesMigrateTableToManualThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesMigrateTableToManualThroughputSample.js index a34d79d8c331..7adf15b1f0b5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesMigrateTableToManualThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesMigrateTableToManualThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Migrate an Azure Cosmos DB Table from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Table from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToManualThroughput.json */ async function cosmosDbTableMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesRetrieveContinuousBackupInformationSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesRetrieveContinuousBackupInformationSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesRetrieveContinuousBackupInformationSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesRetrieveContinuousBackupInformationSample.js index 39def80d9ee6..4f4bce9a9343 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesRetrieveContinuousBackupInformationSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesRetrieveContinuousBackupInformationSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Retrieves continuous backup information for a table. * * @summary Retrieves continuous backup information for a table. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableBackupInformation.json */ async function cosmosDbTableCollectionBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesUpdateTableThroughputSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesUpdateTableThroughputSample.js similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesUpdateTableThroughputSample.js rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesUpdateTableThroughputSample.js index 3847e8a5963b..443d49a76767 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesUpdateTableThroughputSample.js +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/tableResourcesUpdateTableThroughputSample.js @@ -10,13 +10,13 @@ // Licensed under the MIT License. const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); +require("dotenv/config"); /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Table * * @summary Update RUs per second of an Azure Cosmos DB Table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputUpdate.json */ async function cosmosDbTableThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountCreateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountCreateSample.js new file mode 100644 index 000000000000..884e46a90138 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountCreateSample.js @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * + * @summary Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json + */ +async function cosmosDbThroughputPoolAccountCreate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const throughputPoolName = "tp1"; + const throughputPoolAccountName = "db1"; + const body = { + accountLocation: "West US", + accountResourceIdentifier: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPoolAccount.beginCreateAndWait( + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + body, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolAccountCreate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountDeleteSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountDeleteSample.js new file mode 100644 index 000000000000..f2a4201082ed --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountDeleteSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @summary Removes an existing Azure Cosmos DB database account from a throughput pool. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json + */ +async function cosmosDbThroughputPoolAccountDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const throughputPoolAccountName = "db1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPoolAccount.beginDeleteAndWait( + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolAccountDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountGetSample.js new file mode 100644 index 000000000000..353562731057 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountGetSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json + */ +async function cosmosDbThroughputPoolAccountGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const throughputPoolAccountName = "db1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPoolAccount.get( + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolAccountGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountsListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountsListSample.js new file mode 100644 index 000000000000..5dd97ecd2bc2 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolAccountsListSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @summary Lists all the Azure Cosmos DB accounts available under the subscription. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json + */ +async function cosmosDbThroughputPoolAccountList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.throughputPoolAccounts.list( + resourceGroupName, + throughputPoolName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbThroughputPoolAccountList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolCreateOrUpdateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolCreateOrUpdateSample.js new file mode 100644 index 000000000000..8b7abe6f745d --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolCreateOrUpdateSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * + * @summary Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json + */ +async function cosmosDbThroughputPoolCreate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const throughputPoolName = "tp1"; + const body = { + location: "westus2", + maxThroughput: 10000, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.beginCreateOrUpdateAndWait( + resourceGroupName, + throughputPoolName, + body, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolCreate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolDeleteSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolDeleteSample.js new file mode 100644 index 000000000000..9c6296c794be --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolDeleteSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @summary Deletes an existing Azure Cosmos DB Throughput Pool. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json + */ +async function cosmosDbThroughputPoolDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.beginDeleteAndWait( + resourceGroupName, + throughputPoolName, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolGetSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolGetSample.js new file mode 100644 index 000000000000..c47d105d38e2 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolGetSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json + */ +async function cosmosDbThroughputPoolGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.get(resourceGroupName, throughputPoolName); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolUpdateSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolUpdateSample.js new file mode 100644 index 000000000000..4dcc6f12c3c6 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolUpdateSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @summary Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json + */ +async function cosmosDbThroughputPoolUpdate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const throughputPoolName = "tp1"; + const body = { maxThroughput: 10000 }; + const options = { body }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.beginUpdateAndWait( + resourceGroupName, + throughputPoolName, + options, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolsListByResourceGroupSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolsListByResourceGroupSample.js new file mode 100644 index 000000000000..2414137286fb --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolsListByResourceGroupSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to List all the ThroughputPools in a given resource group. + * + * @summary List all the ThroughputPools in a given resource group. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json + */ +async function cosmosDbThroughputPoolListByResourceGroup() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.throughputPools.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbThroughputPoolListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolsListSample.js b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolsListSample.js new file mode 100644 index 000000000000..5f73738e36b0 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/javascript/throughputPoolsListSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb"); +const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv/config"); + +/** + * This sample demonstrates how to Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @summary Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json + */ +async function cosmosDbThroughputPoolList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.throughputPools.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbThroughputPoolList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/README.md b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/README.md new file mode 100644 index 000000000000..73784bfec0e8 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/README.md @@ -0,0 +1,561 @@ +# client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [cassandraClustersCreateUpdateSample.ts][cassandraclusterscreateupdatesample] | Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterCreate.json | +| [cassandraClustersDeallocateSample.ts][cassandraclustersdeallocatesample] | Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json | +| [cassandraClustersDeleteSample.ts][cassandraclustersdeletesample] | Deletes a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDelete.json | +| [cassandraClustersGetBackupSample.ts][cassandraclustersgetbackupsample] | Get the properties of an individual backup of this cluster that is available to restore. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackup.json | +| [cassandraClustersGetCommandAsyncSample.ts][cassandraclustersgetcommandasyncsample] | Get details about a specified command that was run asynchronously. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandResult.json | +| [cassandraClustersGetSample.ts][cassandraclustersgetsample] | Get the properties of a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json | +| [cassandraClustersInvokeCommandAsyncSample.ts][cassandraclustersinvokecommandasyncsample] | Invoke a command like nodetool for cassandra maintenance asynchronously x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandAsync.json | +| [cassandraClustersInvokeCommandSample.ts][cassandraclustersinvokecommandsample] | Invoke a command like nodetool for cassandra maintenance x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommand.json | +| [cassandraClustersListBackupsSample.ts][cassandraclusterslistbackupssample] | List the backups of this cluster that are available to restore. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackupsList.json | +| [cassandraClustersListByResourceGroupSample.ts][cassandraclusterslistbyresourcegroupsample] | List all managed Cassandra clusters in this resource group. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json | +| [cassandraClustersListBySubscriptionSample.ts][cassandraclusterslistbysubscriptionsample] | List all managed Cassandra clusters in this subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json | +| [cassandraClustersListCommandSample.ts][cassandraclusterslistcommandsample] | List all commands currently running on ring info x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraListCommand.json | +| [cassandraClustersStartSample.ts][cassandraclustersstartsample] | Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterStart.json | +| [cassandraClustersStatusSample.ts][cassandraclustersstatussample] | Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraStatus.json | +| [cassandraClustersUpdateSample.ts][cassandraclustersupdatesample] | Updates some of the properties of a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterPatch.json | +| [cassandraDataCentersCreateUpdateSample.ts][cassandradatacenterscreateupdatesample] | Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json | +| [cassandraDataCentersDeleteSample.ts][cassandradatacentersdeletesample] | Delete a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json | +| [cassandraDataCentersGetSample.ts][cassandradatacentersgetsample] | Get the properties of a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json | +| [cassandraDataCentersListSample.ts][cassandradatacenterslistsample] | List all data centers in a particular managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterList.json | +| [cassandraDataCentersUpdateSample.ts][cassandradatacentersupdatesample] | Update some of the properties of a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json | +| [cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts][cassandraresourcescreateupdatecassandrakeyspacesample] | Create or update an Azure Cosmos DB Cassandra keyspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json | +| [cassandraResourcesCreateUpdateCassandraTableSample.ts][cassandraresourcescreateupdatecassandratablesample] | Create or update an Azure Cosmos DB Cassandra Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json | +| [cassandraResourcesCreateUpdateCassandraViewSample.ts][cassandraresourcescreateupdatecassandraviewsample] | Create or update an Azure Cosmos DB Cassandra View x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json | +| [cassandraResourcesDeleteCassandraKeyspaceSample.ts][cassandraresourcesdeletecassandrakeyspacesample] | Deletes an existing Azure Cosmos DB Cassandra keyspace. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceDelete.json | +| [cassandraResourcesDeleteCassandraTableSample.ts][cassandraresourcesdeletecassandratablesample] | Deletes an existing Azure Cosmos DB Cassandra table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableDelete.json | +| [cassandraResourcesDeleteCassandraViewSample.ts][cassandraresourcesdeletecassandraviewsample] | Deletes an existing Azure Cosmos DB Cassandra view. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewDelete.json | +| [cassandraResourcesGetCassandraKeyspaceSample.ts][cassandraresourcesgetcassandrakeyspacesample] | Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json | +| [cassandraResourcesGetCassandraKeyspaceThroughputSample.ts][cassandraresourcesgetcassandrakeyspacethroughputsample] | Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json | +| [cassandraResourcesGetCassandraTableSample.ts][cassandraresourcesgetcassandratablesample] | Gets the Cassandra table under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json | +| [cassandraResourcesGetCassandraTableThroughputSample.ts][cassandraresourcesgetcassandratablethroughputsample] | Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputGet.json | +| [cassandraResourcesGetCassandraViewSample.ts][cassandraresourcesgetcassandraviewsample] | Gets the Cassandra view under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewGet.json | +| [cassandraResourcesGetCassandraViewThroughputSample.ts][cassandraresourcesgetcassandraviewthroughputsample] | Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputGet.json | +| [cassandraResourcesListCassandraKeyspacesSample.ts][cassandraresourceslistcassandrakeyspacessample] | Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceList.json | +| [cassandraResourcesListCassandraTablesSample.ts][cassandraresourceslistcassandratablessample] | Lists the Cassandra table under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableList.json | +| [cassandraResourcesListCassandraViewsSample.ts][cassandraresourceslistcassandraviewssample] | Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewList.json | +| [cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts][cassandraresourcesmigratecassandrakeyspacetoautoscalesample] | Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json | +| [cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts][cassandraresourcesmigratecassandrakeyspacetomanualthroughputsample] | Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json | +| [cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts][cassandraresourcesmigratecassandratabletoautoscalesample] | Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json | +| [cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts][cassandraresourcesmigratecassandratabletomanualthroughputsample] | Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json | +| [cassandraResourcesMigrateCassandraViewToAutoscaleSample.ts][cassandraresourcesmigratecassandraviewtoautoscalesample] | Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json | +| [cassandraResourcesMigrateCassandraViewToManualThroughputSample.ts][cassandraresourcesmigratecassandraviewtomanualthroughputsample] | Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json | +| [cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts][cassandraresourcesupdatecassandrakeyspacethroughputsample] | Update RUs per second of an Azure Cosmos DB Cassandra Keyspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json | +| [cassandraResourcesUpdateCassandraTableThroughputSample.ts][cassandraresourcesupdatecassandratablethroughputsample] | Update RUs per second of an Azure Cosmos DB Cassandra table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputUpdate.json | +| [cassandraResourcesUpdateCassandraViewThroughputSample.ts][cassandraresourcesupdatecassandraviewthroughputsample] | Update RUs per second of an Azure Cosmos DB Cassandra view x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputUpdate.json | +| [chaosFaultEnableDisableSample.ts][chaosfaultenabledisablesample] | Enable, disable Chaos Fault in a CosmosDB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultEnableDisable.json | +| [chaosFaultGetSample.ts][chaosfaultgetsample] | Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultGet.json | +| [chaosFaultListSample.ts][chaosfaultlistsample] | List Chaos Faults for CosmosDB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultList.json | +| [collectionListMetricDefinitionsSample.ts][collectionlistmetricdefinitionssample] | Retrieves metric definitions for the given collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetricDefinitions.json | +| [collectionListMetricsSample.ts][collectionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetrics.json | +| [collectionListUsagesSample.ts][collectionlistusagessample] | Retrieves the usages (most recent storage data) for the given collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetUsages.json | +| [collectionPartitionListMetricsSample.ts][collectionpartitionlistmetricssample] | Retrieves the metrics determined by the given filter for the given collection, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetMetrics.json | +| [collectionPartitionListUsagesSample.ts][collectionpartitionlistusagessample] | Retrieves the usages (most recent storage data) for the given collection, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetUsages.json | +| [collectionPartitionRegionListMetricsSample.ts][collectionpartitionregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given collection and region, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json | +| [collectionRegionListMetricsSample.ts][collectionregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account, collection and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRegionCollectionGetMetrics.json | +| [dataTransferJobsCancelSample.ts][datatransferjobscancelsample] | Cancels a Data Transfer Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json | +| [dataTransferJobsCompleteSample.ts][datatransferjobscompletesample] | Completes a Data Transfer Online Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json | +| [dataTransferJobsCreateSample.ts][datatransferjobscreatesample] | Creates a Data Transfer Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json | +| [dataTransferJobsGetSample.ts][datatransferjobsgetsample] | Get a Data Transfer Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json | +| [dataTransferJobsListByDatabaseAccountSample.ts][datatransferjobslistbydatabaseaccountsample] | Get a list of Data Transfer jobs. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json | +| [dataTransferJobsPauseSample.ts][datatransferjobspausesample] | Pause a Data Transfer Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json | +| [dataTransferJobsResumeSample.ts][datatransferjobsresumesample] | Resumes a Data Transfer Job. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json | +| [databaseAccountRegionListMetricsSample.ts][databaseaccountregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json | +| [databaseAccountsCheckNameExistsSample.ts][databaseaccountschecknameexistssample] | Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json | +| [databaseAccountsCreateOrUpdateSample.ts][databaseaccountscreateorupdatesample] | Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json | +| [databaseAccountsDeleteSample.ts][databaseaccountsdeletesample] | Deletes an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountDelete.json | +| [databaseAccountsFailoverPriorityChangeSample.ts][databaseaccountsfailoverprioritychangesample] | Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json | +| [databaseAccountsGetReadOnlyKeysSample.ts][databaseaccountsgetreadonlykeyssample] | Lists the read-only access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json | +| [databaseAccountsGetSample.ts][databaseaccountsgetsample] | Retrieves the properties of an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json | +| [databaseAccountsListByResourceGroupSample.ts][databaseaccountslistbyresourcegroupsample] | Lists all the Azure Cosmos DB database accounts available under the given resource group. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json | +| [databaseAccountsListConnectionStringsSample.ts][databaseaccountslistconnectionstringssample] | Lists the connection strings for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json | +| [databaseAccountsListKeysSample.ts][databaseaccountslistkeyssample] | Lists the access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListKeys.json | +| [databaseAccountsListMetricDefinitionsSample.ts][databaseaccountslistmetricdefinitionssample] | Retrieves metric definitions for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json | +| [databaseAccountsListMetricsSample.ts][databaseaccountslistmetricssample] | Retrieves the metrics determined by the given filter for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetrics.json | +| [databaseAccountsListReadOnlyKeysSample.ts][databaseaccountslistreadonlykeyssample] | Lists the read-only access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json | +| [databaseAccountsListSample.ts][databaseaccountslistsample] | Lists all the Azure Cosmos DB database accounts available under the subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountList.json | +| [databaseAccountsListUsagesSample.ts][databaseaccountslistusagessample] | Retrieves the usages (most recent data) for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetUsages.json | +| [databaseAccountsOfflineRegionSample.ts][databaseaccountsofflineregionsample] | Offline the specified region for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json | +| [databaseAccountsOnlineRegionSample.ts][databaseaccountsonlineregionsample] | Online the specified region for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json | +| [databaseAccountsRegenerateKeySample.ts][databaseaccountsregeneratekeysample] | Regenerates an access key for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json | +| [databaseAccountsUpdateSample.ts][databaseaccountsupdatesample] | Updates the properties of an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountPatch.json | +| [databaseListMetricDefinitionsSample.ts][databaselistmetricdefinitionssample] | Retrieves metric definitions for the given database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json | +| [databaseListMetricsSample.ts][databaselistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetrics.json | +| [databaseListUsagesSample.ts][databaselistusagessample] | Retrieves the usages (most recent data) for the given database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetUsages.json | +| [graphResourcesCreateUpdateGraphSample.ts][graphresourcescreateupdategraphsample] | Create or update an Azure Cosmos DB Graph. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json | +| [graphResourcesDeleteGraphResourceSample.ts][graphresourcesdeletegraphresourcesample] | Deletes an existing Azure Cosmos DB Graph Resource. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceDelete.json | +| [graphResourcesGetGraphSample.ts][graphresourcesgetgraphsample] | Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceGet.json | +| [graphResourcesListGraphsSample.ts][graphresourceslistgraphssample] | Lists the graphs under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceList.json | +| [gremlinResourcesCreateUpdateGremlinDatabaseSample.ts][gremlinresourcescreateupdategremlindatabasesample] | Create or update an Azure Cosmos DB Gremlin database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json | +| [gremlinResourcesCreateUpdateGremlinGraphSample.ts][gremlinresourcescreateupdategremlingraphsample] | Create or update an Azure Cosmos DB Gremlin graph x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json | +| [gremlinResourcesDeleteGremlinDatabaseSample.ts][gremlinresourcesdeletegremlindatabasesample] | Deletes an existing Azure Cosmos DB Gremlin database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseDelete.json | +| [gremlinResourcesDeleteGremlinGraphSample.ts][gremlinresourcesdeletegremlingraphsample] | Deletes an existing Azure Cosmos DB Gremlin graph. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphDelete.json | +| [gremlinResourcesGetGremlinDatabaseSample.ts][gremlinresourcesgetgremlindatabasesample] | Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json | +| [gremlinResourcesGetGremlinDatabaseThroughputSample.ts][gremlinresourcesgetgremlindatabasethroughputsample] | Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json | +| [gremlinResourcesGetGremlinGraphSample.ts][gremlinresourcesgetgremlingraphsample] | Gets the Gremlin graph under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json | +| [gremlinResourcesGetGremlinGraphThroughputSample.ts][gremlinresourcesgetgremlingraphthroughputsample] | Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputGet.json | +| [gremlinResourcesListGremlinDatabasesSample.ts][gremlinresourceslistgremlindatabasessample] | Lists the Gremlin databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseList.json | +| [gremlinResourcesListGremlinGraphsSample.ts][gremlinresourceslistgremlingraphssample] | Lists the Gremlin graph under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphList.json | +| [gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts][gremlinresourcesmigrategremlindatabasetoautoscalesample] | Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json | +| [gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts][gremlinresourcesmigrategremlindatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json | +| [gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts][gremlinresourcesmigrategremlingraphtoautoscalesample] | Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json | +| [gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts][gremlinresourcesmigrategremlingraphtomanualthroughputsample] | Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json | +| [gremlinResourcesRetrieveContinuousBackupInformationSample.ts][gremlinresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a gremlin graph. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphBackupInformation.json | +| [gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts][gremlinresourcesupdategremlindatabasethroughputsample] | Update RUs per second of an Azure Cosmos DB Gremlin database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json | +| [gremlinResourcesUpdateGremlinGraphThroughputSample.ts][gremlinresourcesupdategremlingraphthroughputsample] | Update RUs per second of an Azure Cosmos DB Gremlin graph x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json | +| [locationsGetSample.ts][locationsgetsample] | Get the properties of an existing Cosmos DB location x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json | +| [locationsListSample.ts][locationslistsample] | List Cosmos DB locations and their properties x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationList.json | +| [mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts][mongodbresourcescreateupdatemongodbcollectionsample] | Create or update an Azure Cosmos DB MongoDB Collection x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json | +| [mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts][mongodbresourcescreateupdatemongodbdatabasesample] | Create or updates Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json | +| [mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts][mongodbresourcescreateupdatemongoroledefinitionsample] | Creates or updates an Azure Cosmos DB Mongo Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json | +| [mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts][mongodbresourcescreateupdatemongouserdefinitionsample] | Creates or updates an Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json | +| [mongoDbResourcesDeleteMongoDbcollectionSample.ts][mongodbresourcesdeletemongodbcollectionsample] | Deletes an existing Azure Cosmos DB MongoDB Collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionDelete.json | +| [mongoDbResourcesDeleteMongoDbdatabaseSample.ts][mongodbresourcesdeletemongodbdatabasesample] | Deletes an existing Azure Cosmos DB MongoDB database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseDelete.json | +| [mongoDbResourcesDeleteMongoRoleDefinitionSample.ts][mongodbresourcesdeletemongoroledefinitionsample] | Deletes an existing Azure Cosmos DB Mongo Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json | +| [mongoDbResourcesDeleteMongoUserDefinitionSample.ts][mongodbresourcesdeletemongouserdefinitionsample] | Deletes an existing Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json | +| [mongoDbResourcesGetMongoDbcollectionSample.ts][mongodbresourcesgetmongodbcollectionsample] | Gets the MongoDB collection under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json | +| [mongoDbResourcesGetMongoDbcollectionThroughputSample.ts][mongodbresourcesgetmongodbcollectionthroughputsample] | Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json | +| [mongoDbResourcesGetMongoDbdatabaseSample.ts][mongodbresourcesgetmongodbdatabasesample] | Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json | +| [mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts][mongodbresourcesgetmongodbdatabasethroughputsample] | Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json | +| [mongoDbResourcesGetMongoRoleDefinitionSample.ts][mongodbresourcesgetmongoroledefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json | +| [mongoDbResourcesGetMongoUserDefinitionSample.ts][mongodbresourcesgetmongouserdefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json | +| [mongoDbResourcesListMongoDbcollectionPartitionMergeSample.ts][mongodbresourceslistmongodbcollectionpartitionmergesample] | Merges the partitions of a MongoDB Collection x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json | +| [mongoDbResourcesListMongoDbcollectionsSample.ts][mongodbresourceslistmongodbcollectionssample] | Lists the MongoDB collection under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionList.json | +| [mongoDbResourcesListMongoDbdatabasesSample.ts][mongodbresourceslistmongodbdatabasessample] | Lists the MongoDB databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseList.json | +| [mongoDbResourcesListMongoRoleDefinitionsSample.ts][mongodbresourceslistmongoroledefinitionssample] | Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionList.json | +| [mongoDbResourcesListMongoUserDefinitionsSample.ts][mongodbresourceslistmongouserdefinitionssample] | Retrieves the list of all Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionList.json | +| [mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts][mongodbresourcesmigratemongodbcollectiontoautoscalesample] | Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json | +| [mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts][mongodbresourcesmigratemongodbcollectiontomanualthroughputsample] | Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json | +| [mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts][mongodbresourcesmigratemongodbdatabasetoautoscalesample] | Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json | +| [mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts][mongodbresourcesmigratemongodbdatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json | +| [mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.ts][mongodbresourcesmongodbcontainerredistributethroughputsample] | Redistribute throughput for an Azure Cosmos DB MongoDB container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json | +| [mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.ts][mongodbresourcesmongodbcontainerretrievethroughputdistributionsample] | Retrieve throughput distribution for an Azure Cosmos DB MongoDB container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json | +| [mongoDbResourcesMongoDbdatabasePartitionMergeSample.ts][mongodbresourcesmongodbdatabasepartitionmergesample] | Merges the partitions of a MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json | +| [mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.ts][mongodbresourcesmongodbdatabaseredistributethroughputsample] | Redistribute throughput for an Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json | +| [mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.ts][mongodbresourcesmongodbdatabaseretrievethroughputdistributionsample] | Retrieve throughput distribution for an Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json | +| [mongoDbResourcesRetrieveContinuousBackupInformationSample.ts][mongodbresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a Mongodb collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json | +| [mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts][mongodbresourcesupdatemongodbcollectionthroughputsample] | Update the RUs per second of an Azure Cosmos DB MongoDB collection x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json | +| [mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts][mongodbresourcesupdatemongodbdatabasethroughputsample] | Update RUs per second of the an Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json | +| [networkSecurityPerimeterConfigurationsGetSample.ts][networksecurityperimeterconfigurationsgetsample] | Gets effective Network Security Perimeter Configuration for association x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json | +| [networkSecurityPerimeterConfigurationsListSample.ts][networksecurityperimeterconfigurationslistsample] | Gets list of effective Network Security Perimeter Configuration for cosmos db account x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationList.json | +| [networkSecurityPerimeterConfigurationsReconcileSample.ts][networksecurityperimeterconfigurationsreconcilesample] | Refreshes any information about the association. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json | +| [notebookWorkspacesCreateOrUpdateSample.ts][notebookworkspacescreateorupdatesample] | Creates the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceCreate.json | +| [notebookWorkspacesDeleteSample.ts][notebookworkspacesdeletesample] | Deletes the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceDelete.json | +| [notebookWorkspacesGetSample.ts][notebookworkspacesgetsample] | Gets the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceGet.json | +| [notebookWorkspacesListByDatabaseAccountSample.ts][notebookworkspaceslistbydatabaseaccountsample] | Gets the notebook workspace resources of an existing Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceList.json | +| [notebookWorkspacesListConnectionInfoSample.ts][notebookworkspaceslistconnectioninfosample] | Retrieves the connection info for the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json | +| [notebookWorkspacesRegenerateAuthTokenSample.ts][notebookworkspacesregenerateauthtokensample] | Regenerates the auth token for the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json | +| [notebookWorkspacesStartSample.ts][notebookworkspacesstartsample] | Starts the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceStart.json | +| [operationsListSample.ts][operationslistsample] | Lists all of the available Cosmos DB Resource Provider operations. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBOperationsList.json | +| [partitionKeyRangeIdListMetricsSample.ts][partitionkeyrangeidlistmetricssample] | Retrieves the metrics determined by the given filter for the given partition key range id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json | +| [partitionKeyRangeIdRegionListMetricsSample.ts][partitionkeyrangeidregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given partition key range id and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json | +| [percentileListMetricsSample.ts][percentilelistmetricssample] | Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileGetMetrics.json | +| [percentileSourceTargetListMetricsSample.ts][percentilesourcetargetlistmetricssample] | Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json | +| [percentileTargetListMetricsSample.ts][percentiletargetlistmetricssample] | Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileTargetGetMetrics.json | +| [privateEndpointConnectionsCreateOrUpdateSample.ts][privateendpointconnectionscreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json | +| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json | +| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json | +| [privateEndpointConnectionsListByDatabaseAccountSample.ts][privateendpointconnectionslistbydatabaseaccountsample] | List all private endpoint connections on a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json | +| [privateLinkResourcesGetSample.ts][privatelinkresourcesgetsample] | Gets the private link resources that need to be created for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json | +| [privateLinkResourcesListByDatabaseAccountSample.ts][privatelinkresourceslistbydatabaseaccountsample] | Gets the private link resources that need to be created for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceListGet.json | +| [restorableDatabaseAccountsGetByLocationSample.ts][restorabledatabaseaccountsgetbylocationsample] | Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/\*' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json | +| [restorableDatabaseAccountsListByLocationSample.ts][restorabledatabaseaccountslistbylocationsample] | Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json | +| [restorableDatabaseAccountsListSample.ts][restorabledatabaseaccountslistsample] | Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json | +| [restorableGremlinDatabasesListSample.ts][restorablegremlindatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinDatabaseList.json | +| [restorableGremlinGraphsListSample.ts][restorablegremlingraphslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinGraphList.json | +| [restorableGremlinResourcesListSample.ts][restorablegremlinresourceslistsample] | Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinResourceList.json | +| [restorableMongodbCollectionsListSample.ts][restorablemongodbcollectionslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbCollectionList.json | +| [restorableMongodbDatabasesListSample.ts][restorablemongodbdatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbDatabaseList.json | +| [restorableMongodbResourcesListSample.ts][restorablemongodbresourceslistsample] | Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbResourceList.json | +| [restorableSqlContainersListSample.ts][restorablesqlcontainerslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlContainerList.json | +| [restorableSqlDatabasesListSample.ts][restorablesqldatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlDatabaseList.json | +| [restorableSqlResourcesListSample.ts][restorablesqlresourceslistsample] | Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlResourceList.json | +| [restorableTableResourcesListSample.ts][restorabletableresourceslistsample] | Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableResourceList.json | +| [restorableTablesListSample.ts][restorabletableslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableList.json | +| [serviceCreateSample.ts][servicecreatesample] | Creates a service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceCreate.json | +| [serviceDeleteSample.ts][servicedeletesample] | Deletes service with the given serviceName. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceDelete.json | +| [serviceGetSample.ts][servicegetsample] | Gets the status of service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json | +| [serviceListSample.ts][servicelistsample] | Gets the status of service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBServicesList.json | +| [sqlResourcesCreateUpdateClientEncryptionKeySample.ts][sqlresourcescreateupdateclientencryptionkeysample] | Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlContainerSample.ts][sqlresourcescreateupdatesqlcontainersample] | Create or update an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlDatabaseSample.ts][sqlresourcescreateupdatesqldatabasesample] | Create or update an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts][sqlresourcescreateupdatesqlroleassignmentsample] | Creates or updates an Azure Cosmos DB SQL Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts][sqlresourcescreateupdatesqlroledefinitionsample] | Creates or updates an Azure Cosmos DB SQL Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlStoredProcedureSample.ts][sqlresourcescreateupdatesqlstoredproceduresample] | Create or update an Azure Cosmos DB SQL storedProcedure x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlTriggerSample.ts][sqlresourcescreateupdatesqltriggersample] | Create or update an Azure Cosmos DB SQL trigger x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json | +| [sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts][sqlresourcescreateupdatesqluserdefinedfunctionsample] | Create or update an Azure Cosmos DB SQL userDefinedFunction x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json | +| [sqlResourcesDeleteSqlContainerSample.ts][sqlresourcesdeletesqlcontainersample] | Deletes an existing Azure Cosmos DB SQL container. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerDelete.json | +| [sqlResourcesDeleteSqlDatabaseSample.ts][sqlresourcesdeletesqldatabasesample] | Deletes an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseDelete.json | +| [sqlResourcesDeleteSqlRoleAssignmentSample.ts][sqlresourcesdeletesqlroleassignmentsample] | Deletes an existing Azure Cosmos DB SQL Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json | +| [sqlResourcesDeleteSqlRoleDefinitionSample.ts][sqlresourcesdeletesqlroledefinitionsample] | Deletes an existing Azure Cosmos DB SQL Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json | +| [sqlResourcesDeleteSqlStoredProcedureSample.ts][sqlresourcesdeletesqlstoredproceduresample] | Deletes an existing Azure Cosmos DB SQL storedProcedure. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureDelete.json | +| [sqlResourcesDeleteSqlTriggerSample.ts][sqlresourcesdeletesqltriggersample] | Deletes an existing Azure Cosmos DB SQL trigger. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerDelete.json | +| [sqlResourcesDeleteSqlUserDefinedFunctionSample.ts][sqlresourcesdeletesqluserdefinedfunctionsample] | Deletes an existing Azure Cosmos DB SQL userDefinedFunction. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json | +| [sqlResourcesGetClientEncryptionKeySample.ts][sqlresourcesgetclientencryptionkeysample] | Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json | +| [sqlResourcesGetSqlContainerSample.ts][sqlresourcesgetsqlcontainersample] | Gets the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json | +| [sqlResourcesGetSqlContainerThroughputSample.ts][sqlresourcesgetsqlcontainerthroughputsample] | Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputGet.json | +| [sqlResourcesGetSqlDatabaseSample.ts][sqlresourcesgetsqldatabasesample] | Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json | +| [sqlResourcesGetSqlDatabaseThroughputSample.ts][sqlresourcesgetsqldatabasethroughputsample] | Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputGet.json | +| [sqlResourcesGetSqlRoleAssignmentSample.ts][sqlresourcesgetsqlroleassignmentsample] | Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json | +| [sqlResourcesGetSqlRoleDefinitionSample.ts][sqlresourcesgetsqlroledefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json | +| [sqlResourcesGetSqlStoredProcedureSample.ts][sqlresourcesgetsqlstoredproceduresample] | Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json | +| [sqlResourcesGetSqlTriggerSample.ts][sqlresourcesgetsqltriggersample] | Gets the SQL trigger under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json | +| [sqlResourcesGetSqlUserDefinedFunctionSample.ts][sqlresourcesgetsqluserdefinedfunctionsample] | Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json | +| [sqlResourcesListClientEncryptionKeysSample.ts][sqlresourceslistclientencryptionkeyssample] | Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeysList.json | +| [sqlResourcesListSqlContainerPartitionMergeSample.ts][sqlresourceslistsqlcontainerpartitionmergesample] | Merges the partitions of a SQL Container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerPartitionMerge.json | +| [sqlResourcesListSqlContainersSample.ts][sqlresourceslistsqlcontainerssample] | Lists the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerList.json | +| [sqlResourcesListSqlDatabasesSample.ts][sqlresourceslistsqldatabasessample] | Lists the SQL databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseList.json | +| [sqlResourcesListSqlRoleAssignmentsSample.ts][sqlresourceslistsqlroleassignmentssample] | Retrieves the list of all Azure Cosmos DB SQL Role Assignments. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentList.json | +| [sqlResourcesListSqlRoleDefinitionsSample.ts][sqlresourceslistsqlroledefinitionssample] | Retrieves the list of all Azure Cosmos DB SQL Role Definitions. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionList.json | +| [sqlResourcesListSqlStoredProceduresSample.ts][sqlresourceslistsqlstoredproceduressample] | Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureList.json | +| [sqlResourcesListSqlTriggersSample.ts][sqlresourceslistsqltriggerssample] | Lists the SQL trigger under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerList.json | +| [sqlResourcesListSqlUserDefinedFunctionsSample.ts][sqlresourceslistsqluserdefinedfunctionssample] | Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionList.json | +| [sqlResourcesMigrateSqlContainerToAutoscaleSample.ts][sqlresourcesmigratesqlcontainertoautoscalesample] | Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json | +| [sqlResourcesMigrateSqlContainerToManualThroughputSample.ts][sqlresourcesmigratesqlcontainertomanualthroughputsample] | Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json | +| [sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts][sqlresourcesmigratesqldatabasetoautoscalesample] | Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json | +| [sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts][sqlresourcesmigratesqldatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json | +| [sqlResourcesRetrieveContinuousBackupInformationSample.ts][sqlresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a container resource. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerBackupInformation.json | +| [sqlResourcesSqlContainerRedistributeThroughputSample.ts][sqlresourcessqlcontainerredistributethroughputsample] | Redistribute throughput for an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json | +| [sqlResourcesSqlContainerRetrieveThroughputDistributionSample.ts][sqlresourcessqlcontainerretrievethroughputdistributionsample] | Retrieve throughput distribution for an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json | +| [sqlResourcesSqlDatabasePartitionMergeSample.ts][sqlresourcessqldatabasepartitionmergesample] | Merges the partitions of a SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabasePartitionMerge.json | +| [sqlResourcesSqlDatabaseRedistributeThroughputSample.ts][sqlresourcessqldatabaseredistributethroughputsample] | Redistribute throughput for an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json | +| [sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.ts][sqlresourcessqldatabaseretrievethroughputdistributionsample] | Retrieve throughput distribution for an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json | +| [sqlResourcesUpdateSqlContainerThroughputSample.ts][sqlresourcesupdatesqlcontainerthroughputsample] | Update RUs per second of an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputUpdate.json | +| [sqlResourcesUpdateSqlDatabaseThroughputSample.ts][sqlresourcesupdatesqldatabasethroughputsample] | Update RUs per second of an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json | +| [tableResourcesCreateUpdateTableRoleAssignmentSample.ts][tableresourcescreateupdatetableroleassignmentsample] | Creates or updates an Azure Cosmos DB Table Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json | +| [tableResourcesCreateUpdateTableRoleDefinitionSample.ts][tableresourcescreateupdatetableroledefinitionsample] | Creates or updates an Azure Cosmos DB Table Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json | +| [tableResourcesCreateUpdateTableSample.ts][tableresourcescreateupdatetablesample] | Create or update an Azure Cosmos DB Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableCreateUpdate.json | +| [tableResourcesDeleteTableRoleAssignmentSample.ts][tableresourcesdeletetableroleassignmentsample] | Deletes an existing Azure Cosmos DB Table Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentDelete.json | +| [tableResourcesDeleteTableRoleDefinitionSample.ts][tableresourcesdeletetableroledefinitionsample] | Deletes an existing Azure Cosmos DB Table Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionDelete.json | +| [tableResourcesDeleteTableSample.ts][tableresourcesdeletetablesample] | Deletes an existing Azure Cosmos DB Table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableDelete.json | +| [tableResourcesGetTableRoleAssignmentSample.ts][tableresourcesgettableroleassignmentsample] | Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json | +| [tableResourcesGetTableRoleDefinitionSample.ts][tableresourcesgettableroledefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json | +| [tableResourcesGetTableSample.ts][tableresourcesgettablesample] | Gets the Tables under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json | +| [tableResourcesGetTableThroughputSample.ts][tableresourcesgettablethroughputsample] | Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputGet.json | +| [tableResourcesListTableRoleAssignmentsSample.ts][tableresourceslisttableroleassignmentssample] | Retrieves the list of all Azure Cosmos DB Table Role Assignments. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentList.json | +| [tableResourcesListTableRoleDefinitionsSample.ts][tableresourceslisttableroledefinitionssample] | Retrieves the list of all Azure Cosmos DB Table Role Definitions. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionList.json | +| [tableResourcesListTablesSample.ts][tableresourceslisttablessample] | Lists the Tables under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableList.json | +| [tableResourcesMigrateTableToAutoscaleSample.ts][tableresourcesmigratetabletoautoscalesample] | Migrate an Azure Cosmos DB Table from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToAutoscale.json | +| [tableResourcesMigrateTableToManualThroughputSample.ts][tableresourcesmigratetabletomanualthroughputsample] | Migrate an Azure Cosmos DB Table from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToManualThroughput.json | +| [tableResourcesRetrieveContinuousBackupInformationSample.ts][tableresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableBackupInformation.json | +| [tableResourcesUpdateTableThroughputSample.ts][tableresourcesupdatetablethroughputsample] | Update RUs per second of an Azure Cosmos DB Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputUpdate.json | +| [throughputPoolAccountCreateSample.ts][throughputpoolaccountcreatesample] | Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json | +| [throughputPoolAccountDeleteSample.ts][throughputpoolaccountdeletesample] | Removes an existing Azure Cosmos DB database account from a throughput pool. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json | +| [throughputPoolAccountGetSample.ts][throughputpoolaccountgetsample] | Retrieves the properties of an existing Azure Cosmos DB Throughput Pool x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json | +| [throughputPoolAccountsListSample.ts][throughputpoolaccountslistsample] | Lists all the Azure Cosmos DB accounts available under the subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json | +| [throughputPoolCreateOrUpdateSample.ts][throughputpoolcreateorupdatesample] | Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json | +| [throughputPoolDeleteSample.ts][throughputpooldeletesample] | Deletes an existing Azure Cosmos DB Throughput Pool. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json | +| [throughputPoolGetSample.ts][throughputpoolgetsample] | Retrieves the properties of an existing Azure Cosmos DB Throughput Pool x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json | +| [throughputPoolUpdateSample.ts][throughputpoolupdatesample] | Updates the properties of an existing Azure Cosmos DB Throughput Pool. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json | +| [throughputPoolsListByResourceGroupSample.ts][throughputpoolslistbyresourcegroupsample] | List all the ThroughputPools in a given resource group. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json | +| [throughputPoolsListSample.ts][throughputpoolslistsample] | Lists all the Azure Cosmos DB Throughput Pools available under the subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/cassandraClustersCreateUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx dev-tool run vendored cross-env COSMOSDB_SUBSCRIPTION_ID="" COSMOSDB_RESOURCE_GROUP="" node dist/cassandraClustersCreateUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[cassandraclusterscreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersCreateUpdateSample.ts +[cassandraclustersdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersDeallocateSample.ts +[cassandraclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersDeleteSample.ts +[cassandraclustersgetbackupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetBackupSample.ts +[cassandraclustersgetcommandasyncsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetCommandAsyncSample.ts +[cassandraclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetSample.ts +[cassandraclustersinvokecommandasyncsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersInvokeCommandAsyncSample.ts +[cassandraclustersinvokecommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersInvokeCommandSample.ts +[cassandraclusterslistbackupssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListBackupsSample.ts +[cassandraclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListByResourceGroupSample.ts +[cassandraclusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListBySubscriptionSample.ts +[cassandraclusterslistcommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListCommandSample.ts +[cassandraclustersstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersStartSample.ts +[cassandraclustersstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersStatusSample.ts +[cassandraclustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersUpdateSample.ts +[cassandradatacenterscreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersCreateUpdateSample.ts +[cassandradatacentersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersDeleteSample.ts +[cassandradatacentersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersGetSample.ts +[cassandradatacenterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersListSample.ts +[cassandradatacentersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersUpdateSample.ts +[cassandraresourcescreateupdatecassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts +[cassandraresourcescreateupdatecassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraTableSample.ts +[cassandraresourcescreateupdatecassandraviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraViewSample.ts +[cassandraresourcesdeletecassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraKeyspaceSample.ts +[cassandraresourcesdeletecassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraTableSample.ts +[cassandraresourcesdeletecassandraviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraViewSample.ts +[cassandraresourcesgetcassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraKeyspaceSample.ts +[cassandraresourcesgetcassandrakeyspacethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts +[cassandraresourcesgetcassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraTableSample.ts +[cassandraresourcesgetcassandratablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraTableThroughputSample.ts +[cassandraresourcesgetcassandraviewsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraViewSample.ts +[cassandraresourcesgetcassandraviewthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraViewThroughputSample.ts +[cassandraresourceslistcassandrakeyspacessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraKeyspacesSample.ts +[cassandraresourceslistcassandratablessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraTablesSample.ts +[cassandraresourceslistcassandraviewssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraViewsSample.ts +[cassandraresourcesmigratecassandrakeyspacetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts +[cassandraresourcesmigratecassandrakeyspacetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts +[cassandraresourcesmigratecassandratabletoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts +[cassandraresourcesmigratecassandratabletomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts +[cassandraresourcesmigratecassandraviewtoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraViewToAutoscaleSample.ts +[cassandraresourcesmigratecassandraviewtomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraViewToManualThroughputSample.ts +[cassandraresourcesupdatecassandrakeyspacethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts +[cassandraresourcesupdatecassandratablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraTableThroughputSample.ts +[cassandraresourcesupdatecassandraviewthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraViewThroughputSample.ts +[chaosfaultenabledisablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultEnableDisableSample.ts +[chaosfaultgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultGetSample.ts +[chaosfaultlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultListSample.ts +[collectionlistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListMetricDefinitionsSample.ts +[collectionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListMetricsSample.ts +[collectionlistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListUsagesSample.ts +[collectionpartitionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionListMetricsSample.ts +[collectionpartitionlistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionListUsagesSample.ts +[collectionpartitionregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionRegionListMetricsSample.ts +[collectionregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionRegionListMetricsSample.ts +[datatransferjobscancelsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCancelSample.ts +[datatransferjobscompletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCompleteSample.ts +[datatransferjobscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCreateSample.ts +[datatransferjobsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsGetSample.ts +[datatransferjobslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsListByDatabaseAccountSample.ts +[datatransferjobspausesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsPauseSample.ts +[datatransferjobsresumesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsResumeSample.ts +[databaseaccountregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountRegionListMetricsSample.ts +[databaseaccountschecknameexistssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsCheckNameExistsSample.ts +[databaseaccountscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsCreateOrUpdateSample.ts +[databaseaccountsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsDeleteSample.ts +[databaseaccountsfailoverprioritychangesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsFailoverPriorityChangeSample.ts +[databaseaccountsgetreadonlykeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsGetReadOnlyKeysSample.ts +[databaseaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsGetSample.ts +[databaseaccountslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListByResourceGroupSample.ts +[databaseaccountslistconnectionstringssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListConnectionStringsSample.ts +[databaseaccountslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListKeysSample.ts +[databaseaccountslistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListMetricDefinitionsSample.ts +[databaseaccountslistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListMetricsSample.ts +[databaseaccountslistreadonlykeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListReadOnlyKeysSample.ts +[databaseaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListSample.ts +[databaseaccountslistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListUsagesSample.ts +[databaseaccountsofflineregionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsOfflineRegionSample.ts +[databaseaccountsonlineregionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsOnlineRegionSample.ts +[databaseaccountsregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsRegenerateKeySample.ts +[databaseaccountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsUpdateSample.ts +[databaselistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListMetricDefinitionsSample.ts +[databaselistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListMetricsSample.ts +[databaselistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListUsagesSample.ts +[graphresourcescreateupdategraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesCreateUpdateGraphSample.ts +[graphresourcesdeletegraphresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesDeleteGraphResourceSample.ts +[graphresourcesgetgraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesGetGraphSample.ts +[graphresourceslistgraphssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesListGraphsSample.ts +[gremlinresourcescreateupdategremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts +[gremlinresourcescreateupdategremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesCreateUpdateGremlinGraphSample.ts +[gremlinresourcesdeletegremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesDeleteGremlinDatabaseSample.ts +[gremlinresourcesdeletegremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesDeleteGremlinGraphSample.ts +[gremlinresourcesgetgremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinDatabaseSample.ts +[gremlinresourcesgetgremlindatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinDatabaseThroughputSample.ts +[gremlinresourcesgetgremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinGraphSample.ts +[gremlinresourcesgetgremlingraphthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinGraphThroughputSample.ts +[gremlinresourceslistgremlindatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesListGremlinDatabasesSample.ts +[gremlinresourceslistgremlingraphssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesListGremlinGraphsSample.ts +[gremlinresourcesmigrategremlindatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts +[gremlinresourcesmigrategremlindatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts +[gremlinresourcesmigrategremlingraphtoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts +[gremlinresourcesmigrategremlingraphtomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts +[gremlinresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesRetrieveContinuousBackupInformationSample.ts +[gremlinresourcesupdategremlindatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts +[gremlinresourcesupdategremlingraphthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesUpdateGremlinGraphThroughputSample.ts +[locationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/locationsGetSample.ts +[locationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/locationsListSample.ts +[mongodbresourcescreateupdatemongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts +[mongodbresourcescreateupdatemongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts +[mongodbresourcescreateupdatemongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts +[mongodbresourcescreateupdatemongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts +[mongodbresourcesdeletemongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoDbcollectionSample.ts +[mongodbresourcesdeletemongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoDbdatabaseSample.ts +[mongodbresourcesdeletemongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts +[mongodbresourcesdeletemongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoUserDefinitionSample.ts +[mongodbresourcesgetmongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbcollectionSample.ts +[mongodbresourcesgetmongodbcollectionthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts +[mongodbresourcesgetmongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbdatabaseSample.ts +[mongodbresourcesgetmongodbdatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts +[mongodbresourcesgetmongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoRoleDefinitionSample.ts +[mongodbresourcesgetmongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoUserDefinitionSample.ts +[mongodbresourceslistmongodbcollectionpartitionmergesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbcollectionPartitionMergeSample.ts +[mongodbresourceslistmongodbcollectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbcollectionsSample.ts +[mongodbresourceslistmongodbdatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbdatabasesSample.ts +[mongodbresourceslistmongoroledefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoRoleDefinitionsSample.ts +[mongodbresourceslistmongouserdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoUserDefinitionsSample.ts +[mongodbresourcesmigratemongodbcollectiontoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts +[mongodbresourcesmigratemongodbcollectiontomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts +[mongodbresourcesmigratemongodbdatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts +[mongodbresourcesmigratemongodbdatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts +[mongodbresourcesmongodbcontainerredistributethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.ts +[mongodbresourcesmongodbcontainerretrievethroughputdistributionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.ts +[mongodbresourcesmongodbdatabasepartitionmergesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabasePartitionMergeSample.ts +[mongodbresourcesmongodbdatabaseredistributethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.ts +[mongodbresourcesmongodbdatabaseretrievethroughputdistributionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.ts +[mongodbresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts +[mongodbresourcesupdatemongodbcollectionthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts +[mongodbresourcesupdatemongodbdatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts +[networksecurityperimeterconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsGetSample.ts +[networksecurityperimeterconfigurationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsListSample.ts +[networksecurityperimeterconfigurationsreconcilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsReconcileSample.ts +[notebookworkspacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesCreateOrUpdateSample.ts +[notebookworkspacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesDeleteSample.ts +[notebookworkspacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesGetSample.ts +[notebookworkspaceslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesListByDatabaseAccountSample.ts +[notebookworkspaceslistconnectioninfosample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesListConnectionInfoSample.ts +[notebookworkspacesregenerateauthtokensample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesRegenerateAuthTokenSample.ts +[notebookworkspacesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesStartSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/operationsListSample.ts +[partitionkeyrangeidlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/partitionKeyRangeIdListMetricsSample.ts +[partitionkeyrangeidregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/partitionKeyRangeIdRegionListMetricsSample.ts +[percentilelistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileListMetricsSample.ts +[percentilesourcetargetlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileSourceTargetListMetricsSample.ts +[percentiletargetlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileTargetListMetricsSample.ts +[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsGetSample.ts +[privateendpointconnectionslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsListByDatabaseAccountSample.ts +[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateLinkResourcesGetSample.ts +[privatelinkresourceslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateLinkResourcesListByDatabaseAccountSample.ts +[restorabledatabaseaccountsgetbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsGetByLocationSample.ts +[restorabledatabaseaccountslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsListByLocationSample.ts +[restorabledatabaseaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsListSample.ts +[restorablegremlindatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinDatabasesListSample.ts +[restorablegremlingraphslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinGraphsListSample.ts +[restorablegremlinresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinResourcesListSample.ts +[restorablemongodbcollectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbCollectionsListSample.ts +[restorablemongodbdatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbDatabasesListSample.ts +[restorablemongodbresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbResourcesListSample.ts +[restorablesqlcontainerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlContainersListSample.ts +[restorablesqldatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlDatabasesListSample.ts +[restorablesqlresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlResourcesListSample.ts +[restorabletableresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableTableResourcesListSample.ts +[restorabletableslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableTablesListSample.ts +[servicecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceCreateSample.ts +[servicedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceDeleteSample.ts +[servicegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceGetSample.ts +[servicelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceListSample.ts +[sqlresourcescreateupdateclientencryptionkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateClientEncryptionKeySample.ts +[sqlresourcescreateupdatesqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlContainerSample.ts +[sqlresourcescreateupdatesqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlDatabaseSample.ts +[sqlresourcescreateupdatesqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts +[sqlresourcescreateupdatesqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts +[sqlresourcescreateupdatesqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts +[sqlresourcescreateupdatesqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlTriggerSample.ts +[sqlresourcescreateupdatesqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts +[sqlresourcesdeletesqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlContainerSample.ts +[sqlresourcesdeletesqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlDatabaseSample.ts +[sqlresourcesdeletesqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlRoleAssignmentSample.ts +[sqlresourcesdeletesqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlRoleDefinitionSample.ts +[sqlresourcesdeletesqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlStoredProcedureSample.ts +[sqlresourcesdeletesqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlTriggerSample.ts +[sqlresourcesdeletesqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts +[sqlresourcesgetclientencryptionkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetClientEncryptionKeySample.ts +[sqlresourcesgetsqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlContainerSample.ts +[sqlresourcesgetsqlcontainerthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlContainerThroughputSample.ts +[sqlresourcesgetsqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlDatabaseSample.ts +[sqlresourcesgetsqldatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlDatabaseThroughputSample.ts +[sqlresourcesgetsqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlRoleAssignmentSample.ts +[sqlresourcesgetsqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlRoleDefinitionSample.ts +[sqlresourcesgetsqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlStoredProcedureSample.ts +[sqlresourcesgetsqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlTriggerSample.ts +[sqlresourcesgetsqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlUserDefinedFunctionSample.ts +[sqlresourceslistclientencryptionkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListClientEncryptionKeysSample.ts +[sqlresourceslistsqlcontainerpartitionmergesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlContainerPartitionMergeSample.ts +[sqlresourceslistsqlcontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlContainersSample.ts +[sqlresourceslistsqldatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlDatabasesSample.ts +[sqlresourceslistsqlroleassignmentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlRoleAssignmentsSample.ts +[sqlresourceslistsqlroledefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlRoleDefinitionsSample.ts +[sqlresourceslistsqlstoredproceduressample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlStoredProceduresSample.ts +[sqlresourceslistsqltriggerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlTriggersSample.ts +[sqlresourceslistsqluserdefinedfunctionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlUserDefinedFunctionsSample.ts +[sqlresourcesmigratesqlcontainertoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts +[sqlresourcesmigratesqlcontainertomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts +[sqlresourcesmigratesqldatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts +[sqlresourcesmigratesqldatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts +[sqlresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesRetrieveContinuousBackupInformationSample.ts +[sqlresourcessqlcontainerredistributethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlContainerRedistributeThroughputSample.ts +[sqlresourcessqlcontainerretrievethroughputdistributionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlContainerRetrieveThroughputDistributionSample.ts +[sqlresourcessqldatabasepartitionmergesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabasePartitionMergeSample.ts +[sqlresourcessqldatabaseredistributethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabaseRedistributeThroughputSample.ts +[sqlresourcessqldatabaseretrievethroughputdistributionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.ts +[sqlresourcesupdatesqlcontainerthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesUpdateSqlContainerThroughputSample.ts +[sqlresourcesupdatesqldatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesUpdateSqlDatabaseThroughputSample.ts +[tableresourcescreateupdatetableroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableRoleAssignmentSample.ts +[tableresourcescreateupdatetableroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableRoleDefinitionSample.ts +[tableresourcescreateupdatetablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableSample.ts +[tableresourcesdeletetableroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableRoleAssignmentSample.ts +[tableresourcesdeletetableroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableRoleDefinitionSample.ts +[tableresourcesdeletetablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableSample.ts +[tableresourcesgettableroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableRoleAssignmentSample.ts +[tableresourcesgettableroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableRoleDefinitionSample.ts +[tableresourcesgettablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableSample.ts +[tableresourcesgettablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableThroughputSample.ts +[tableresourceslisttableroleassignmentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTableRoleAssignmentsSample.ts +[tableresourceslisttableroledefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTableRoleDefinitionsSample.ts +[tableresourceslisttablessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTablesSample.ts +[tableresourcesmigratetabletoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesMigrateTableToAutoscaleSample.ts +[tableresourcesmigratetabletomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesMigrateTableToManualThroughputSample.ts +[tableresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesRetrieveContinuousBackupInformationSample.ts +[tableresourcesupdatetablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesUpdateTableThroughputSample.ts +[throughputpoolaccountcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountCreateSample.ts +[throughputpoolaccountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountDeleteSample.ts +[throughputpoolaccountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountGetSample.ts +[throughputpoolaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountsListSample.ts +[throughputpoolcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolCreateOrUpdateSample.ts +[throughputpooldeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolDeleteSample.ts +[throughputpoolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolGetSample.ts +[throughputpoolupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolUpdateSample.ts +[throughputpoolslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolsListByResourceGroupSample.ts +[throughputpoolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolsListSample.ts +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-cosmosdb?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/arm-cosmosdb/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/package.json b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/package.json similarity index 81% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/package.json rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/package.json index 8bb3e6ea8d4a..ec1f97a8dbe6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/package.json +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/package.json @@ -1,8 +1,8 @@ { - "name": "@azure-samples/arm-cosmosdb-ts", + "name": "@azure-samples/arm-cosmosdb-ts-beta", "private": true, "version": "1.0.0", - "description": " client library samples for TypeScript", + "description": " client library samples for TypeScript (Beta)", "engines": { "node": ">=18.0.0" }, @@ -29,13 +29,13 @@ }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/arm-cosmosdb", "dependencies": { - "@azure/arm-cosmosdb": "latest", + "@azure/arm-cosmosdb": "next", "dotenv": "latest", "@azure/identity": "^4.2.1" }, "devDependencies": { "@types/node": "^18.0.0", - "typescript": "~5.7.2", + "typescript": "~5.6.2", "rimraf": "latest" } } diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/sample.env b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/sample.env similarity index 100% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/sample.env rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/sample.env diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersCreateUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersCreateUpdateSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersCreateUpdateSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersCreateUpdateSample.ts index 8bca62048601..411d70202b20 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersCreateUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersCreateUpdateSample.ts @@ -10,20 +10,18 @@ // Licensed under the MIT License. import { ClusterResource, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. * * @summary Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterCreate.json */ async function cosmosDbManagedCassandraClusterCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || - "ffffffff-ffff-ffff-ffff-ffffffffffff"; + "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersDeallocateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersDeallocateSample.ts similarity index 89% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersDeallocateSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersDeallocateSample.ts index f9921c9e8fe1..75d22f0fc4b2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersDeallocateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersDeallocateSample.ts @@ -10,20 +10,18 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. * * @summary Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDeallocate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json */ async function cosmosDbManagedCassandraClusterDeallocate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || - "ffffffff-ffff-ffff-ffff-ffffffffffff"; + "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersDeleteSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersDeleteSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersDeleteSample.ts index 305528d5a968..e10b930b7720 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes a managed Cassandra cluster. * * @summary Deletes a managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterDelete.json */ async function cosmosDbManagedCassandraClusterDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetBackupSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetBackupSample.ts new file mode 100644 index 000000000000..f05cbb420245 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetBackupSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get the properties of an individual backup of this cluster that is available to restore. + * + * @summary Get the properties of an individual backup of this cluster that is available to restore. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackup.json + */ +async function cosmosDbManagedCassandraBackup() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const backupId = "1611250348"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraClusters.getBackup( + resourceGroupName, + clusterName, + backupId, + ); + console.log(result); +} + +async function main() { + cosmosDbManagedCassandraBackup(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetCommandAsyncSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetCommandAsyncSample.ts new file mode 100644 index 000000000000..f2437218b52c --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetCommandAsyncSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get details about a specified command that was run asynchronously. + * + * @summary Get details about a specified command that was run asynchronously. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandResult.json + */ +async function cosmosDbManagedCassandraCommandResult() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const commandId = "318653d0-3da5-4814-b8f6-429f2af0b2a4"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraClusters.getCommandAsync( + resourceGroupName, + clusterName, + commandId, + ); + console.log(result); +} + +async function main() { + cosmosDbManagedCassandraCommandResult(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersGetSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetSample.ts index 6819bbc9eda0..cd610e8f66d7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the properties of a managed Cassandra cluster. * * @summary Get the properties of a managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterGet.json */ async function cosmosDbManagedCassandraClusterGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersInvokeCommandAsyncSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersInvokeCommandAsyncSample.ts new file mode 100644 index 000000000000..ec06e542f3b0 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersInvokeCommandAsyncSample.ts @@ -0,0 +1,50 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CommandAsyncPostBody, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Invoke a command like nodetool for cassandra maintenance asynchronously + * + * @summary Invoke a command like nodetool for cassandra maintenance asynchronously + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommandAsync.json + */ +async function cosmosDbManagedCassandraCommandAsync() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const body: CommandAsyncPostBody = { + arguments: { status: "" }, + command: "nodetool", + host: "10.0.1.12", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraClusters.beginInvokeCommandAsyncAndWait( + resourceGroupName, + clusterName, + body, + ); + console.log(result); +} + +async function main() { + cosmosDbManagedCassandraCommandAsync(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersInvokeCommandSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersInvokeCommandSample.ts similarity index 86% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersInvokeCommandSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersInvokeCommandSample.ts index fb53183bd163..d9508c107232 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersInvokeCommandSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersInvokeCommandSample.ts @@ -10,25 +10,24 @@ // Licensed under the MIT License. import { CommandPostBody, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Invoke a command like nodetool for cassandra maintenance * * @summary Invoke a command like nodetool for cassandra maintenance - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraCommand.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraCommand.json */ async function cosmosDbManagedCassandraCommand() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || - "ffffffff-ffff-ffff-ffff-ffffffffffff"; + "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; const body: CommandPostBody = { - command: "nodetool status", + arguments: { status: "" }, + command: "nodetool", host: "10.0.1.12", }; const credential = new DefaultAzureCredential(); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListBackupsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListBackupsSample.ts new file mode 100644 index 000000000000..43f156df7fa2 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListBackupsSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to List the backups of this cluster that are available to restore. + * + * @summary List the backups of this cluster that are available to restore. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraBackupsList.json + */ +async function cosmosDbManagedCassandraBackupsList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cassandraClusters.listBackups( + resourceGroupName, + clusterName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbManagedCassandraBackupsList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersListByResourceGroupSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListByResourceGroupSample.ts similarity index 89% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersListByResourceGroupSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListByResourceGroupSample.ts index 4c761b69428b..c22224e47a7a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersListByResourceGroupSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListByResourceGroupSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to List all managed Cassandra clusters in this resource group. * * @summary List all managed Cassandra clusters in this resource group. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json */ async function cosmosDbManagedCassandraClusterListByResourceGroup() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersListBySubscriptionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListBySubscriptionSample.ts similarity index 88% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersListBySubscriptionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListBySubscriptionSample.ts index 6a527fcb2480..8fdfcf27e81e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersListBySubscriptionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListBySubscriptionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to List all managed Cassandra clusters in this subscription. * * @summary List all managed Cassandra clusters in this subscription. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json */ async function cosmosDbManagedCassandraClusterListBySubscription() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListCommandSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListCommandSample.ts new file mode 100644 index 000000000000..c028d0d73de5 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersListCommandSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to List all commands currently running on ring info + * + * @summary List all commands currently running on ring info + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraListCommand.json + */ +async function cosmosDbManagedCassandraListCommand() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; + const clusterName = "cassandra-prod"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cassandraClusters.listCommand( + resourceGroupName, + clusterName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbManagedCassandraListCommand(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersStartSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersStartSample.ts similarity index 89% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersStartSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersStartSample.ts index 01ce3133be11..190c9122fd02 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersStartSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersStartSample.ts @@ -10,20 +10,18 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. * * @summary Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterStart.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterStart.json */ async function cosmosDbManagedCassandraClusterStart() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || - "ffffffff-ffff-ffff-ffff-ffffffffffff"; + "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersStatusSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersStatusSample.ts similarity index 88% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersStatusSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersStatusSample.ts index 4611df59ed61..ccfc6aea3692 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersStatusSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersStatusSample.ts @@ -10,20 +10,18 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. * * @summary Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraStatus.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraStatus.json */ async function cosmosDbManagedCassandraStatus() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || - "ffffffff-ffff-ffff-ffff-ffffffffffff"; + "00000000-0000-0000-0000-000000000000"; const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "cassandra-prod-rg"; const clusterName = "cassandra-prod"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersUpdateSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersUpdateSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersUpdateSample.ts index 7f32c64094ac..f6b18c085210 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraClustersUpdateSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { ClusterResource, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Updates some of the properties of a managed Cassandra cluster. * * @summary Updates some of the properties of a managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterPatch.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraClusterPatch.json */ async function cosmosDbManagedCassandraClusterPatch() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersCreateUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersCreateUpdateSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersCreateUpdateSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersCreateUpdateSample.ts index 0063d200cede..685b80b61a58 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersCreateUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersCreateUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. * * @summary Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json */ async function cosmosDbManagedCassandraDataCenterCreate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersDeleteSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersDeleteSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersDeleteSample.ts index 6fbb7c22e9eb..e92bf2fbaf18 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Delete a managed Cassandra data center. * * @summary Delete a managed Cassandra data center. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json */ async function cosmosDbManagedCassandraDataCenterDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersGetSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersGetSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersGetSample.ts index 2f318343f58c..5bc746eadf3e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the properties of a managed Cassandra data center. * * @summary Get the properties of a managed Cassandra data center. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json */ async function cosmosDbManagedCassandraDataCenterGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersListSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersListSample.ts index f8785f6bb8d0..3e9c05ba21ea 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to List all data centers in a particular managed Cassandra cluster. * * @summary List all data centers in a particular managed Cassandra cluster. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterList.json */ async function cosmosDbManagedCassandraDataCenterList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersUpdateSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersUpdateSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersUpdateSample.ts index c5076eef70d5..ca10b79dbbca 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraDataCentersUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update some of the properties of a managed Cassandra data center. * * @summary Update some of the properties of a managed Cassandra data center. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterPatch.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json */ async function cosmosDbManagedCassandraDataCenterUpdate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts index 8852b7800b07..850e8554e675 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB Cassandra keyspace * * @summary Create or update an Azure Cosmos DB Cassandra keyspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json */ async function cosmosDbCassandraKeyspaceCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesCreateUpdateCassandraTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraTableSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesCreateUpdateCassandraTableSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraTableSample.ts index 33d54648df1f..04ca68d90a36 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesCreateUpdateCassandraTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraTableSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB Cassandra Table * * @summary Create or update an Azure Cosmos DB Cassandra Table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json */ async function cosmosDbCassandraTableCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -39,6 +37,7 @@ async function cosmosDbCassandraTableCreateUpdate() { columns: [{ name: "columnA", type: "Ascii" }], partitionKeys: [{ name: "columnA" }], }, + analyticalStorageTtl: 500, defaultTtl: 100, id: "tableName", }, diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraViewSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraViewSample.ts new file mode 100644 index 000000000000..7493aa2cb317 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesCreateUpdateCassandraViewSample.ts @@ -0,0 +1,57 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CassandraViewCreateUpdateParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB Cassandra View + * + * @summary Create or update an Azure Cosmos DB Cassandra View + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json + */ +async function cosmosDbCassandraViewCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const createUpdateCassandraViewParameters: CassandraViewCreateUpdateParameters = + { + options: {}, + resource: { + id: "viewname", + viewDefinition: + "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)", + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.cassandraResources.beginCreateUpdateCassandraViewAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + createUpdateCassandraViewParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesDeleteCassandraKeyspaceSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraKeyspaceSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesDeleteCassandraKeyspaceSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraKeyspaceSample.ts index c4da7654f91f..2fa4d45c7121 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesDeleteCassandraKeyspaceSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraKeyspaceSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @summary Deletes an existing Azure Cosmos DB Cassandra keyspace. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceDelete.json */ async function cosmosDbCassandraKeyspaceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesDeleteCassandraTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraTableSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesDeleteCassandraTableSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraTableSample.ts index 38f8a1a96595..e301c83486c3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesDeleteCassandraTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraTableSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Cassandra table. * * @summary Deletes an existing Azure Cosmos DB Cassandra table. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableDelete.json */ async function cosmosDbCassandraTableDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraViewSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraViewSample.ts new file mode 100644 index 000000000000..c6416a7c063e --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesDeleteCassandraViewSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Cassandra view. + * + * @summary Deletes an existing Azure Cosmos DB Cassandra view. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewDelete.json + */ +async function cosmosDbCassandraViewDelete() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.cassandraResources.beginDeleteCassandraViewAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraKeyspaceSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraKeyspaceSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraKeyspaceSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraKeyspaceSample.ts index d4409999eff6..522a96117a76 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraKeyspaceSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraKeyspaceSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceGet.json */ async function cosmosDbCassandraKeyspaceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts index 7bcfe6468efa..dbab1b9419f6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json */ async function cosmosDbCassandraKeyspaceThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraTableSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraTableSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraTableSample.ts index 86671e8836bc..2b878e6c585c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraTableSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Cassandra table under an existing Azure Cosmos DB database account. * * @summary Gets the Cassandra table under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableGet.json */ async function cosmosDbCassandraTableGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraTableThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraTableThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraTableThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraTableThroughputSample.ts index b7da9da74893..af13cc764f1a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraTableThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraTableThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputGet.json */ async function cosmosDbCassandraTableThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraViewSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraViewSample.ts new file mode 100644 index 000000000000..e3ead5198ba1 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraViewSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets the Cassandra view under an existing Azure Cosmos DB database account. + * + * @summary Gets the Cassandra view under an existing Azure Cosmos DB database account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewGet.json + */ +async function cosmosDbCassandraViewGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraResources.getCassandraView( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraViewThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraViewThroughputSample.ts new file mode 100644 index 000000000000..aefdec56e955 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesGetCassandraViewThroughputSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. + * + * @summary Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputGet.json + */ +async function cosmosDbCassandraViewThroughputGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.cassandraResources.getCassandraViewThroughput( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewThroughputGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesListCassandraKeyspacesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraKeyspacesSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesListCassandraKeyspacesSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraKeyspacesSample.ts index 3528b88c0cd2..eed74e2308c7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesListCassandraKeyspacesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraKeyspacesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. * * @summary Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceList.json */ async function cosmosDbCassandraKeyspaceList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesListCassandraTablesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraTablesSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesListCassandraTablesSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraTablesSample.ts index dec60e9b51ac..5b41a97f2477 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesListCassandraTablesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraTablesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the Cassandra table under an existing Azure Cosmos DB database account. * * @summary Lists the Cassandra table under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableList.json */ async function cosmosDbCassandraTableList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraViewsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraViewsSample.ts new file mode 100644 index 000000000000..89c8a01fad69 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesListCassandraViewsSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * + * @summary Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewList.json + */ +async function cosmosDbCassandraViewList() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.cassandraResources.listCassandraViews( + resourceGroupName, + accountName, + keyspaceName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbCassandraViewList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts index 040aa3e633a6..c06ce968e3bb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json */ async function cosmosDbCassandraKeyspaceMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts index 528ad35b9a01..d97927e0b2fc 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json */ async function cosmosDbCassandraKeyspaceMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts index eae2d7bcd56d..5f018418032c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json */ async function cosmosDbCassandraTableMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts index f8619f3a3ddf..c2a7bfa17349 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json */ async function cosmosDbCassandraTableMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraViewToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraViewToAutoscaleSample.ts new file mode 100644 index 000000000000..eab726f8ce01 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraViewToAutoscaleSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale + * + * @summary Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json + */ +async function cosmosDbCassandraViewMigrateToAutoscale() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.cassandraResources.beginMigrateCassandraViewToAutoscaleAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewMigrateToAutoscale(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraViewToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraViewToManualThroughputSample.ts new file mode 100644 index 000000000000..12c2ef9c1cf8 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesMigrateCassandraViewToManualThroughputSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput + * + * @summary Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json + */ +async function cosmosDbCassandraViewMigrateToManualThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.cassandraResources.beginMigrateCassandraViewToManualThroughputAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewMigrateToManualThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts index 79380043f650..d04206f87424 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Cassandra Keyspace * * @summary Update RUs per second of an Azure Cosmos DB Cassandra Keyspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json */ async function cosmosDbCassandraKeyspaceThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesUpdateCassandraTableThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraTableThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesUpdateCassandraTableThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraTableThroughputSample.ts index 4486041f9cac..1abd55d1ccb4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesUpdateCassandraTableThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraTableThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Cassandra table * * @summary Update RUs per second of an Azure Cosmos DB Cassandra table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraTableThroughputUpdate.json */ async function cosmosDbCassandraTableThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraViewThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraViewThroughputSample.ts new file mode 100644 index 000000000000..43ec3c94e686 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/cassandraResourcesUpdateCassandraViewThroughputSample.ts @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ThroughputSettingsUpdateParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Cassandra view + * + * @summary Update RUs per second of an Azure Cosmos DB Cassandra view + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCassandraViewThroughputUpdate.json + */ +async function cosmosDbCassandraViewThroughputUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const keyspaceName = "keyspacename"; + const viewName = "viewname"; + const updateThroughputParameters: ThroughputSettingsUpdateParameters = { + resource: { throughput: 400 }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.cassandraResources.beginUpdateCassandraViewThroughputAndWait( + resourceGroupName, + accountName, + keyspaceName, + viewName, + updateThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbCassandraViewThroughputUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultEnableDisableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultEnableDisableSample.ts new file mode 100644 index 000000000000..feeeed5bf950 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultEnableDisableSample.ts @@ -0,0 +1,53 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ChaosFaultResource, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Enable, disable Chaos Fault in a CosmosDB account. + * + * @summary Enable, disable Chaos Fault in a CosmosDB account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultEnableDisable.json + */ +async function chaosFaultEnableDisable() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const chaosFault = "ServiceUnavailability"; + const chaosFaultRequest: ChaosFaultResource = { + action: "Enable", + containerName: "testCollection", + databaseName: "testDatabase", + region: "EastUS", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.chaosFault.beginEnableDisableAndWait( + resourceGroupName, + accountName, + chaosFault, + chaosFaultRequest, + ); + console.log(result); +} + +async function main() { + chaosFaultEnableDisable(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultGetSample.ts new file mode 100644 index 000000000000..00c9822ad5db --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultGetSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @summary Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultGet.json + */ +async function chaosFaultGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const chaosFault = "ServiceUnavailability"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.chaosFault.get( + resourceGroupName, + accountName, + chaosFault, + ); + console.log(result); +} + +async function main() { + chaosFaultGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultListSample.ts new file mode 100644 index 000000000000..c02aaa1aca78 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/chaosFaultListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to List Chaos Faults for CosmosDB account. + * + * @summary List Chaos Faults for CosmosDB account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/ChaosFaultList.json + */ +async function chaosFaultList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.chaosFault.list( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + chaosFaultList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListMetricDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListMetricDefinitionsSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListMetricDefinitionsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListMetricDefinitionsSample.ts index 23a5c1caf82b..031f6c048eb7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListMetricDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListMetricDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves metric definitions for the given collection. * * @summary Retrieves metric definitions for the given collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetricDefinitions.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetricDefinitions.json */ async function cosmosDbCollectionGetMetricDefinitions() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListMetricsSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListMetricsSample.ts index 309e967251fc..720816bb3971 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account and collection. * * @summary Retrieves the metrics determined by the given filter for the given database account and collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetMetrics.json */ async function cosmosDbCollectionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListUsagesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListUsagesSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListUsagesSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListUsagesSample.ts index df5bbd097f9b..52ee5f8c9f28 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListUsagesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionListUsagesSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the usages (most recent storage data) for the given collection. * * @summary Retrieves the usages (most recent storage data) for the given collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionGetUsages.json */ async function cosmosDbCollectionGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionListMetricsSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionListMetricsSample.ts index f2dbf377db42..a7b8778715f9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given collection, split by partition. * * @summary Retrieves the metrics determined by the given filter for the given collection, split by partition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionListUsagesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionListUsagesSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionListUsagesSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionListUsagesSample.ts index de0deff0d157..767062d1fe30 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionListUsagesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionListUsagesSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the usages (most recent storage data) for the given collection, split by partition. * * @summary Retrieves the usages (most recent storage data) for the given collection, split by partition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionGetUsages.json */ async function cosmosDbCollectionGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionRegionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionRegionListMetricsSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionRegionListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionRegionListMetricsSample.ts index 98412819df88..03d29014f5ba 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionRegionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionPartitionRegionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given collection and region, split by partition. * * @summary Retrieves the metrics determined by the given filter for the given collection and region, split by partition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionRegionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionRegionListMetricsSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionRegionListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionRegionListMetricsSample.ts index d8f0a40976b7..34206260507c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionRegionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/collectionRegionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account, collection and region. * * @summary Retrieves the metrics determined by the given filter for the given database account, collection and region. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRegionCollectionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRegionCollectionGetMetrics.json */ async function cosmosDbRegionCollectionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCancelSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCancelSample.ts new file mode 100644 index 000000000000..2edc6a3da708 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCancelSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Cancels a Data Transfer Job. + * + * @summary Cancels a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json + */ +async function cosmosDbDataTransferJobCancel() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.cancel( + resourceGroupName, + accountName, + jobName, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobCancel(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCompleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCompleteSample.ts new file mode 100644 index 000000000000..fb60cbec2f20 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCompleteSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Completes a Data Transfer Online Job. + * + * @summary Completes a Data Transfer Online Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json + */ +async function cosmosDbDataTransferJobComplete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "e35cc6eb-c8e3-447b-8de6-b83328cd0098"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.complete( + resourceGroupName, + accountName, + jobName, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobComplete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCreateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCreateSample.ts new file mode 100644 index 000000000000..32ecbac87cf5 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsCreateSample.ts @@ -0,0 +1,58 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CreateJobRequest, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Creates a Data Transfer Job. + * + * @summary Creates a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json + */ +async function cosmosDbDataTransferJobCreate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const jobCreateParameters: CreateJobRequest = { + properties: { + destination: { + component: "AzureBlobStorage", + containerName: "blob_container", + endpointUrl: "https://blob.windows.net", + }, + source: { + component: "CosmosDBCassandra", + keyspaceName: "keyspace", + tableName: "table", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.create( + resourceGroupName, + accountName, + jobName, + jobCreateParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobCreate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsGetSample.ts new file mode 100644 index 000000000000..ed3584988c38 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsGetSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get a Data Transfer Job. + * + * @summary Get a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json + */ +async function cosmosDbDataTransferJobGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.get( + resourceGroupName, + accountName, + jobName, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsListByDatabaseAccountSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsListByDatabaseAccountSample.ts new file mode 100644 index 000000000000..c21ad829039d --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsListByDatabaseAccountSample.ts @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Get a list of Data Transfer jobs. + * + * @summary Get a list of Data Transfer jobs. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json + */ +async function cosmosDbDataTransferJobFeed() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.dataTransferJobs.listByDatabaseAccount( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbDataTransferJobFeed(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsPauseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsPauseSample.ts new file mode 100644 index 000000000000..53c1763dc616 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsPauseSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Pause a Data Transfer Job. + * + * @summary Pause a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json + */ +async function cosmosDbDataTransferJobPause() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.pause( + resourceGroupName, + accountName, + jobName, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobPause(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsResumeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsResumeSample.ts new file mode 100644 index 000000000000..fc65c0182f23 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/dataTransferJobsResumeSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Resumes a Data Transfer Job. + * + * @summary Resumes a Data Transfer Job. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json + */ +async function cosmosDbDataTransferJobResume() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const jobName = "j1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.dataTransferJobs.resume( + resourceGroupName, + accountName, + jobName, + ); + console.log(result); +} + +async function main() { + cosmosDbDataTransferJobResume(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountRegionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountRegionListMetricsSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountRegionListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountRegionListMetricsSample.ts index 1a6451403d12..cafaf877d6be 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountRegionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountRegionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account and region. * * @summary Retrieves the metrics determined by the given filter for the given database account and region. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsCheckNameExistsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsCheckNameExistsSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsCheckNameExistsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsCheckNameExistsSample.ts index b0c0947cbfb0..d72656f7eaa7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsCheckNameExistsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsCheckNameExistsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. * * @summary Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCheckNameExists.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json */ async function cosmosDbDatabaseAccountCheckNameExists() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsCreateOrUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsCreateOrUpdateSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsCreateOrUpdateSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsCreateOrUpdateSample.ts index 681afaed2ad1..7cbae53e8821 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsCreateOrUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsCreateOrUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @summary Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMax.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json */ async function cosmosDbDatabaseAccountCreateMax() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -39,6 +37,7 @@ async function cosmosDbDatabaseAccountCreateMax() { }, }, capacity: { totalThroughputLimit: 2000 }, + capacityMode: "Provisioned", consistencyPolicy: { defaultConsistencyLevel: "BoundedStaleness", maxIntervalInSeconds: 10, @@ -48,10 +47,13 @@ async function cosmosDbDatabaseAccountCreateMax() { createMode: "Default", databaseAccountOfferType: "Standard", defaultIdentity: "FirstPartyIdentity", + defaultPriorityLevel: "Low", enableAnalyticalStorage: true, enableBurstCapacity: true, enableFreeTier: false, + enableMaterializedViews: false, enablePerRegionPerPartitionAutoscale: true, + enablePriorityBasedExecution: true, identity: { type: "SystemAssigned,UserAssigned", userAssignedIdentities: { @@ -103,7 +105,7 @@ async function cosmosDbDatabaseAccountCreateMax() { * This sample demonstrates how to Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @summary Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMin.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountCreateMin.json */ async function cosmosDbDatabaseAccountCreateMin() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -135,7 +137,7 @@ async function cosmosDbDatabaseAccountCreateMin() { * This sample demonstrates how to Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. * * @summary Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json */ async function cosmosDbRestoreDatabaseAccountCreateUpdateJson() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -156,6 +158,7 @@ async function cosmosDbRestoreDatabaseAccountCreateUpdateJson() { databaseAccountOfferType: "Standard", enableAnalyticalStorage: true, enableFreeTier: false, + enableMaterializedViews: false, keyVaultKeyUri: "https://myKeyVault.vault.azure.net", kind: "GlobalDocumentDB", location: "westus", @@ -183,6 +186,7 @@ async function cosmosDbRestoreDatabaseAccountCreateUpdateJson() { "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc", restoreTimestampInUtc: new Date("2021-03-11T22:05:09Z"), restoreWithTtlDisabled: false, + sourceBackupLocation: "westus", }, tags: {}, }; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsDeleteSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsDeleteSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsDeleteSample.ts index 631a75498e50..d47deda2d086 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB database account. * * @summary Deletes an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountDelete.json */ async function cosmosDbDatabaseAccountDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsFailoverPriorityChangeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsFailoverPriorityChangeSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsFailoverPriorityChangeSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsFailoverPriorityChangeSample.ts index 104a6a16a74e..d0c75c20a35b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsFailoverPriorityChangeSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsFailoverPriorityChangeSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. * * @summary Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json */ async function cosmosDbDatabaseAccountFailoverPriorityChange() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsGetReadOnlyKeysSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsGetReadOnlyKeysSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsGetReadOnlyKeysSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsGetReadOnlyKeysSample.ts index a6f1ef65d080..e68c747df5aa 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsGetReadOnlyKeysSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsGetReadOnlyKeysSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @summary Lists the read-only access keys for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json */ async function cosmosDbDatabaseAccountListReadOnlyKeys() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsGetSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsGetSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsGetSample.ts index 50f4f4128aa7..810a9bdc5621 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB database account. * * @summary Retrieves the properties of an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGet.json */ async function cosmosDbDatabaseAccountGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListByResourceGroupSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListByResourceGroupSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListByResourceGroupSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListByResourceGroupSample.ts index f01e63be0013..fd565e2067db 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListByResourceGroupSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListByResourceGroupSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @summary Lists all the Azure Cosmos DB database accounts available under the given resource group. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json */ async function cosmosDbDatabaseAccountListByResourceGroup() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListConnectionStringsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListConnectionStringsSample.ts similarity index 89% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListConnectionStringsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListConnectionStringsSample.ts index 660869b7eaa2..1b4476829790 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListConnectionStringsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListConnectionStringsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the connection strings for the specified Azure Cosmos DB database account. * * @summary Lists the connection strings for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json */ async function cosmosDbDatabaseAccountListConnectionStrings() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -37,7 +35,7 @@ async function cosmosDbDatabaseAccountListConnectionStrings() { * This sample demonstrates how to Lists the connection strings for the specified Azure Cosmos DB database account. * * @summary Lists the connection strings for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json */ async function cosmosDbDatabaseAccountListConnectionStringsMongo() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListKeysSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListKeysSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListKeysSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListKeysSample.ts index 36368b5112b7..2ae907d01f01 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListKeysSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListKeysSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the access keys for the specified Azure Cosmos DB database account. * * @summary Lists the access keys for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListKeys.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListKeys.json */ async function cosmosDbDatabaseAccountListKeys() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListMetricDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListMetricDefinitionsSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListMetricDefinitionsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListMetricDefinitionsSample.ts index 5bba6a6c03cd..502cae4889b9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListMetricDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListMetricDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves metric definitions for the given database account. * * @summary Retrieves metric definitions for the given database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json */ async function cosmosDbDatabaseAccountGetMetricDefinitions() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListMetricsSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListMetricsSample.ts index a799ef3a0bb0..542a81fdb045 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account. * * @summary Retrieves the metrics determined by the given filter for the given database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetMetrics.json */ async function cosmosDbDatabaseAccountGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListReadOnlyKeysSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListReadOnlyKeysSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListReadOnlyKeysSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListReadOnlyKeysSample.ts index 92f9088cc4dd..ffa597bb6dba 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListReadOnlyKeysSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListReadOnlyKeysSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the read-only access keys for the specified Azure Cosmos DB database account. * * @summary Lists the read-only access keys for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json */ async function cosmosDbDatabaseAccountListReadOnlyKeys() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListSample.ts index b03a250e3e6c..11218d77b6d8 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all the Azure Cosmos DB database accounts available under the subscription. * * @summary Lists all the Azure Cosmos DB database accounts available under the subscription. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountList.json */ async function cosmosDbDatabaseAccountList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListUsagesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListUsagesSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListUsagesSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListUsagesSample.ts index e90e1b9b51ca..65e393d731ba 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListUsagesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsListUsagesSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the usages (most recent data) for the given database account. * * @summary Retrieves the usages (most recent data) for the given database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountGetUsages.json */ async function cosmosDbDatabaseAccountGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsOfflineRegionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsOfflineRegionSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsOfflineRegionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsOfflineRegionSample.ts index 5af9489949d3..371d0edb3998 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsOfflineRegionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsOfflineRegionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Offline the specified region for the specified Azure Cosmos DB database account. * * @summary Offline the specified region for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOfflineRegion.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json */ async function cosmosDbDatabaseAccountOfflineRegion() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsOnlineRegionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsOnlineRegionSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsOnlineRegionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsOnlineRegionSample.ts index eb2bc8eb4eef..fccc010916f7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsOnlineRegionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsOnlineRegionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Online the specified region for the specified Azure Cosmos DB database account. * * @summary Online the specified region for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOnlineRegion.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json */ async function cosmosDbDatabaseAccountOnlineRegion() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsRegenerateKeySample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsRegenerateKeySample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsRegenerateKeySample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsRegenerateKeySample.ts index 9090bfa49673..9f15fde3d8ed 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsRegenerateKeySample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsRegenerateKeySample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Regenerates an access key for the specified Azure Cosmos DB database account. * * @summary Regenerates an access key for the specified Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegenerateKey.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json */ async function cosmosDbDatabaseAccountRegenerateKey() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsUpdateSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsUpdateSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsUpdateSample.ts index 00e20216ed8f..8b83424520b6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseAccountsUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Updates the properties of an existing Azure Cosmos DB database account. * * @summary Updates the properties of an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountPatch.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseAccountPatch.json */ async function cosmosDbDatabaseAccountPatch() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -34,21 +32,25 @@ async function cosmosDbDatabaseAccountPatch() { periodicModeProperties: { backupIntervalInMinutes: 240, backupRetentionIntervalInHours: 720, - backupStorageRedundancy: "Local", + backupStorageRedundancy: "Geo", }, }, capacity: { totalThroughputLimit: 2000 }, + capacityMode: "Provisioned", consistencyPolicy: { defaultConsistencyLevel: "BoundedStaleness", maxIntervalInSeconds: 10, maxStalenessPrefix: 200, }, defaultIdentity: "FirstPartyIdentity", + defaultPriorityLevel: "Low", + diagnosticLogSettings: { enableFullTextQuery: "True" }, enableAnalyticalStorage: true, enableBurstCapacity: true, enableFreeTier: false, enablePartitionMerge: true, enablePerRegionPerPartitionAutoscale: true, + enablePriorityBasedExecution: true, identity: { type: "SystemAssigned,UserAssigned", userAssignedIdentities: { diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListMetricDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListMetricDefinitionsSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListMetricDefinitionsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListMetricDefinitionsSample.ts index e49a4bab07c5..3276c1511551 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListMetricDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListMetricDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves metric definitions for the given database. * * @summary Retrieves metric definitions for the given database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetricDefinitions.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json */ async function cosmosDbDatabaseGetMetricDefinitions() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListMetricsSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListMetricsSample.ts index fadb9e342724..1993a8866dca 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account and database. * * @summary Retrieves the metrics determined by the given filter for the given database account and database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetMetrics.json */ async function cosmosDbDatabaseGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListUsagesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListUsagesSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListUsagesSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListUsagesSample.ts index cf52875c6d75..3e68b651a35c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListUsagesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/databaseListUsagesSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the usages (most recent data) for the given database. * * @summary Retrieves the usages (most recent data) for the given database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetUsages.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDatabaseGetUsages.json */ async function cosmosDbDatabaseGetUsages() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesCreateUpdateGraphSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesCreateUpdateGraphSample.ts new file mode 100644 index 000000000000..d160d1aefac6 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesCreateUpdateGraphSample.ts @@ -0,0 +1,50 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GraphResourceCreateUpdateParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB Graph. + * + * @summary Create or update an Azure Cosmos DB Graph. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json + */ +async function cosmosDbGraphCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const graphName = "graphName"; + const createUpdateGraphParameters: GraphResourceCreateUpdateParameters = { + location: "West US", + options: {}, + resource: { id: "graphName" }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.graphResources.beginCreateUpdateGraphAndWait( + resourceGroupName, + accountName, + graphName, + createUpdateGraphParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbGraphCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesDeleteGraphResourceSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesDeleteGraphResourceSample.ts new file mode 100644 index 000000000000..f59275963a22 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesDeleteGraphResourceSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Graph Resource. + * + * @summary Deletes an existing Azure Cosmos DB Graph Resource. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceDelete.json + */ +async function cosmosDbSqlDatabaseDelete() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const graphName = "graphName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.graphResources.beginDeleteGraphResourceAndWait( + resourceGroupName, + accountName, + graphName, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesGetGraphSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesGetGraphSample.ts new file mode 100644 index 000000000000..c1f4d02a26a8 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesGetGraphSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * + * @summary Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceGet.json + */ +async function cosmosDbSqlDatabaseGet() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const graphName = "graphName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.graphResources.getGraph( + resourceGroupName, + accountName, + graphName, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesListGraphsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesListGraphsSample.ts new file mode 100644 index 000000000000..b0b07a0a82c4 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/graphResourcesListGraphsSample.ts @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Lists the graphs under an existing Azure Cosmos DB database account. + * + * @summary Lists the graphs under an existing Azure Cosmos DB database account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphResourceList.json + */ +async function cosmosDbSqlDatabaseList() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.graphResources.listGraphs( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbSqlDatabaseList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts index 1b45231aa4ea..8498b9eec8d9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB Gremlin database * * @summary Create or update an Azure Cosmos DB Gremlin database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json */ async function cosmosDbGremlinDatabaseCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesCreateUpdateGremlinGraphSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesCreateUpdateGremlinGraphSample.ts similarity index 94% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesCreateUpdateGremlinGraphSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesCreateUpdateGremlinGraphSample.ts index 782fb365db85..a21aa6a506ae 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesCreateUpdateGremlinGraphSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesCreateUpdateGremlinGraphSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB Gremlin graph * * @summary Create or update an Azure Cosmos DB Gremlin graph - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json */ async function cosmosDbGremlinGraphCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesDeleteGremlinDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesDeleteGremlinDatabaseSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesDeleteGremlinDatabaseSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesDeleteGremlinDatabaseSample.ts index 4fd841d1cf2f..611d288306c0 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesDeleteGremlinDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesDeleteGremlinDatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Gremlin database. * * @summary Deletes an existing Azure Cosmos DB Gremlin database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseDelete.json */ async function cosmosDbGremlinDatabaseDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesDeleteGremlinGraphSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesDeleteGremlinGraphSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesDeleteGremlinGraphSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesDeleteGremlinGraphSample.ts index 5b79706d064a..eae07c031dd8 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesDeleteGremlinGraphSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesDeleteGremlinGraphSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Gremlin graph. * * @summary Deletes an existing Azure Cosmos DB Gremlin graph. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphDelete.json */ async function cosmosDbGremlinGraphDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinDatabaseSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinDatabaseSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinDatabaseSample.ts index 80977d644668..8dcfd129cfe4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinDatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseGet.json */ async function cosmosDbGremlinDatabaseGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinDatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinDatabaseThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinDatabaseThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinDatabaseThroughputSample.ts index 78194bec956f..307c7e1a9a8e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinDatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinDatabaseThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json */ async function cosmosDbGremlinDatabaseThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinGraphSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinGraphSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinGraphSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinGraphSample.ts index cb3d6e703415..d99fb8d126a1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinGraphSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinGraphSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Gremlin graph under an existing Azure Cosmos DB database account. * * @summary Gets the Gremlin graph under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphGet.json */ async function cosmosDbGremlinGraphGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinGraphThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinGraphThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinGraphThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinGraphThroughputSample.ts index 453afdb5c155..c716c0e18cae 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinGraphThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesGetGremlinGraphThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputGet.json */ async function cosmosDbGremlinGraphThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesListGremlinDatabasesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesListGremlinDatabasesSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesListGremlinDatabasesSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesListGremlinDatabasesSample.ts index 4236d592ce70..585723c384d5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesListGremlinDatabasesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesListGremlinDatabasesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the Gremlin databases under an existing Azure Cosmos DB database account. * * @summary Lists the Gremlin databases under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseList.json */ async function cosmosDbGremlinDatabaseList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesListGremlinGraphsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesListGremlinGraphsSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesListGremlinGraphsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesListGremlinGraphsSample.ts index b5ce778c1314..9e7d7c519e2c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesListGremlinGraphsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesListGremlinGraphsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the Gremlin graph under an existing Azure Cosmos DB database account. * * @summary Lists the Gremlin graph under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphList.json */ async function cosmosDbGremlinGraphList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts index 69782c4fe58b..5d43d612a65d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json */ async function cosmosDbGremlinDatabaseMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts index d911a37643cb..8d047d30b873 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json */ async function cosmosDbGremlinDatabaseMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts index 67cdaf9dda00..e8eb2236e96d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json */ async function cosmosDbGremlinGraphMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts index 2ed863ef5b31..46c80d3f3512 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json */ async function cosmosDbGremlinGraphMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesRetrieveContinuousBackupInformationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesRetrieveContinuousBackupInformationSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesRetrieveContinuousBackupInformationSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesRetrieveContinuousBackupInformationSample.ts index ec4373512824..ee399e25decd 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesRetrieveContinuousBackupInformationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesRetrieveContinuousBackupInformationSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves continuous backup information for a gremlin graph. * * @summary Retrieves continuous backup information for a gremlin graph. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphBackupInformation.json */ async function cosmosDbGremlinGraphBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts index 0f5af07bc622..9854ba8010e5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Gremlin database * * @summary Update RUs per second of an Azure Cosmos DB Gremlin database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json */ async function cosmosDbGremlinDatabaseThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesUpdateGremlinGraphThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesUpdateGremlinGraphThroughputSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesUpdateGremlinGraphThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesUpdateGremlinGraphThroughputSample.ts index 45967ff8146c..33eb36b3f03a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesUpdateGremlinGraphThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/gremlinResourcesUpdateGremlinGraphThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Gremlin graph * * @summary Update RUs per second of an Azure Cosmos DB Gremlin graph - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json */ async function cosmosDbGremlinGraphThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/locationsGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/locationsGetSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/locationsGetSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/locationsGetSample.ts index 12b11c4a268f..88b93f2cf423 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/locationsGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/locationsGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Get the properties of an existing Cosmos DB location * * @summary Get the properties of an existing Cosmos DB location - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationGet.json */ async function cosmosDbLocationGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/locationsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/locationsListSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/locationsListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/locationsListSample.ts index 827ef42592e3..18cf84ff8a98 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/locationsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/locationsListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to List Cosmos DB locations and their properties * * @summary List Cosmos DB locations and their properties - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBLocationList.json */ async function cosmosDbLocationList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts similarity index 52% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts index a5f5546a5919..1fc27ea90bb2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB MongoDB Collection * * @summary Create or update an Azure Cosmos DB MongoDB Collection - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json */ async function cosmosDbMongoDbcollectionCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -34,6 +32,7 @@ async function cosmosDbMongoDbcollectionCreateUpdate() { location: "West US", options: {}, resource: { + analyticalStorageTtl: 500, id: "collectionName", indexes: [ { @@ -59,8 +58,50 @@ async function cosmosDbMongoDbcollectionCreateUpdate() { console.log(result); } +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB MongoDB Collection + * + * @summary Create or update an Azure Cosmos DB MongoDB Collection + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRestore.json + */ +async function cosmosDbMongoDbcollectionRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const collectionName = "collectionName"; + const createUpdateMongoDBCollectionParameters: MongoDBCollectionCreateUpdateParameters = + { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "collectionName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: false, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginCreateUpdateMongoDBCollectionAndWait( + resourceGroupName, + accountName, + databaseName, + collectionName, + createUpdateMongoDBCollectionParameters, + ); + console.log(result); +} + async function main() { cosmosDbMongoDbcollectionCreateUpdate(); + cosmosDbMongoDbcollectionRestore(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts new file mode 100644 index 000000000000..ae469d804dd3 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts @@ -0,0 +1,92 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MongoDBDatabaseCreateUpdateParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Create or updates Azure Cosmos DB MongoDB database + * + * @summary Create or updates Azure Cosmos DB MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json + */ +async function cosmosDbMongoDbdatabaseCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const createUpdateMongoDBDatabaseParameters: MongoDBDatabaseCreateUpdateParameters = + { + location: "West US", + options: {}, + resource: { id: "databaseName" }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginCreateUpdateMongoDBDatabaseAndWait( + resourceGroupName, + accountName, + databaseName, + createUpdateMongoDBDatabaseParameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create or updates Azure Cosmos DB MongoDB database + * + * @summary Create or updates Azure Cosmos DB MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRestore.json + */ +async function cosmosDbMongoDbdatabaseRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const createUpdateMongoDBDatabaseParameters: MongoDBDatabaseCreateUpdateParameters = + { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "databaseName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: false, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginCreateUpdateMongoDBDatabaseAndWait( + resourceGroupName, + accountName, + databaseName, + createUpdateMongoDBDatabaseParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbdatabaseCreateUpdate(); + cosmosDbMongoDbdatabaseRestore(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts index 9070380cdaec..1df3c212e34d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB Mongo Role Definition. * * @summary Creates or updates an Azure Cosmos DB Mongo Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json */ async function cosmosDbMongoDbroleDefinitionCreateUpdate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts index 80ca764b78bb..87abf73550d2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB Mongo User Definition. * * @summary Creates or updates an Azure Cosmos DB Mongo User Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json */ async function cosmosDbMongoDbuserDefinitionCreateUpdate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoDbcollectionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoDbcollectionSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoDbcollectionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoDbcollectionSample.ts index c6e379d1fbf9..72582d51c720 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoDbcollectionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoDbcollectionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB MongoDB Collection. * * @summary Deletes an existing Azure Cosmos DB MongoDB Collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionDelete.json */ async function cosmosDbMongoDbcollectionDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoDbdatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoDbdatabaseSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoDbdatabaseSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoDbdatabaseSample.ts index 7394eb59370d..c9b013246fd1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoDbdatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoDbdatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB MongoDB database. * * @summary Deletes an existing Azure Cosmos DB MongoDB database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseDelete.json */ async function cosmosDbMongoDbdatabaseDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts index 9f6ae4850ed5..f05a2cf85266 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Mongo Role Definition. * * @summary Deletes an existing Azure Cosmos DB Mongo Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json */ async function cosmosDbMongoDbroleDefinitionDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoUserDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoUserDefinitionSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoUserDefinitionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoUserDefinitionSample.ts index 49e8c8b36ef2..ac3c6d24743d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoUserDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesDeleteMongoUserDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Mongo User Definition. * * @summary Deletes an existing Azure Cosmos DB Mongo User Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json */ async function cosmosDbMongoDbuserDefinitionDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbcollectionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbcollectionSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbcollectionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbcollectionSample.ts index a370166595f7..0cbcbde7ea94 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbcollectionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbcollectionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the MongoDB collection under an existing Azure Cosmos DB database account. * * @summary Gets the MongoDB collection under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionGet.json */ async function cosmosDbMongoDbcollectionGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts index b5f5e06dce9f..4e5d7f523f41 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json */ async function cosmosDbMongoDbcollectionThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbdatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbdatabaseSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbdatabaseSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbdatabaseSample.ts index 14098475bad3..834b853e9612 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbdatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbdatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseGet.json */ async function cosmosDbMongoDbdatabaseGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts index 33c41172b961..fdeaee4e537f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json */ async function cosmosDbMongoDbdatabaseThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoRoleDefinitionSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoRoleDefinitionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoRoleDefinitionSample.ts index 38cb717370c7..1d23c0c8319f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoRoleDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json */ async function cosmosDbMongoRoleDefinitionGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoUserDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoUserDefinitionSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoUserDefinitionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoUserDefinitionSample.ts index 1c2afd267b4b..062aea39354f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoUserDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesGetMongoUserDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json */ async function cosmosDbMongoDbuserDefinitionGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbcollectionPartitionMergeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbcollectionPartitionMergeSample.ts new file mode 100644 index 000000000000..74d56a4b01ba --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbcollectionPartitionMergeSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { MergeParameters, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Merges the partitions of a MongoDB Collection + * + * @summary Merges the partitions of a MongoDB Collection + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json + */ +async function cosmosDbMongoDbcollectionPartitionMerge() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const collectionName = "collectionName"; + const mergeParameters: MergeParameters = { isDryRun: false }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginListMongoDBCollectionPartitionMergeAndWait( + resourceGroupName, + accountName, + databaseName, + collectionName, + mergeParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbcollectionPartitionMerge(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoDbcollectionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbcollectionsSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoDbcollectionsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbcollectionsSample.ts index 54cf10855997..08b2319ec6d1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoDbcollectionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbcollectionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the MongoDB collection under an existing Azure Cosmos DB database account. * * @summary Lists the MongoDB collection under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionList.json */ async function cosmosDbMongoDbcollectionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoDbdatabasesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbdatabasesSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoDbdatabasesSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbdatabasesSample.ts index 02c8340434ef..943f38e06594 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoDbdatabasesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoDbdatabasesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the MongoDB databases under an existing Azure Cosmos DB database account. * * @summary Lists the MongoDB databases under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseList.json */ async function cosmosDbMongoDbdatabaseList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoRoleDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoRoleDefinitionsSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoRoleDefinitionsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoRoleDefinitionsSample.ts index b75e8679aec0..12b9c855b487 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoRoleDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoRoleDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. * * @summary Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBRoleDefinitionList.json */ async function cosmosDbMongoDbroleDefinitionList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoUserDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoUserDefinitionsSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoUserDefinitionsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoUserDefinitionsSample.ts index 7c83cd5f9d68..0c2ed7fe6b19 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoUserDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesListMongoUserDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Mongo User Definition. * * @summary Retrieves the list of all Azure Cosmos DB Mongo User Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBUserDefinitionList.json */ async function cosmosDbMongoDbuserDefinitionList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts index fad37ea8c404..46d24de98cca 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json */ async function cosmosDbMongoDbcollectionMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts index 36dd9a502a6b..bdbec228a4e5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json */ async function cosmosDbMongoDbcollectionMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts index 1531798ead50..6c5643c14ccf 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json */ async function cosmosDbMongoDbdatabaseMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts index 8722cd024afd..9f6a49ed3084 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json */ async function cosmosDbMongoDbdatabaseMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.ts new file mode 100644 index 000000000000..0aee5ad27e0f --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbcontainerRedistributeThroughputSample.ts @@ -0,0 +1,60 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RedistributeThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB MongoDB container + * + * @summary Redistribute throughput for an Azure Cosmos DB MongoDB container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json + */ +async function cosmosDbMongoDbcollectionRedistributeThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const collectionName = "collectionName"; + const redistributeThroughputParameters: RedistributeThroughputParameters = { + resource: { + sourcePhysicalPartitionThroughputInfo: [ + { id: "2", throughput: 5000 }, + { id: "3" }, + ], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, + ], + throughputPolicy: "custom", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBContainerRedistributeThroughputAndWait( + resourceGroupName, + accountName, + databaseName, + collectionName, + redistributeThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbcollectionRedistributeThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.ts new file mode 100644 index 000000000000..c7c4876f6a66 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbcontainerRetrieveThroughputDistributionSample.ts @@ -0,0 +1,50 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RetrieveThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB MongoDB container + * + * @summary Retrieve throughput distribution for an Azure Cosmos DB MongoDB container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json + */ +async function cosmosDbMongoDbcollectionRetrieveThroughputDistribution() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const collectionName = "collectionName"; + const retrieveThroughputParameters: RetrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBContainerRetrieveThroughputDistributionAndWait( + resourceGroupName, + accountName, + databaseName, + collectionName, + retrieveThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbcollectionRetrieveThroughputDistribution(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabasePartitionMergeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabasePartitionMergeSample.ts new file mode 100644 index 000000000000..ba34a200e56d --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabasePartitionMergeSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { MergeParameters, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Merges the partitions of a MongoDB database + * + * @summary Merges the partitions of a MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json + */ +async function cosmosDbMongoDbdatabasePartitionMerge() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const mergeParameters: MergeParameters = { isDryRun: false }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBDatabasePartitionMergeAndWait( + resourceGroupName, + accountName, + databaseName, + mergeParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbdatabasePartitionMerge(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.ts new file mode 100644 index 000000000000..e2f48b847d79 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabaseRedistributeThroughputSample.ts @@ -0,0 +1,58 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RedistributeThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB MongoDB database + * + * @summary Redistribute throughput for an Azure Cosmos DB MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json + */ +async function cosmosDbMongoDbdatabaseRedistributeThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const redistributeThroughputParameters: RedistributeThroughputParameters = { + resource: { + sourcePhysicalPartitionThroughputInfo: [ + { id: "2", throughput: 5000 }, + { id: "3" }, + ], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, + ], + throughputPolicy: "custom", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBDatabaseRedistributeThroughputAndWait( + resourceGroupName, + accountName, + databaseName, + redistributeThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbdatabaseRedistributeThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.ts new file mode 100644 index 000000000000..d4fd58df870e --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesMongoDbdatabaseRetrieveThroughputDistributionSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RetrieveThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB MongoDB database + * + * @summary Retrieve throughput distribution for an Azure Cosmos DB MongoDB database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json + */ +async function cosmosDbMongoDbdatabaseRetrieveThroughputDistribution() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const retrieveThroughputParameters: RetrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.mongoDBResources.beginMongoDBDatabaseRetrieveThroughputDistributionAndWait( + resourceGroupName, + accountName, + databaseName, + retrieveThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbMongoDbdatabaseRetrieveThroughputDistribution(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts index a2017db506b0..4dfad00f3ccb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves continuous backup information for a Mongodb collection. * * @summary Retrieves continuous backup information for a Mongodb collection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json */ async function cosmosDbMongoDbcollectionBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts index 9ee4de8a068e..79bfe48e603e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update the RUs per second of an Azure Cosmos DB MongoDB collection * * @summary Update the RUs per second of an Azure Cosmos DB MongoDB collection - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json */ async function cosmosDbMongoDbcollectionThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts index 2545c1e17d7e..fb5235739b17 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of the an Azure Cosmos DB MongoDB database * * @summary Update RUs per second of the an Azure Cosmos DB MongoDB database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json */ async function cosmosDbMongoDbdatabaseThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsGetSample.ts new file mode 100644 index 000000000000..d265f3400e29 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsGetSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets effective Network Security Perimeter Configuration for association + * + * @summary Gets effective Network Security Perimeter Configuration for association + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json + */ +async function namspaceNetworkSecurityPerimeterConfigurationList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "res4410"; + const accountName = "cosmosTest"; + const networkSecurityPerimeterConfigurationName = + "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.networkSecurityPerimeterConfigurations.get( + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + ); + console.log(result); +} + +async function main() { + namspaceNetworkSecurityPerimeterConfigurationList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsListSample.ts new file mode 100644 index 000000000000..222b53253c88 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Gets list of effective Network Security Perimeter Configuration for cosmos db account + * + * @summary Gets list of effective Network Security Perimeter Configuration for cosmos db account + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationList.json + */ +async function namspaceNetworkSecurityPerimeterConfigurationList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "res4410"; + const accountName = "cosmosTest"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.networkSecurityPerimeterConfigurations.list( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + namspaceNetworkSecurityPerimeterConfigurationList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsReconcileSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsReconcileSample.ts new file mode 100644 index 000000000000..841961eb1bcd --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/networkSecurityPerimeterConfigurationsReconcileSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Refreshes any information about the association. + * + * @summary Refreshes any information about the association. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json + */ +async function networkSecurityPerimeterConfigurationList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "res4410"; + const accountName = "sto8607"; + const networkSecurityPerimeterConfigurationName = + "dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.networkSecurityPerimeterConfigurations.beginReconcileAndWait( + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + ); + console.log(result); +} + +async function main() { + networkSecurityPerimeterConfigurationList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesCreateOrUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesCreateOrUpdateSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesCreateOrUpdateSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesCreateOrUpdateSample.ts index 908adf7d05b9..a58b12afe3f5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesCreateOrUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesCreateOrUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates the notebook workspace for a Cosmos DB account. * * @summary Creates the notebook workspace for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceCreate.json */ async function cosmosDbNotebookWorkspaceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesDeleteSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesDeleteSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesDeleteSample.ts index f9a37b876750..28bf63e7d7e9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes the notebook workspace for a Cosmos DB account. * * @summary Deletes the notebook workspace for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceDelete.json */ async function cosmosDbNotebookWorkspaceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesGetSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesGetSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesGetSample.ts index 519f9e0a193a..5f18246f505d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the notebook workspace for a Cosmos DB account. * * @summary Gets the notebook workspace for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceGet.json */ async function cosmosDbNotebookWorkspaceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesListByDatabaseAccountSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesListByDatabaseAccountSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesListByDatabaseAccountSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesListByDatabaseAccountSample.ts index 87539e39c1b3..b6fce49dcc20 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesListByDatabaseAccountSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesListByDatabaseAccountSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the notebook workspace resources of an existing Cosmos DB account. * * @summary Gets the notebook workspace resources of an existing Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceList.json */ async function cosmosDbNotebookWorkspaceList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesListConnectionInfoSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesListConnectionInfoSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesListConnectionInfoSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesListConnectionInfoSample.ts index b7b164759ddd..e4e441d1f5f1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesListConnectionInfoSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesListConnectionInfoSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the connection info for the notebook workspace * * @summary Retrieves the connection info for the notebook workspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json */ async function cosmosDbNotebookWorkspaceListConnectionInfo() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesRegenerateAuthTokenSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesRegenerateAuthTokenSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesRegenerateAuthTokenSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesRegenerateAuthTokenSample.ts index 680d466acb9d..fe46ba3a17b9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesRegenerateAuthTokenSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesRegenerateAuthTokenSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Regenerates the auth token for the notebook workspace * * @summary Regenerates the auth token for the notebook workspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json */ async function cosmosDbNotebookWorkspaceRegenerateAuthToken() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesStartSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesStartSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesStartSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesStartSample.ts index fb8d32d9c255..d09bed7afe2a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesStartSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/notebookWorkspacesStartSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Starts the notebook workspace * * @summary Starts the notebook workspace - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceStart.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBNotebookWorkspaceStart.json */ async function cosmosDbNotebookWorkspaceStart() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/operationsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/operationsListSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/operationsListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/operationsListSample.ts index 7eceff1a6c29..733fea16797c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/operationsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/operationsListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all of the available Cosmos DB Resource Provider operations. * * @summary Lists all of the available Cosmos DB Resource Provider operations. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBOperationsList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBOperationsList.json */ async function cosmosDbOperationsList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/partitionKeyRangeIdListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/partitionKeyRangeIdListMetricsSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/partitionKeyRangeIdListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/partitionKeyRangeIdListMetricsSample.ts index 091a2619441f..f0ed2c640a53 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/partitionKeyRangeIdListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/partitionKeyRangeIdListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given partition key range id. * * @summary Retrieves the metrics determined by the given filter for the given partition key range id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/partitionKeyRangeIdRegionListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/partitionKeyRangeIdRegionListMetricsSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/partitionKeyRangeIdRegionListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/partitionKeyRangeIdRegionListMetricsSample.ts index d2967ae366e7..7f39e7efaebf 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/partitionKeyRangeIdRegionListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/partitionKeyRangeIdRegionListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given partition key range id and region. * * @summary Retrieves the metrics determined by the given filter for the given partition key range id and region. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileListMetricsSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileListMetricsSample.ts index d69d3e80ccdb..f1194d2cd676 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data * * @summary Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileSourceTargetListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileSourceTargetListMetricsSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileSourceTargetListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileSourceTargetListMetricsSample.ts index 410612c76e28..b5c0e1e198eb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileSourceTargetListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileSourceTargetListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data * * @summary Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileTargetListMetricsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileTargetListMetricsSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileTargetListMetricsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileTargetListMetricsSample.ts index 9fc6e89caba5..965d96d3e603 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileTargetListMetricsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/percentileTargetListMetricsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data * * @summary Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileTargetGetMetrics.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPercentileTargetGetMetrics.json */ async function cosmosDbDatabaseAccountRegionGetMetrics() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts index 1a77f6924db1..d8d57c0828c9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Approve or reject a private endpoint connection with a given name. * * @summary Approve or reject a private endpoint connection with a given name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json */ async function approveOrRejectAPrivateEndpointConnectionWithAGivenName() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsDeleteSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts index 4859ab59bcf3..0b99ba22859e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes a private endpoint connection with a given name. * * @summary Deletes a private endpoint connection with a given name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json */ async function deletesAPrivateEndpointConnectionWithAGivenName() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsGetSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsGetSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsGetSample.ts index 34db25222933..03ad5df6f2e4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets a private endpoint connection. * * @summary Gets a private endpoint connection. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsListByDatabaseAccountSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsListByDatabaseAccountSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsListByDatabaseAccountSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsListByDatabaseAccountSample.ts index 182b7d280852..7d603a761440 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsListByDatabaseAccountSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateEndpointConnectionsListByDatabaseAccountSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to List all private endpoint connections on a Cosmos DB account. * * @summary List all private endpoint connections on a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionListGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateLinkResourcesGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateLinkResourcesGetSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateLinkResourcesGetSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateLinkResourcesGetSample.ts index 0570d1584c85..7a6ffb2aa9bb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateLinkResourcesGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateLinkResourcesGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the private link resources that need to be created for a Cosmos DB account. * * @summary Gets the private link resources that need to be created for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateLinkResourcesListByDatabaseAccountSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateLinkResourcesListByDatabaseAccountSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateLinkResourcesListByDatabaseAccountSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateLinkResourcesListByDatabaseAccountSample.ts index 5052eaf5ed55..55a971f61b83 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateLinkResourcesListByDatabaseAccountSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/privateLinkResourcesListByDatabaseAccountSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the private link resources that need to be created for a Cosmos DB account. * * @summary Gets the private link resources that need to be created for a Cosmos DB account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceListGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBPrivateLinkResourceListGet.json */ async function getsPrivateEndpointConnection() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsGetByLocationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsGetByLocationSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsGetByLocationSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsGetByLocationSample.ts index 0a5fa126b434..8a4444b16bf8 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsGetByLocationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsGetByLocationSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. * * @summary Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json */ async function cosmosDbRestorableDatabaseAccountGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsListByLocationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsListByLocationSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsListByLocationSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsListByLocationSample.ts index a817b37b4407..1cf5a47b5468 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsListByLocationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsListByLocationSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. * * @summary Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json */ async function cosmosDbRestorableDatabaseAccountList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsListSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsListSample.ts index 9143ce37a4a6..77543b78e45c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableDatabaseAccountsListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. * * @summary Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json */ async function cosmosDbRestorableDatabaseAccountNoLocationList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinDatabasesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinDatabasesListSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinDatabasesListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinDatabasesListSample.ts index 5fe1b0512347..7de641246f6d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinDatabasesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinDatabasesListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinDatabaseList.json */ async function cosmosDbRestorableGremlinDatabaseList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinGraphsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinGraphsListSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinGraphsListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinGraphsListSample.ts index d8cb724cbd2d..49e7e79d81f5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinGraphsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinGraphsListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinGraphList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinGraphList.json */ async function cosmosDbRestorableGremlinGraphList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinResourcesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinResourcesListSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinResourcesListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinResourcesListSample.ts index f725472179c5..e2c9f92bd893 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinResourcesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableGremlinResourcesListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableGremlinResourceList.json */ async function cosmosDbRestorableGremlinResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbCollectionsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbCollectionsListSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbCollectionsListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbCollectionsListSample.ts index 3a8481a19a17..2c2664c90be5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbCollectionsListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbCollectionsListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbCollectionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbCollectionList.json */ async function cosmosDbRestorableMongodbCollectionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbDatabasesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbDatabasesListSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbDatabasesListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbDatabasesListSample.ts index 2d7f3518b028..bf106fecbbeb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbDatabasesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbDatabasesListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbDatabaseList.json */ async function cosmosDbRestorableMongodbDatabaseList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbResourcesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbResourcesListSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbResourcesListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbResourcesListSample.ts index 84a4189b2aa1..4ce39ceaf317 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbResourcesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableMongodbResourcesListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableMongodbResourceList.json */ async function cosmosDbRestorableMongodbResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlContainersListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlContainersListSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlContainersListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlContainersListSample.ts index 6e910768f681..1e817caa3218 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlContainersListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlContainersListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlContainerList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlContainerList.json */ async function cosmosDbRestorableSqlContainerList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlDatabasesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlDatabasesListSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlDatabasesListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlDatabasesListSample.ts index d6ca881ff59f..7425bab6690e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlDatabasesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlDatabasesListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlDatabaseList.json */ async function cosmosDbRestorableSqlDatabaseList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlResourcesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlResourcesListSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlResourcesListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlResourcesListSample.ts index 743de4fc0c35..04064c971400 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlResourcesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableSqlResourcesListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableSqlResourceList.json */ async function cosmosDbRestorableSqlResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableTableResourcesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableTableResourcesListSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableTableResourcesListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableTableResourcesListSample.ts index 411ce12e0ae1..be8694e65316 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableTableResourcesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableTableResourcesListSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. * * @summary Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableResourceList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableResourceList.json */ async function cosmosDbRestorableTableResourceList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableTablesListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableTablesListSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableTablesListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableTablesListSample.ts index 26c1f355dfbd..d1ef42b4a501 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableTablesListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/restorableTablesListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission * * @summary Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBRestorableTableList.json */ async function cosmosDbRestorableTableList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceCreateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceCreateSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceCreateSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceCreateSample.ts index d1c053d2466c..c4968c07f416 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceCreateSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceCreateSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceCreate.json */ async function dataTransferServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -50,7 +48,7 @@ async function dataTransferServiceCreate() { * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json */ async function graphApiComputeServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -79,7 +77,7 @@ async function graphApiComputeServiceCreate() { * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json */ async function materializedViewsBuilderServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -108,7 +106,7 @@ async function materializedViewsBuilderServiceCreate() { * This sample demonstrates how to Creates a service. * * @summary Creates a service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json */ async function sqlDedicatedGatewayServiceCreate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceDeleteSample.ts similarity index 88% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceDeleteSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceDeleteSample.ts index 28833728c1ad..8fdc4d4cb3e6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceDeleteSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceDeleteSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceDelete.json */ async function dataTransferServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -39,7 +37,7 @@ async function dataTransferServiceDelete() { * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json */ async function graphApiComputeServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -60,7 +58,7 @@ async function graphApiComputeServiceDelete() { * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json */ async function materializedViewsBuilderServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -81,7 +79,7 @@ async function materializedViewsBuilderServiceDelete() { * This sample demonstrates how to Deletes service with the given serviceName. * * @summary Deletes service with the given serviceName. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json */ async function sqlDedicatedGatewayServiceDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceGetSample.ts similarity index 88% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceGetSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceGetSample.ts index 390e1ae433c0..9ddc5d21695d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceGetSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceGetSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBDataTransferServiceGet.json */ async function dataTransferServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -39,7 +37,7 @@ async function dataTransferServiceGet() { * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json */ async function graphApiComputeServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -60,7 +58,7 @@ async function graphApiComputeServiceGet() { * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json */ async function materializedViewsBuilderServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -81,7 +79,7 @@ async function materializedViewsBuilderServiceGet() { * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json */ async function sqlDedicatedGatewayServiceGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceListSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceListSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceListSample.ts index 5d37ae555d50..26c43e8fc460 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceListSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/serviceListSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the status of service. * * @summary Gets the status of service. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBServicesList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBServicesList.json */ async function cosmosDbServicesList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateClientEncryptionKeySample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateClientEncryptionKeySample.ts similarity index 85% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateClientEncryptionKeySample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateClientEncryptionKeySample.ts index 4249a213b249..69bc19ebcce9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateClientEncryptionKeySample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateClientEncryptionKeySample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). * * @summary Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json */ async function cosmosDbClientEncryptionKeyCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subId"; @@ -40,7 +38,9 @@ async function cosmosDbClientEncryptionKeyCreateUpdate() { algorithm: "RSA-OAEP", value: "AzureKeyVault Key URL", }, - wrappedDataEncryptionKey: Buffer.from("U3dhZ2dlciByb2Nrcw=="), + wrappedDataEncryptionKey: Buffer.from( + "VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU=", + ), }, }; const credential = new DefaultAzureCredential(); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlContainerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlContainerSample.ts similarity index 50% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlContainerSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlContainerSample.ts index 387d67ec459f..93875393b1fc 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlContainerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlContainerSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL container * * @summary Create or update an Azure Cosmos DB SQL container - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json */ async function cosmosDbSqlContainerCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; @@ -112,8 +110,102 @@ async function cosmosDbSqlContainerCreateUpdate() { console.log(result); } +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB SQL container + * + * @summary Create or update an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRestore.json + */ +async function cosmosDbSqlContainerRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const createUpdateSqlContainerParameters: SqlContainerCreateUpdateParameters = + { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "containerName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: true, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginCreateUpdateSqlContainerAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + createUpdateSqlContainerParameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB SQL container + * + * @summary Create or update an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json + */ +async function cosmosDbSqlMaterializedViewCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "mvContainerName"; + const createUpdateSqlContainerParameters: SqlContainerCreateUpdateParameters = + { + location: "West US", + options: {}, + resource: { + id: "mvContainerName", + indexingPolicy: { + automatic: true, + excludedPaths: [], + includedPaths: [ + { + path: "/*", + indexes: [ + { dataType: "String", kind: "Range", precision: -1 }, + { dataType: "Number", kind: "Range", precision: -1 }, + ], + }, + ], + indexingMode: "consistent", + }, + materializedViewDefinition: { + definition: "select * from ROOT", + sourceCollectionId: "sourceContainerName", + }, + partitionKey: { kind: "Hash", paths: ["/mvpk"] }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginCreateUpdateSqlContainerAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + createUpdateSqlContainerParameters, + ); + console.log(result); +} + async function main() { cosmosDbSqlContainerCreateUpdate(); + cosmosDbSqlContainerRestore(); + cosmosDbSqlMaterializedViewCreateUpdate(); } main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlDatabaseSample.ts new file mode 100644 index 000000000000..aee41e3e72b1 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlDatabaseSample.ts @@ -0,0 +1,88 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + SqlDatabaseCreateUpdateParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB SQL database + * + * @summary Create or update an Azure Cosmos DB SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json + */ +async function cosmosDbSqlDatabaseCreateUpdate() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const createUpdateSqlDatabaseParameters: SqlDatabaseCreateUpdateParameters = { + location: "West US", + options: {}, + resource: { id: "databaseName" }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginCreateUpdateSqlDatabaseAndWait( + resourceGroupName, + accountName, + databaseName, + createUpdateSqlDatabaseParameters, + ); + console.log(result); +} + +/** + * This sample demonstrates how to Create or update an Azure Cosmos DB SQL database + * + * @summary Create or update an Azure Cosmos DB SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRestore.json + */ +async function cosmosDbSqlDatabaseRestore() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const createUpdateSqlDatabaseParameters: SqlDatabaseCreateUpdateParameters = { + location: "West US", + options: {}, + resource: { + createMode: "Restore", + id: "databaseName", + restoreParameters: { + restoreSource: + "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", + restoreTimestampInUtc: new Date("2022-07-20T18:28:00Z"), + restoreWithTtlDisabled: true, + }, + }, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.sqlResources.beginCreateUpdateSqlDatabaseAndWait( + resourceGroupName, + accountName, + databaseName, + createUpdateSqlDatabaseParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseCreateUpdate(); + cosmosDbSqlDatabaseRestore(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts similarity index 93% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts index 644f2e5587ae..15764416b3fc 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB SQL Role Assignment. * * @summary Creates or updates an Azure Cosmos DB SQL Role Assignment. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json */ async function cosmosDbSqlRoleAssignmentCreateUpdate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts similarity index 94% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts index 011fe662c2ce..de46cfe51251 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Creates or updates an Azure Cosmos DB SQL Role Definition. * * @summary Creates or updates an Azure Cosmos DB SQL Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json */ async function cosmosDbSqlRoleDefinitionCreateUpdate() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts index 9edf562119a7..f6b740de59f9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL storedProcedure * * @summary Create or update an Azure Cosmos DB SQL storedProcedure - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json */ async function cosmosDbSqlStoredProcedureCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlTriggerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlTriggerSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlTriggerSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlTriggerSample.ts index 1e8055bfa4c3..88601055f5f9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlTriggerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlTriggerSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL trigger * * @summary Create or update an Azure Cosmos DB SQL trigger - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json */ async function cosmosDbSqlTriggerCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts index af7f30a448d9..b98443de1238 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB SQL userDefinedFunction * * @summary Create or update an Azure Cosmos DB SQL userDefinedFunction - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json */ async function cosmosDbSqlUserDefinedFunctionCreateUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlContainerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlContainerSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlContainerSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlContainerSample.ts index 9a72a925498f..c574c9359ab1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlContainerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlContainerSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL container. * * @summary Deletes an existing Azure Cosmos DB SQL container. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerDelete.json */ async function cosmosDbSqlContainerDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlDatabaseSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlDatabaseSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlDatabaseSample.ts index 21d9aefcc03c..ff3a5e53f618 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlDatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL database. * * @summary Deletes an existing Azure Cosmos DB SQL database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseDelete.json */ async function cosmosDbSqlDatabaseDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlRoleAssignmentSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlRoleAssignmentSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlRoleAssignmentSample.ts index f614dcffb3dc..d40bbe6e8700 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlRoleAssignmentSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlRoleAssignmentSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL Role Assignment. * * @summary Deletes an existing Azure Cosmos DB SQL Role Assignment. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json */ async function cosmosDbSqlRoleAssignmentDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlRoleDefinitionSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlRoleDefinitionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlRoleDefinitionSample.ts index 5ae8e0f3f36e..fb5c60bdd580 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlRoleDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL Role Definition. * * @summary Deletes an existing Azure Cosmos DB SQL Role Definition. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json */ async function cosmosDbSqlRoleDefinitionDelete() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlStoredProcedureSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlStoredProcedureSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlStoredProcedureSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlStoredProcedureSample.ts index 8fe9920e9a59..7a5ae103d0c7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlStoredProcedureSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlStoredProcedureSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL storedProcedure. * * @summary Deletes an existing Azure Cosmos DB SQL storedProcedure. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureDelete.json */ async function cosmosDbSqlStoredProcedureDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlTriggerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlTriggerSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlTriggerSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlTriggerSample.ts index 1038bf68a3bf..2668b6d00544 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlTriggerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlTriggerSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL trigger. * * @summary Deletes an existing Azure Cosmos DB SQL trigger. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerDelete.json */ async function cosmosDbSqlTriggerDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts index ffa1ce204b3c..7a48e4cc98b9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * * @summary Deletes an existing Azure Cosmos DB SQL userDefinedFunction. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json */ async function cosmosDbSqlUserDefinedFunctionDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetClientEncryptionKeySample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetClientEncryptionKeySample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetClientEncryptionKeySample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetClientEncryptionKeySample.ts index b9d252657856..776b59511ee5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetClientEncryptionKeySample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetClientEncryptionKeySample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. * * @summary Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json */ async function cosmosDbClientEncryptionKeyGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlContainerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlContainerSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlContainerSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlContainerSample.ts index a10a556c43e1..a334025b1368 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlContainerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlContainerSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the SQL container under an existing Azure Cosmos DB database account. * * @summary Gets the SQL container under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerGet.json */ async function cosmosDbSqlContainerGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlContainerThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlContainerThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlContainerThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlContainerThroughputSample.ts index 8c1ca6c9cd00..001e6596b1a7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlContainerThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlContainerThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. * * @summary Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputGet.json */ async function cosmosDbSqlContainerThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlDatabaseSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlDatabaseSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlDatabaseSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlDatabaseSample.ts index 773d81ac43fa..b29b4990fb39 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlDatabaseSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlDatabaseSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseGet.json */ async function cosmosDbSqlDatabaseGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlDatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlDatabaseThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlDatabaseThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlDatabaseThroughputSample.ts index 99df276c5eb2..a17331412c5f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlDatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlDatabaseThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputGet.json */ async function cosmosDbSqlDatabaseThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlRoleAssignmentSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlRoleAssignmentSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlRoleAssignmentSample.ts index c3d3cedb1feb..4f5cf95f2c6b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlRoleAssignmentSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlRoleAssignmentSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json */ async function cosmosDbSqlRoleAssignmentGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlRoleDefinitionSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlRoleDefinitionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlRoleDefinitionSample.ts index e2c888c6c160..f7cb3a99763a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlRoleDefinitionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlRoleDefinitionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. * * @summary Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json */ async function cosmosDbSqlRoleDefinitionGet() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlStoredProcedureSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlStoredProcedureSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlStoredProcedureSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlStoredProcedureSample.ts index 17a3fc0a13d9..d0313a507152 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlStoredProcedureSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlStoredProcedureSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. * * @summary Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureGet.json */ async function cosmosDbSqlStoredProcedureGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlTriggerSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlTriggerSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlTriggerSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlTriggerSample.ts index 0ada7798453f..30ea6fd7e186 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlTriggerSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlTriggerSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the SQL trigger under an existing Azure Cosmos DB database account. * * @summary Gets the SQL trigger under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerGet.json */ async function cosmosDbSqlTriggerGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlUserDefinedFunctionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlUserDefinedFunctionSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlUserDefinedFunctionSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlUserDefinedFunctionSample.ts index 819b3cd55e1b..fc0545fdd179 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlUserDefinedFunctionSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesGetSqlUserDefinedFunctionSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * * @summary Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json */ async function cosmosDbSqlUserDefinedFunctionGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListClientEncryptionKeysSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListClientEncryptionKeysSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListClientEncryptionKeysSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListClientEncryptionKeysSample.ts index 5386fc292734..6e7284e70021 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListClientEncryptionKeysSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListClientEncryptionKeysSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. * * @summary Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeysList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlClientEncryptionKeysList.json */ async function cosmosDbClientEncryptionKeysList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subId"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlContainerPartitionMergeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlContainerPartitionMergeSample.ts new file mode 100644 index 000000000000..49d55c241776 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlContainerPartitionMergeSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { MergeParameters, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Merges the partitions of a SQL Container + * + * @summary Merges the partitions of a SQL Container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerPartitionMerge.json + */ +async function cosmosDbSqlContainerPartitionMerge() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const mergeParameters: MergeParameters = { isDryRun: false }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.sqlResources.beginListSqlContainerPartitionMergeAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + mergeParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlContainerPartitionMerge(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlContainersSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlContainersSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlContainersSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlContainersSample.ts index c8b4e713a6c8..d7d9c1735cd3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlContainersSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlContainersSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the SQL container under an existing Azure Cosmos DB database account. * * @summary Lists the SQL container under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerList.json */ async function cosmosDbSqlContainerList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlDatabasesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlDatabasesSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlDatabasesSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlDatabasesSample.ts index 8fdcbcd5420b..ba8f753263f4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlDatabasesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlDatabasesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the SQL databases under an existing Azure Cosmos DB database account. * * @summary Lists the SQL databases under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseList.json */ async function cosmosDbSqlDatabaseList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlRoleAssignmentsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlRoleAssignmentsSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlRoleAssignmentsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlRoleAssignmentsSample.ts index 031f8528ffad..bb8baa381290 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlRoleAssignmentsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlRoleAssignmentsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB SQL Role Assignments. * * @summary Retrieves the list of all Azure Cosmos DB SQL Role Assignments. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleAssignmentList.json */ async function cosmosDbSqlRoleAssignmentList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlRoleDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlRoleDefinitionsSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlRoleDefinitionsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlRoleDefinitionsSample.ts index 60b680d26aef..8c870d4a7b2e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlRoleDefinitionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlRoleDefinitionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB SQL Role Definitions. * * @summary Retrieves the list of all Azure Cosmos DB SQL Role Definitions. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlRoleDefinitionList.json */ async function cosmosDbSqlRoleDefinitionList() { const subscriptionId = diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlStoredProceduresSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlStoredProceduresSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlStoredProceduresSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlStoredProceduresSample.ts index 9eab0671efa6..26cdcb0878b9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlStoredProceduresSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlStoredProceduresSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. * * @summary Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlStoredProcedureList.json */ async function cosmosDbSqlStoredProcedureList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlTriggersSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlTriggersSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlTriggersSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlTriggersSample.ts index 135179faf833..ff5316a00a5d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlTriggersSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlTriggersSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the SQL trigger under an existing Azure Cosmos DB database account. * * @summary Lists the SQL trigger under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlTriggerList.json */ async function cosmosDbSqlTriggerList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlUserDefinedFunctionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlUserDefinedFunctionsSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlUserDefinedFunctionsSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlUserDefinedFunctionsSample.ts index 7310f9cf4445..de73cd31a9a3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlUserDefinedFunctionsSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesListSqlUserDefinedFunctionsSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * * @summary Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlUserDefinedFunctionList.json */ async function cosmosDbSqlUserDefinedFunctionList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts index 749db4702caf..322c116eb11d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json */ async function cosmosDbSqlContainerMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts index e4d687a7ef15..6ad91194f88a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json */ async function cosmosDbSqlContainerMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts index 288e57b80d14..65f5576a47a1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json */ async function cosmosDbSqlDatabaseMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts index 255c4027613b..74617f54969e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json */ async function cosmosDbSqlDatabaseMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesRetrieveContinuousBackupInformationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesRetrieveContinuousBackupInformationSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesRetrieveContinuousBackupInformationSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesRetrieveContinuousBackupInformationSample.ts index 4ed7d80b2fee..1a13a92be337 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesRetrieveContinuousBackupInformationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesRetrieveContinuousBackupInformationSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves continuous backup information for a container resource. * * @summary Retrieves continuous backup information for a container resource. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerBackupInformation.json */ async function cosmosDbSqlContainerBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlContainerRedistributeThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlContainerRedistributeThroughputSample.ts new file mode 100644 index 000000000000..7257e6bd3c10 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlContainerRedistributeThroughputSample.ts @@ -0,0 +1,60 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RedistributeThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB SQL container + * + * @summary Redistribute throughput for an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json + */ +async function cosmosDbSqlContainerRedistributeThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const redistributeThroughputParameters: RedistributeThroughputParameters = { + resource: { + sourcePhysicalPartitionThroughputInfo: [ + { id: "2", throughput: 5000 }, + { id: "3" }, + ], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, + ], + throughputPolicy: "custom", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.sqlResources.beginSqlContainerRedistributeThroughputAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + redistributeThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlContainerRedistributeThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlContainerRetrieveThroughputDistributionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlContainerRetrieveThroughputDistributionSample.ts new file mode 100644 index 000000000000..8dd7fcb86703 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlContainerRetrieveThroughputDistributionSample.ts @@ -0,0 +1,50 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RetrieveThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB SQL container + * + * @summary Retrieve throughput distribution for an Azure Cosmos DB SQL container + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json + */ +async function cosmosDbSqlContainerRetrieveThroughputDistribution() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const containerName = "containerName"; + const retrieveThroughputParameters: RetrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.sqlResources.beginSqlContainerRetrieveThroughputDistributionAndWait( + resourceGroupName, + accountName, + databaseName, + containerName, + retrieveThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlContainerRetrieveThroughputDistribution(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabasePartitionMergeSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabasePartitionMergeSample.ts new file mode 100644 index 000000000000..f1fb47d47c7a --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabasePartitionMergeSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { MergeParameters, CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Merges the partitions of a SQL database + * + * @summary Merges the partitions of a SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabasePartitionMerge.json + */ +async function cosmosDbSqlDatabasePartitionMerge() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const mergeParameters: MergeParameters = { isDryRun: false }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.sqlResources.beginSqlDatabasePartitionMergeAndWait( + resourceGroupName, + accountName, + databaseName, + mergeParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabasePartitionMerge(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabaseRedistributeThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabaseRedistributeThroughputSample.ts new file mode 100644 index 000000000000..c6b8f6b21750 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabaseRedistributeThroughputSample.ts @@ -0,0 +1,58 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RedistributeThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Redistribute throughput for an Azure Cosmos DB SQL database + * + * @summary Redistribute throughput for an Azure Cosmos DB SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json + */ +async function cosmosDbSqlDatabaseRedistributeThroughput() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const redistributeThroughputParameters: RedistributeThroughputParameters = { + resource: { + sourcePhysicalPartitionThroughputInfo: [ + { id: "2", throughput: 5000 }, + { id: "3" }, + ], + targetPhysicalPartitionThroughputInfo: [ + { id: "0", throughput: 5000 }, + { id: "1", throughput: 5000 }, + ], + throughputPolicy: "custom", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.sqlResources.beginSqlDatabaseRedistributeThroughputAndWait( + resourceGroupName, + accountName, + databaseName, + redistributeThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseRedistributeThroughput(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.ts new file mode 100644 index 000000000000..b2fb85392d96 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesSqlDatabaseRetrieveThroughputDistributionSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RetrieveThroughputParameters, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieve throughput distribution for an Azure Cosmos DB SQL database + * + * @summary Retrieve throughput distribution for an Azure Cosmos DB SQL database + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json + */ +async function cosmosDbSqlDatabaseRetrieveThroughputDistribution() { + const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const accountName = "ddb1"; + const databaseName = "databaseName"; + const retrieveThroughputParameters: RetrieveThroughputParameters = { + resource: { physicalPartitionIds: [{ id: "0" }, { id: "1" }] }, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.sqlResources.beginSqlDatabaseRetrieveThroughputDistributionAndWait( + resourceGroupName, + accountName, + databaseName, + retrieveThroughputParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbSqlDatabaseRetrieveThroughputDistribution(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesUpdateSqlContainerThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesUpdateSqlContainerThroughputSample.ts similarity index 92% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesUpdateSqlContainerThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesUpdateSqlContainerThroughputSample.ts index bf09b1bc5192..0871684a0f90 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesUpdateSqlContainerThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesUpdateSqlContainerThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB SQL container * * @summary Update RUs per second of an Azure Cosmos DB SQL container - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlContainerThroughputUpdate.json */ async function cosmosDbSqlContainerThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesUpdateSqlDatabaseThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesUpdateSqlDatabaseThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesUpdateSqlDatabaseThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesUpdateSqlDatabaseThroughputSample.ts index f938c16ab62d..c7af11ab2ae2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesUpdateSqlDatabaseThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/sqlResourcesUpdateSqlDatabaseThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB SQL database * * @summary Update RUs per second of an Azure Cosmos DB SQL database - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json */ async function cosmosDbSqlDatabaseThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableRoleAssignmentSample.ts new file mode 100644 index 000000000000..04f9d9ebc582 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableRoleAssignmentSample.ts @@ -0,0 +1,56 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TableRoleAssignmentResource, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB Table Role Assignment. + * + * @summary Creates or updates an Azure Cosmos DB Table Role Assignment. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentCreateUpdate.json + */ +async function cosmosDbTableRoleAssignmentCreateUpdate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleAssignmentId = "myRoleAssignmentId"; + const createUpdateTableRoleAssignmentParameters: TableRoleAssignmentResource = + { + principalId: "myPrincipalId", + roleDefinitionId: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/tableRoleDefinitions/myRoleDefinitionId", + scope: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases/colls/redmond-purchases", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.tableResources.beginCreateUpdateTableRoleAssignmentAndWait( + resourceGroupName, + accountName, + roleAssignmentId, + createUpdateTableRoleAssignmentParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleAssignmentCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableRoleDefinitionSample.ts new file mode 100644 index 000000000000..f48634ace8a3 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableRoleDefinitionSample.ts @@ -0,0 +1,66 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TableRoleDefinitionResource, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB Table Role Definition. + * + * @summary Creates or updates an Azure Cosmos DB Table Role Definition. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionCreateUpdate.json + */ +async function cosmosDbTableRoleDefinitionCreateUpdate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleDefinitionId = "myRoleDefinitionId"; + const createUpdateTableRoleDefinitionParameters: TableRoleDefinitionResource = + { + typePropertiesType: "CustomRole", + assignableScopes: [ + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/sales", + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/myResourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/dbs/purchases", + ], + permissions: [ + { + dataActions: [ + "Microsoft.DocumentDB/databaseAccounts/tableDatabases/containers/entities/create", + "Microsoft.DocumentDB/databaseAccounts/tableDatabases/containers/entities/read", + ], + notDataActions: [], + }, + ], + roleName: "myRoleName", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.tableResources.beginCreateUpdateTableRoleDefinitionAndWait( + resourceGroupName, + accountName, + roleDefinitionId, + createUpdateTableRoleDefinitionParameters, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleDefinitionCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesCreateUpdateTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesCreateUpdateTableSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableSample.ts index 7995b7e1dda6..c7603d6ee4a4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesCreateUpdateTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesCreateUpdateTableSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Create or update an Azure Cosmos DB Table * * @summary Create or update an Azure Cosmos DB Table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableCreateUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableCreateUpdate.json */ async function cosmosDbTableReplace() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableRoleAssignmentSample.ts new file mode 100644 index 000000000000..472c1e01c61d --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableRoleAssignmentSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Table Role Assignment. + * + * @summary Deletes an existing Azure Cosmos DB Table Role Assignment. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentDelete.json + */ +async function cosmosDbTableRoleAssignmentDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleAssignmentId = "myRoleAssignmentId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.tableResources.beginDeleteTableRoleAssignmentAndWait( + resourceGroupName, + accountName, + roleAssignmentId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleAssignmentDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableRoleDefinitionSample.ts new file mode 100644 index 000000000000..24f4abe17266 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableRoleDefinitionSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Table Role Definition. + * + * @summary Deletes an existing Azure Cosmos DB Table Role Definition. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionDelete.json + */ +async function cosmosDbTableRoleDefinitionDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleDefinitionId = "myRoleDefinitionId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = + await client.tableResources.beginDeleteTableRoleDefinitionAndWait( + resourceGroupName, + accountName, + roleDefinitionId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleDefinitionDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesDeleteTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesDeleteTableSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableSample.ts index 4b98a6e095f9..92d99d92ce01 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesDeleteTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesDeleteTableSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Deletes an existing Azure Cosmos DB Table. * * @summary Deletes an existing Azure Cosmos DB Table. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableDelete.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableDelete.json */ async function cosmosDbTableDelete() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableRoleAssignmentSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableRoleAssignmentSample.ts new file mode 100644 index 000000000000..bb44542fb9af --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableRoleAssignmentSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentGet.json + */ +async function cosmosDbTableRoleAssignmentGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleAssignmentId = "myRoleAssignmentId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.tableResources.getTableRoleAssignment( + resourceGroupName, + accountName, + roleAssignmentId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleAssignmentGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableRoleDefinitionSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableRoleDefinitionSample.ts new file mode 100644 index 000000000000..81a9c5c48808 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableRoleDefinitionSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionGet.json + */ +async function cosmosDbTableRoleDefinitionGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const roleDefinitionId = "myRoleDefinitionId"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.tableResources.getTableRoleDefinition( + resourceGroupName, + accountName, + roleDefinitionId, + ); + console.log(result); +} + +async function main() { + cosmosDbTableRoleDefinitionGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesGetTableSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesGetTableSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableSample.ts index a93f754dc1cc..2076eed43f65 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesGetTableSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the Tables under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the Tables under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableGet.json */ async function cosmosDbTableGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesGetTableThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesGetTableThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableThroughputSample.ts index b69ff7564131..1d0f57c75c1d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesGetTableThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesGetTableThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. * * @summary Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputGet.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputGet.json */ async function cosmosDbTableThroughputGet() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTableRoleAssignmentsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTableRoleAssignmentsSample.ts new file mode 100644 index 000000000000..34c827de43cc --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTableRoleAssignmentsSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * + * @summary Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleAssignmentList.json + */ +async function cosmosDbTableRoleAssignmentList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.tableResources.listTableRoleAssignments( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbTableRoleAssignmentList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTableRoleDefinitionsSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTableRoleDefinitionsSample.ts new file mode 100644 index 000000000000..6dd222724d6b --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTableRoleDefinitionsSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the list of all Azure Cosmos DB Table Role Definitions. + * + * @summary Retrieves the list of all Azure Cosmos DB Table Role Definitions. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/tablerbac/CosmosDBTableRoleDefinitionList.json + */ +async function cosmosDbTableRoleDefinitionList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = + process.env["COSMOSDB_RESOURCE_GROUP"] || "myResourceGroupName"; + const accountName = "myAccountName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.tableResources.listTableRoleDefinitions( + resourceGroupName, + accountName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbTableRoleDefinitionList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesListTablesSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTablesSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesListTablesSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTablesSample.ts index 8cc3a8c536ed..f2fade798236 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesListTablesSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesListTablesSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Lists the Tables under an existing Azure Cosmos DB database account. * * @summary Lists the Tables under an existing Azure Cosmos DB database account. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableList.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableList.json */ async function cosmosDbTableList() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesMigrateTableToAutoscaleSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesMigrateTableToAutoscaleSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesMigrateTableToAutoscaleSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesMigrateTableToAutoscaleSample.ts index 3351c3d2dacc..1a03c2963466 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesMigrateTableToAutoscaleSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesMigrateTableToAutoscaleSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Table from manual throughput to autoscale * * @summary Migrate an Azure Cosmos DB Table from manual throughput to autoscale - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToAutoscale.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToAutoscale.json */ async function cosmosDbTableMigrateToAutoscale() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesMigrateTableToManualThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesMigrateTableToManualThroughputSample.ts similarity index 90% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesMigrateTableToManualThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesMigrateTableToManualThroughputSample.ts index 2f953cc797fc..9bc1e59b13a5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesMigrateTableToManualThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesMigrateTableToManualThroughputSample.ts @@ -10,15 +10,13 @@ // Licensed under the MIT License. import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Migrate an Azure Cosmos DB Table from autoscale to manual throughput * * @summary Migrate an Azure Cosmos DB Table from autoscale to manual throughput - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToManualThroughput.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableMigrateToManualThroughput.json */ async function cosmosDbTableMigrateToManualThroughput() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesRetrieveContinuousBackupInformationSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesRetrieveContinuousBackupInformationSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesRetrieveContinuousBackupInformationSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesRetrieveContinuousBackupInformationSample.ts index db5b04471043..d316ed5418e7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesRetrieveContinuousBackupInformationSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesRetrieveContinuousBackupInformationSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Retrieves continuous backup information for a table. * * @summary Retrieves continuous backup information for a table. - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableBackupInformation.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableBackupInformation.json */ async function cosmosDbTableCollectionBackupInformation() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesUpdateTableThroughputSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesUpdateTableThroughputSample.ts similarity index 91% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesUpdateTableThroughputSample.ts rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesUpdateTableThroughputSample.ts index 1ea2878e68e3..3f95ed0fa16a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesUpdateTableThroughputSample.ts +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/tableResourcesUpdateTableThroughputSample.ts @@ -13,15 +13,13 @@ import { CosmosDBManagementClient, } from "@azure/arm-cosmosdb"; import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); +import "dotenv/config"; /** * This sample demonstrates how to Update RUs per second of an Azure Cosmos DB Table * * @summary Update RUs per second of an Azure Cosmos DB Table - * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputUpdate.json + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/CosmosDBTableThroughputUpdate.json */ async function cosmosDbTableThroughputUpdate() { const subscriptionId = process.env["COSMOSDB_SUBSCRIPTION_ID"] || "subid"; diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountCreateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountCreateSample.ts new file mode 100644 index 000000000000..2b189c064870 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountCreateSample.ts @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ThroughputPoolAccountResource, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * + * @summary Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json + */ +async function cosmosDbThroughputPoolAccountCreate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const throughputPoolName = "tp1"; + const throughputPoolAccountName = "db1"; + const body: ThroughputPoolAccountResource = { + accountLocation: "West US", + accountResourceIdentifier: + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/", + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPoolAccount.beginCreateAndWait( + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + body, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolAccountCreate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountDeleteSample.ts new file mode 100644 index 000000000000..2ed118624d0f --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountDeleteSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @summary Removes an existing Azure Cosmos DB database account from a throughput pool. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json + */ +async function cosmosDbThroughputPoolAccountDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const throughputPoolAccountName = "db1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPoolAccount.beginDeleteAndWait( + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolAccountDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountGetSample.ts new file mode 100644 index 000000000000..d5dfc891b6de --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountGetSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json + */ +async function cosmosDbThroughputPoolAccountGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const throughputPoolAccountName = "db1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPoolAccount.get( + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolAccountGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountsListSample.ts new file mode 100644 index 000000000000..9fce3a1d9c6a --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolAccountsListSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @summary Lists all the Azure Cosmos DB accounts available under the subscription. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json + */ +async function cosmosDbThroughputPoolAccountList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.throughputPoolAccounts.list( + resourceGroupName, + throughputPoolName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbThroughputPoolAccountList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolCreateOrUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolCreateOrUpdateSample.ts new file mode 100644 index 000000000000..39d55fca4edb --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolCreateOrUpdateSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ThroughputPoolResource, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * + * @summary Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing updates on an account. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json + */ +async function cosmosDbThroughputPoolCreate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const throughputPoolName = "tp1"; + const body: ThroughputPoolResource = { + location: "westus2", + maxThroughput: 10000, + tags: {}, + }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.beginCreateOrUpdateAndWait( + resourceGroupName, + throughputPoolName, + body, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolCreate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolDeleteSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolDeleteSample.ts new file mode 100644 index 000000000000..ba95f40f84c0 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolDeleteSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @summary Deletes an existing Azure Cosmos DB Throughput Pool. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json + */ +async function cosmosDbThroughputPoolDelete() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.beginDeleteAndWait( + resourceGroupName, + throughputPoolName, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolDelete(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolGetSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolGetSample.ts new file mode 100644 index 000000000000..f490c3ea474e --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolGetSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * + * @summary Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json + */ +async function cosmosDbThroughputPoolGet() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const throughputPoolName = "tp1"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.get( + resourceGroupName, + throughputPoolName, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolGet(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolUpdateSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolUpdateSample.ts new file mode 100644 index 000000000000..08a2aeb2813f --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ThroughputPoolUpdate, + ThroughputPoolUpdateOptionalParams, + CosmosDBManagementClient, +} from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @summary Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json + */ +async function cosmosDbThroughputPoolUpdate() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rg1"; + const throughputPoolName = "tp1"; + const body: ThroughputPoolUpdate = { maxThroughput: 10000 }; + const options: ThroughputPoolUpdateOptionalParams = { body }; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const result = await client.throughputPool.beginUpdateAndWait( + resourceGroupName, + throughputPoolName, + options, + ); + console.log(result); +} + +async function main() { + cosmosDbThroughputPoolUpdate(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolsListByResourceGroupSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolsListByResourceGroupSample.ts new file mode 100644 index 000000000000..f122758ddbd8 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolsListByResourceGroupSample.ts @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to List all the ThroughputPools in a given resource group. + * + * @summary List all the ThroughputPools in a given resource group. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json + */ +async function cosmosDbThroughputPoolListByResourceGroup() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const resourceGroupName = process.env["COSMOSDB_RESOURCE_GROUP"] || "rgName"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.throughputPools.listByResourceGroup( + resourceGroupName, + )) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbThroughputPoolListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolsListSample.ts b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolsListSample.ts new file mode 100644 index 000000000000..af755a712c72 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/src/throughputPoolsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { CosmosDBManagementClient } from "@azure/arm-cosmosdb"; +import { DefaultAzureCredential } from "@azure/identity"; +import "dotenv/config"; + +/** + * This sample demonstrates how to Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @summary Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json + */ +async function cosmosDbThroughputPoolList() { + const subscriptionId = + process.env["COSMOSDB_SUBSCRIPTION_ID"] || + "ffffffff-ffff-ffff-ffff-ffffffffffff"; + const credential = new DefaultAzureCredential(); + const client = new CosmosDBManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.throughputPools.list()) { + resArray.push(item); + } + console.log(resArray); +} + +async function main() { + cosmosDbThroughputPoolList(); +} + +main().catch(console.error); diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/tsconfig.json b/sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/tsconfig.json similarity index 100% rename from sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/tsconfig.json rename to sdk/cosmosdb/arm-cosmosdb/samples/v16-beta/typescript/tsconfig.json diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/README.md b/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/README.md deleted file mode 100644 index 4f59f05c8f8c..000000000000 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/README.md +++ /dev/null @@ -1,428 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [cassandraClustersCreateUpdateSample.js][cassandraclusterscreateupdatesample] | Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterCreate.json | -| [cassandraClustersDeallocateSample.js][cassandraclustersdeallocatesample] | Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDeallocate.json | -| [cassandraClustersDeleteSample.js][cassandraclustersdeletesample] | Deletes a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDelete.json | -| [cassandraClustersGetSample.js][cassandraclustersgetsample] | Get the properties of a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterGet.json | -| [cassandraClustersInvokeCommandSample.js][cassandraclustersinvokecommandsample] | Invoke a command like nodetool for cassandra maintenance x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraCommand.json | -| [cassandraClustersListByResourceGroupSample.js][cassandraclusterslistbyresourcegroupsample] | List all managed Cassandra clusters in this resource group. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json | -| [cassandraClustersListBySubscriptionSample.js][cassandraclusterslistbysubscriptionsample] | List all managed Cassandra clusters in this subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json | -| [cassandraClustersStartSample.js][cassandraclustersstartsample] | Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterStart.json | -| [cassandraClustersStatusSample.js][cassandraclustersstatussample] | Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraStatus.json | -| [cassandraClustersUpdateSample.js][cassandraclustersupdatesample] | Updates some of the properties of a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterPatch.json | -| [cassandraDataCentersCreateUpdateSample.js][cassandradatacenterscreateupdatesample] | Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterCreate.json | -| [cassandraDataCentersDeleteSample.js][cassandradatacentersdeletesample] | Delete a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterDelete.json | -| [cassandraDataCentersGetSample.js][cassandradatacentersgetsample] | Get the properties of a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterGet.json | -| [cassandraDataCentersListSample.js][cassandradatacenterslistsample] | List all data centers in a particular managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterList.json | -| [cassandraDataCentersUpdateSample.js][cassandradatacentersupdatesample] | Update some of the properties of a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterPatch.json | -| [cassandraResourcesCreateUpdateCassandraKeyspaceSample.js][cassandraresourcescreateupdatecassandrakeyspacesample] | Create or update an Azure Cosmos DB Cassandra keyspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json | -| [cassandraResourcesCreateUpdateCassandraTableSample.js][cassandraresourcescreateupdatecassandratablesample] | Create or update an Azure Cosmos DB Cassandra Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableCreateUpdate.json | -| [cassandraResourcesDeleteCassandraKeyspaceSample.js][cassandraresourcesdeletecassandrakeyspacesample] | Deletes an existing Azure Cosmos DB Cassandra keyspace. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceDelete.json | -| [cassandraResourcesDeleteCassandraTableSample.js][cassandraresourcesdeletecassandratablesample] | Deletes an existing Azure Cosmos DB Cassandra table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableDelete.json | -| [cassandraResourcesGetCassandraKeyspaceSample.js][cassandraresourcesgetcassandrakeyspacesample] | Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceGet.json | -| [cassandraResourcesGetCassandraKeyspaceThroughputSample.js][cassandraresourcesgetcassandrakeyspacethroughputsample] | Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json | -| [cassandraResourcesGetCassandraTableSample.js][cassandraresourcesgetcassandratablesample] | Gets the Cassandra table under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableGet.json | -| [cassandraResourcesGetCassandraTableThroughputSample.js][cassandraresourcesgetcassandratablethroughputsample] | Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputGet.json | -| [cassandraResourcesListCassandraKeyspacesSample.js][cassandraresourceslistcassandrakeyspacessample] | Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceList.json | -| [cassandraResourcesListCassandraTablesSample.js][cassandraresourceslistcassandratablessample] | Lists the Cassandra table under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableList.json | -| [cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.js][cassandraresourcesmigratecassandrakeyspacetoautoscalesample] | Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json | -| [cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.js][cassandraresourcesmigratecassandrakeyspacetomanualthroughputsample] | Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json | -| [cassandraResourcesMigrateCassandraTableToAutoscaleSample.js][cassandraresourcesmigratecassandratabletoautoscalesample] | Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json | -| [cassandraResourcesMigrateCassandraTableToManualThroughputSample.js][cassandraresourcesmigratecassandratabletomanualthroughputsample] | Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json | -| [cassandraResourcesUpdateCassandraKeyspaceThroughputSample.js][cassandraresourcesupdatecassandrakeyspacethroughputsample] | Update RUs per second of an Azure Cosmos DB Cassandra Keyspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json | -| [cassandraResourcesUpdateCassandraTableThroughputSample.js][cassandraresourcesupdatecassandratablethroughputsample] | Update RUs per second of an Azure Cosmos DB Cassandra table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputUpdate.json | -| [collectionListMetricDefinitionsSample.js][collectionlistmetricdefinitionssample] | Retrieves metric definitions for the given collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetricDefinitions.json | -| [collectionListMetricsSample.js][collectionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetrics.json | -| [collectionListUsagesSample.js][collectionlistusagessample] | Retrieves the usages (most recent storage data) for the given collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetUsages.json | -| [collectionPartitionListMetricsSample.js][collectionpartitionlistmetricssample] | Retrieves the metrics determined by the given filter for the given collection, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetMetrics.json | -| [collectionPartitionListUsagesSample.js][collectionpartitionlistusagessample] | Retrieves the usages (most recent storage data) for the given collection, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetUsages.json | -| [collectionPartitionRegionListMetricsSample.js][collectionpartitionregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given collection and region, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json | -| [collectionRegionListMetricsSample.js][collectionregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account, collection and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRegionCollectionGetMetrics.json | -| [databaseAccountRegionListMetricsSample.js][databaseaccountregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json | -| [databaseAccountsCheckNameExistsSample.js][databaseaccountschecknameexistssample] | Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCheckNameExists.json | -| [databaseAccountsCreateOrUpdateSample.js][databaseaccountscreateorupdatesample] | Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMax.json | -| [databaseAccountsDeleteSample.js][databaseaccountsdeletesample] | Deletes an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountDelete.json | -| [databaseAccountsFailoverPriorityChangeSample.js][databaseaccountsfailoverprioritychangesample] | Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json | -| [databaseAccountsGetReadOnlyKeysSample.js][databaseaccountsgetreadonlykeyssample] | Lists the read-only access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json | -| [databaseAccountsGetSample.js][databaseaccountsgetsample] | Retrieves the properties of an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGet.json | -| [databaseAccountsListByResourceGroupSample.js][databaseaccountslistbyresourcegroupsample] | Lists all the Azure Cosmos DB database accounts available under the given resource group. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json | -| [databaseAccountsListConnectionStringsSample.js][databaseaccountslistconnectionstringssample] | Lists the connection strings for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json | -| [databaseAccountsListKeysSample.js][databaseaccountslistkeyssample] | Lists the access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListKeys.json | -| [databaseAccountsListMetricDefinitionsSample.js][databaseaccountslistmetricdefinitionssample] | Retrieves metric definitions for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json | -| [databaseAccountsListMetricsSample.js][databaseaccountslistmetricssample] | Retrieves the metrics determined by the given filter for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetrics.json | -| [databaseAccountsListReadOnlyKeysSample.js][databaseaccountslistreadonlykeyssample] | Lists the read-only access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json | -| [databaseAccountsListSample.js][databaseaccountslistsample] | Lists all the Azure Cosmos DB database accounts available under the subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountList.json | -| [databaseAccountsListUsagesSample.js][databaseaccountslistusagessample] | Retrieves the usages (most recent data) for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetUsages.json | -| [databaseAccountsOfflineRegionSample.js][databaseaccountsofflineregionsample] | Offline the specified region for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOfflineRegion.json | -| [databaseAccountsOnlineRegionSample.js][databaseaccountsonlineregionsample] | Online the specified region for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOnlineRegion.json | -| [databaseAccountsRegenerateKeySample.js][databaseaccountsregeneratekeysample] | Regenerates an access key for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegenerateKey.json | -| [databaseAccountsUpdateSample.js][databaseaccountsupdatesample] | Updates the properties of an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountPatch.json | -| [databaseListMetricDefinitionsSample.js][databaselistmetricdefinitionssample] | Retrieves metric definitions for the given database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetricDefinitions.json | -| [databaseListMetricsSample.js][databaselistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetrics.json | -| [databaseListUsagesSample.js][databaselistusagessample] | Retrieves the usages (most recent data) for the given database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetUsages.json | -| [gremlinResourcesCreateUpdateGremlinDatabaseSample.js][gremlinresourcescreateupdategremlindatabasesample] | Create or update an Azure Cosmos DB Gremlin database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json | -| [gremlinResourcesCreateUpdateGremlinGraphSample.js][gremlinresourcescreateupdategremlingraphsample] | Create or update an Azure Cosmos DB Gremlin graph x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphCreateUpdate.json | -| [gremlinResourcesDeleteGremlinDatabaseSample.js][gremlinresourcesdeletegremlindatabasesample] | Deletes an existing Azure Cosmos DB Gremlin database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseDelete.json | -| [gremlinResourcesDeleteGremlinGraphSample.js][gremlinresourcesdeletegremlingraphsample] | Deletes an existing Azure Cosmos DB Gremlin graph. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphDelete.json | -| [gremlinResourcesGetGremlinDatabaseSample.js][gremlinresourcesgetgremlindatabasesample] | Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseGet.json | -| [gremlinResourcesGetGremlinDatabaseThroughputSample.js][gremlinresourcesgetgremlindatabasethroughputsample] | Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputGet.json | -| [gremlinResourcesGetGremlinGraphSample.js][gremlinresourcesgetgremlingraphsample] | Gets the Gremlin graph under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphGet.json | -| [gremlinResourcesGetGremlinGraphThroughputSample.js][gremlinresourcesgetgremlingraphthroughputsample] | Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputGet.json | -| [gremlinResourcesListGremlinDatabasesSample.js][gremlinresourceslistgremlindatabasessample] | Lists the Gremlin databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseList.json | -| [gremlinResourcesListGremlinGraphsSample.js][gremlinresourceslistgremlingraphssample] | Lists the Gremlin graph under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphList.json | -| [gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.js][gremlinresourcesmigrategremlindatabasetoautoscalesample] | Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json | -| [gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.js][gremlinresourcesmigrategremlindatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json | -| [gremlinResourcesMigrateGremlinGraphToAutoscaleSample.js][gremlinresourcesmigrategremlingraphtoautoscalesample] | Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json | -| [gremlinResourcesMigrateGremlinGraphToManualThroughputSample.js][gremlinresourcesmigrategremlingraphtomanualthroughputsample] | Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json | -| [gremlinResourcesRetrieveContinuousBackupInformationSample.js][gremlinresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a gremlin graph. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphBackupInformation.json | -| [gremlinResourcesUpdateGremlinDatabaseThroughputSample.js][gremlinresourcesupdategremlindatabasethroughputsample] | Update RUs per second of an Azure Cosmos DB Gremlin database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json | -| [gremlinResourcesUpdateGremlinGraphThroughputSample.js][gremlinresourcesupdategremlingraphthroughputsample] | Update RUs per second of an Azure Cosmos DB Gremlin graph x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputUpdate.json | -| [locationsGetSample.js][locationsgetsample] | Get the properties of an existing Cosmos DB location x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationGet.json | -| [locationsListSample.js][locationslistsample] | List Cosmos DB locations and their properties x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationList.json | -| [mongoDbResourcesCreateUpdateMongoDbcollectionSample.js][mongodbresourcescreateupdatemongodbcollectionsample] | Create or update an Azure Cosmos DB MongoDB Collection x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json | -| [mongoDbResourcesCreateUpdateMongoDbdatabaseSample.js][mongodbresourcescreateupdatemongodbdatabasesample] | Create or updates Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json | -| [mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.js][mongodbresourcescreateupdatemongoroledefinitionsample] | Creates or updates an Azure Cosmos DB Mongo Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json | -| [mongoDbResourcesCreateUpdateMongoUserDefinitionSample.js][mongodbresourcescreateupdatemongouserdefinitionsample] | Creates or updates an Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json | -| [mongoDbResourcesDeleteMongoDbcollectionSample.js][mongodbresourcesdeletemongodbcollectionsample] | Deletes an existing Azure Cosmos DB MongoDB Collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionDelete.json | -| [mongoDbResourcesDeleteMongoDbdatabaseSample.js][mongodbresourcesdeletemongodbdatabasesample] | Deletes an existing Azure Cosmos DB MongoDB database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseDelete.json | -| [mongoDbResourcesDeleteMongoRoleDefinitionSample.js][mongodbresourcesdeletemongoroledefinitionsample] | Deletes an existing Azure Cosmos DB Mongo Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionDelete.json | -| [mongoDbResourcesDeleteMongoUserDefinitionSample.js][mongodbresourcesdeletemongouserdefinitionsample] | Deletes an existing Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionDelete.json | -| [mongoDbResourcesGetMongoDbcollectionSample.js][mongodbresourcesgetmongodbcollectionsample] | Gets the MongoDB collection under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionGet.json | -| [mongoDbResourcesGetMongoDbcollectionThroughputSample.js][mongodbresourcesgetmongodbcollectionthroughputsample] | Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputGet.json | -| [mongoDbResourcesGetMongoDbdatabaseSample.js][mongodbresourcesgetmongodbdatabasesample] | Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseGet.json | -| [mongoDbResourcesGetMongoDbdatabaseThroughputSample.js][mongodbresourcesgetmongodbdatabasethroughputsample] | Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json | -| [mongoDbResourcesGetMongoRoleDefinitionSample.js][mongodbresourcesgetmongoroledefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionGet.json | -| [mongoDbResourcesGetMongoUserDefinitionSample.js][mongodbresourcesgetmongouserdefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionGet.json | -| [mongoDbResourcesListMongoDbcollectionsSample.js][mongodbresourceslistmongodbcollectionssample] | Lists the MongoDB collection under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionList.json | -| [mongoDbResourcesListMongoDbdatabasesSample.js][mongodbresourceslistmongodbdatabasessample] | Lists the MongoDB databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseList.json | -| [mongoDbResourcesListMongoRoleDefinitionsSample.js][mongodbresourceslistmongoroledefinitionssample] | Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionList.json | -| [mongoDbResourcesListMongoUserDefinitionsSample.js][mongodbresourceslistmongouserdefinitionssample] | Retrieves the list of all Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionList.json | -| [mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.js][mongodbresourcesmigratemongodbcollectiontoautoscalesample] | Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json | -| [mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.js][mongodbresourcesmigratemongodbcollectiontomanualthroughputsample] | Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json | -| [mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.js][mongodbresourcesmigratemongodbdatabasetoautoscalesample] | Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json | -| [mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.js][mongodbresourcesmigratemongodbdatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json | -| [mongoDbResourcesRetrieveContinuousBackupInformationSample.js][mongodbresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a Mongodb collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionBackupInformation.json | -| [mongoDbResourcesUpdateMongoDbcollectionThroughputSample.js][mongodbresourcesupdatemongodbcollectionthroughputsample] | Update the RUs per second of an Azure Cosmos DB MongoDB collection x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json | -| [mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.js][mongodbresourcesupdatemongodbdatabasethroughputsample] | Update RUs per second of the an Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json | -| [notebookWorkspacesCreateOrUpdateSample.js][notebookworkspacescreateorupdatesample] | Creates the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceCreate.json | -| [notebookWorkspacesDeleteSample.js][notebookworkspacesdeletesample] | Deletes the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceDelete.json | -| [notebookWorkspacesGetSample.js][notebookworkspacesgetsample] | Gets the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceGet.json | -| [notebookWorkspacesListByDatabaseAccountSample.js][notebookworkspaceslistbydatabaseaccountsample] | Gets the notebook workspace resources of an existing Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceList.json | -| [notebookWorkspacesListConnectionInfoSample.js][notebookworkspaceslistconnectioninfosample] | Retrieves the connection info for the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json | -| [notebookWorkspacesRegenerateAuthTokenSample.js][notebookworkspacesregenerateauthtokensample] | Regenerates the auth token for the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json | -| [notebookWorkspacesStartSample.js][notebookworkspacesstartsample] | Starts the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceStart.json | -| [operationsListSample.js][operationslistsample] | Lists all of the available Cosmos DB Resource Provider operations. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBOperationsList.json | -| [partitionKeyRangeIdListMetricsSample.js][partitionkeyrangeidlistmetricssample] | Retrieves the metrics determined by the given filter for the given partition key range id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdGetMetrics.json | -| [partitionKeyRangeIdRegionListMetricsSample.js][partitionkeyrangeidregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given partition key range id and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json | -| [percentileListMetricsSample.js][percentilelistmetricssample] | Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileGetMetrics.json | -| [percentileSourceTargetListMetricsSample.js][percentilesourcetargetlistmetricssample] | Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json | -| [percentileTargetListMetricsSample.js][percentiletargetlistmetricssample] | Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileTargetGetMetrics.json | -| [privateEndpointConnectionsCreateOrUpdateSample.js][privateendpointconnectionscreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json | -| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionDelete.json | -| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionGet.json | -| [privateEndpointConnectionsListByDatabaseAccountSample.js][privateendpointconnectionslistbydatabaseaccountsample] | List all private endpoint connections on a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionListGet.json | -| [privateLinkResourcesGetSample.js][privatelinkresourcesgetsample] | Gets the private link resources that need to be created for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceGet.json | -| [privateLinkResourcesListByDatabaseAccountSample.js][privatelinkresourceslistbydatabaseaccountsample] | Gets the private link resources that need to be created for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceListGet.json | -| [restorableDatabaseAccountsGetByLocationSample.js][restorabledatabaseaccountsgetbylocationsample] | Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/\*' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountGet.json | -| [restorableDatabaseAccountsListByLocationSample.js][restorabledatabaseaccountslistbylocationsample] | Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountList.json | -| [restorableDatabaseAccountsListSample.js][restorabledatabaseaccountslistsample] | Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json | -| [restorableGremlinDatabasesListSample.js][restorablegremlindatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json | -| [restorableGremlinGraphsListSample.js][restorablegremlingraphslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinGraphList.json | -| [restorableGremlinResourcesListSample.js][restorablegremlinresourceslistsample] | Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinResourceList.json | -| [restorableMongodbCollectionsListSample.js][restorablemongodbcollectionslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbCollectionList.json | -| [restorableMongodbDatabasesListSample.js][restorablemongodbdatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbDatabaseList.json | -| [restorableMongodbResourcesListSample.js][restorablemongodbresourceslistsample] | Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbResourceList.json | -| [restorableSqlContainersListSample.js][restorablesqlcontainerslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlContainerList.json | -| [restorableSqlDatabasesListSample.js][restorablesqldatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlDatabaseList.json | -| [restorableSqlResourcesListSample.js][restorablesqlresourceslistsample] | Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlResourceList.json | -| [restorableTableResourcesListSample.js][restorabletableresourceslistsample] | Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableResourceList.json | -| [restorableTablesListSample.js][restorabletableslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableList.json | -| [serviceCreateSample.js][servicecreatesample] | Creates a service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceCreate.json | -| [serviceDeleteSample.js][servicedeletesample] | Deletes service with the given serviceName. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceDelete.json | -| [serviceGetSample.js][servicegetsample] | Gets the status of service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceGet.json | -| [serviceListSample.js][servicelistsample] | Gets the status of service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBServicesList.json | -| [sqlResourcesCreateUpdateClientEncryptionKeySample.js][sqlresourcescreateupdateclientencryptionkeysample] | Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlContainerSample.js][sqlresourcescreateupdatesqlcontainersample] | Create or update an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlDatabaseSample.js][sqlresourcescreateupdatesqldatabasesample] | Create or update an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlRoleAssignmentSample.js][sqlresourcescreateupdatesqlroleassignmentsample] | Creates or updates an Azure Cosmos DB SQL Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlRoleDefinitionSample.js][sqlresourcescreateupdatesqlroledefinitionsample] | Creates or updates an Azure Cosmos DB SQL Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlStoredProcedureSample.js][sqlresourcescreateupdatesqlstoredproceduresample] | Create or update an Azure Cosmos DB SQL storedProcedure x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlTriggerSample.js][sqlresourcescreateupdatesqltriggersample] | Create or update an Azure Cosmos DB SQL trigger x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.js][sqlresourcescreateupdatesqluserdefinedfunctionsample] | Create or update an Azure Cosmos DB SQL userDefinedFunction x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json | -| [sqlResourcesDeleteSqlContainerSample.js][sqlresourcesdeletesqlcontainersample] | Deletes an existing Azure Cosmos DB SQL container. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerDelete.json | -| [sqlResourcesDeleteSqlDatabaseSample.js][sqlresourcesdeletesqldatabasesample] | Deletes an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseDelete.json | -| [sqlResourcesDeleteSqlRoleAssignmentSample.js][sqlresourcesdeletesqlroleassignmentsample] | Deletes an existing Azure Cosmos DB SQL Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentDelete.json | -| [sqlResourcesDeleteSqlRoleDefinitionSample.js][sqlresourcesdeletesqlroledefinitionsample] | Deletes an existing Azure Cosmos DB SQL Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionDelete.json | -| [sqlResourcesDeleteSqlStoredProcedureSample.js][sqlresourcesdeletesqlstoredproceduresample] | Deletes an existing Azure Cosmos DB SQL storedProcedure. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureDelete.json | -| [sqlResourcesDeleteSqlTriggerSample.js][sqlresourcesdeletesqltriggersample] | Deletes an existing Azure Cosmos DB SQL trigger. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerDelete.json | -| [sqlResourcesDeleteSqlUserDefinedFunctionSample.js][sqlresourcesdeletesqluserdefinedfunctionsample] | Deletes an existing Azure Cosmos DB SQL userDefinedFunction. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json | -| [sqlResourcesGetClientEncryptionKeySample.js][sqlresourcesgetclientencryptionkeysample] | Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyGet.json | -| [sqlResourcesGetSqlContainerSample.js][sqlresourcesgetsqlcontainersample] | Gets the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerGet.json | -| [sqlResourcesGetSqlContainerThroughputSample.js][sqlresourcesgetsqlcontainerthroughputsample] | Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputGet.json | -| [sqlResourcesGetSqlDatabaseSample.js][sqlresourcesgetsqldatabasesample] | Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseGet.json | -| [sqlResourcesGetSqlDatabaseThroughputSample.js][sqlresourcesgetsqldatabasethroughputsample] | Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputGet.json | -| [sqlResourcesGetSqlRoleAssignmentSample.js][sqlresourcesgetsqlroleassignmentsample] | Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentGet.json | -| [sqlResourcesGetSqlRoleDefinitionSample.js][sqlresourcesgetsqlroledefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionGet.json | -| [sqlResourcesGetSqlStoredProcedureSample.js][sqlresourcesgetsqlstoredproceduresample] | Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureGet.json | -| [sqlResourcesGetSqlTriggerSample.js][sqlresourcesgetsqltriggersample] | Gets the SQL trigger under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerGet.json | -| [sqlResourcesGetSqlUserDefinedFunctionSample.js][sqlresourcesgetsqluserdefinedfunctionsample] | Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionGet.json | -| [sqlResourcesListClientEncryptionKeysSample.js][sqlresourceslistclientencryptionkeyssample] | Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeysList.json | -| [sqlResourcesListSqlContainersSample.js][sqlresourceslistsqlcontainerssample] | Lists the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerList.json | -| [sqlResourcesListSqlDatabasesSample.js][sqlresourceslistsqldatabasessample] | Lists the SQL databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseList.json | -| [sqlResourcesListSqlRoleAssignmentsSample.js][sqlresourceslistsqlroleassignmentssample] | Retrieves the list of all Azure Cosmos DB SQL Role Assignments. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentList.json | -| [sqlResourcesListSqlRoleDefinitionsSample.js][sqlresourceslistsqlroledefinitionssample] | Retrieves the list of all Azure Cosmos DB SQL Role Definitions. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionList.json | -| [sqlResourcesListSqlStoredProceduresSample.js][sqlresourceslistsqlstoredproceduressample] | Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureList.json | -| [sqlResourcesListSqlTriggersSample.js][sqlresourceslistsqltriggerssample] | Lists the SQL trigger under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerList.json | -| [sqlResourcesListSqlUserDefinedFunctionsSample.js][sqlresourceslistsqluserdefinedfunctionssample] | Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionList.json | -| [sqlResourcesMigrateSqlContainerToAutoscaleSample.js][sqlresourcesmigratesqlcontainertoautoscalesample] | Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json | -| [sqlResourcesMigrateSqlContainerToManualThroughputSample.js][sqlresourcesmigratesqlcontainertomanualthroughputsample] | Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json | -| [sqlResourcesMigrateSqlDatabaseToAutoscaleSample.js][sqlresourcesmigratesqldatabasetoautoscalesample] | Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json | -| [sqlResourcesMigrateSqlDatabaseToManualThroughputSample.js][sqlresourcesmigratesqldatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json | -| [sqlResourcesRetrieveContinuousBackupInformationSample.js][sqlresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a container resource. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerBackupInformation.json | -| [sqlResourcesUpdateSqlContainerThroughputSample.js][sqlresourcesupdatesqlcontainerthroughputsample] | Update RUs per second of an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputUpdate.json | -| [sqlResourcesUpdateSqlDatabaseThroughputSample.js][sqlresourcesupdatesqldatabasethroughputsample] | Update RUs per second of an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json | -| [tableResourcesCreateUpdateTableSample.js][tableresourcescreateupdatetablesample] | Create or update an Azure Cosmos DB Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableCreateUpdate.json | -| [tableResourcesDeleteTableSample.js][tableresourcesdeletetablesample] | Deletes an existing Azure Cosmos DB Table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableDelete.json | -| [tableResourcesGetTableSample.js][tableresourcesgettablesample] | Gets the Tables under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableGet.json | -| [tableResourcesGetTableThroughputSample.js][tableresourcesgettablethroughputsample] | Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputGet.json | -| [tableResourcesListTablesSample.js][tableresourceslisttablessample] | Lists the Tables under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableList.json | -| [tableResourcesMigrateTableToAutoscaleSample.js][tableresourcesmigratetabletoautoscalesample] | Migrate an Azure Cosmos DB Table from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToAutoscale.json | -| [tableResourcesMigrateTableToManualThroughputSample.js][tableresourcesmigratetabletomanualthroughputsample] | Migrate an Azure Cosmos DB Table from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToManualThroughput.json | -| [tableResourcesRetrieveContinuousBackupInformationSample.js][tableresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableBackupInformation.json | -| [tableResourcesUpdateTableThroughputSample.js][tableresourcesupdatetablethroughputsample] | Update RUs per second of an Azure Cosmos DB Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputUpdate.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node cassandraClustersCreateUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env COSMOSDB_SUBSCRIPTION_ID="" COSMOSDB_RESOURCE_GROUP="" node cassandraClustersCreateUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[cassandraclusterscreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersCreateUpdateSample.js -[cassandraclustersdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersDeallocateSample.js -[cassandraclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersDeleteSample.js -[cassandraclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersGetSample.js -[cassandraclustersinvokecommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersInvokeCommandSample.js -[cassandraclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersListByResourceGroupSample.js -[cassandraclusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersListBySubscriptionSample.js -[cassandraclustersstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersStartSample.js -[cassandraclustersstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersStatusSample.js -[cassandraclustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraClustersUpdateSample.js -[cassandradatacenterscreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersCreateUpdateSample.js -[cassandradatacentersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersDeleteSample.js -[cassandradatacentersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersGetSample.js -[cassandradatacenterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersListSample.js -[cassandradatacentersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraDataCentersUpdateSample.js -[cassandraresourcescreateupdatecassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesCreateUpdateCassandraKeyspaceSample.js -[cassandraresourcescreateupdatecassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesCreateUpdateCassandraTableSample.js -[cassandraresourcesdeletecassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesDeleteCassandraKeyspaceSample.js -[cassandraresourcesdeletecassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesDeleteCassandraTableSample.js -[cassandraresourcesgetcassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraKeyspaceSample.js -[cassandraresourcesgetcassandrakeyspacethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraKeyspaceThroughputSample.js -[cassandraresourcesgetcassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraTableSample.js -[cassandraresourcesgetcassandratablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesGetCassandraTableThroughputSample.js -[cassandraresourceslistcassandrakeyspacessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesListCassandraKeyspacesSample.js -[cassandraresourceslistcassandratablessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesListCassandraTablesSample.js -[cassandraresourcesmigratecassandrakeyspacetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.js -[cassandraresourcesmigratecassandrakeyspacetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.js -[cassandraresourcesmigratecassandratabletoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraTableToAutoscaleSample.js -[cassandraresourcesmigratecassandratabletomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesMigrateCassandraTableToManualThroughputSample.js -[cassandraresourcesupdatecassandrakeyspacethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.js -[cassandraresourcesupdatecassandratablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/cassandraResourcesUpdateCassandraTableThroughputSample.js -[collectionlistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListMetricDefinitionsSample.js -[collectionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListMetricsSample.js -[collectionlistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionListUsagesSample.js -[collectionpartitionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionListMetricsSample.js -[collectionpartitionlistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionListUsagesSample.js -[collectionpartitionregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionPartitionRegionListMetricsSample.js -[collectionregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/collectionRegionListMetricsSample.js -[databaseaccountregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountRegionListMetricsSample.js -[databaseaccountschecknameexistssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsCheckNameExistsSample.js -[databaseaccountscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsCreateOrUpdateSample.js -[databaseaccountsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsDeleteSample.js -[databaseaccountsfailoverprioritychangesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsFailoverPriorityChangeSample.js -[databaseaccountsgetreadonlykeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsGetReadOnlyKeysSample.js -[databaseaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsGetSample.js -[databaseaccountslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListByResourceGroupSample.js -[databaseaccountslistconnectionstringssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListConnectionStringsSample.js -[databaseaccountslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListKeysSample.js -[databaseaccountslistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListMetricDefinitionsSample.js -[databaseaccountslistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListMetricsSample.js -[databaseaccountslistreadonlykeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListReadOnlyKeysSample.js -[databaseaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListSample.js -[databaseaccountslistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsListUsagesSample.js -[databaseaccountsofflineregionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsOfflineRegionSample.js -[databaseaccountsonlineregionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsOnlineRegionSample.js -[databaseaccountsregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsRegenerateKeySample.js -[databaseaccountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseAccountsUpdateSample.js -[databaselistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListMetricDefinitionsSample.js -[databaselistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListMetricsSample.js -[databaselistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/databaseListUsagesSample.js -[gremlinresourcescreateupdategremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesCreateUpdateGremlinDatabaseSample.js -[gremlinresourcescreateupdategremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesCreateUpdateGremlinGraphSample.js -[gremlinresourcesdeletegremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesDeleteGremlinDatabaseSample.js -[gremlinresourcesdeletegremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesDeleteGremlinGraphSample.js -[gremlinresourcesgetgremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinDatabaseSample.js -[gremlinresourcesgetgremlindatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinDatabaseThroughputSample.js -[gremlinresourcesgetgremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinGraphSample.js -[gremlinresourcesgetgremlingraphthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesGetGremlinGraphThroughputSample.js -[gremlinresourceslistgremlindatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesListGremlinDatabasesSample.js -[gremlinresourceslistgremlingraphssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesListGremlinGraphsSample.js -[gremlinresourcesmigrategremlindatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.js -[gremlinresourcesmigrategremlindatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.js -[gremlinresourcesmigrategremlingraphtoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.js -[gremlinresourcesmigrategremlingraphtomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.js -[gremlinresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesRetrieveContinuousBackupInformationSample.js -[gremlinresourcesupdategremlindatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesUpdateGremlinDatabaseThroughputSample.js -[gremlinresourcesupdategremlingraphthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/gremlinResourcesUpdateGremlinGraphThroughputSample.js -[locationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/locationsGetSample.js -[locationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/locationsListSample.js -[mongodbresourcescreateupdatemongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoDbcollectionSample.js -[mongodbresourcescreateupdatemongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.js -[mongodbresourcescreateupdatemongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.js -[mongodbresourcescreateupdatemongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.js -[mongodbresourcesdeletemongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoDbcollectionSample.js -[mongodbresourcesdeletemongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoDbdatabaseSample.js -[mongodbresourcesdeletemongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoRoleDefinitionSample.js -[mongodbresourcesdeletemongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesDeleteMongoUserDefinitionSample.js -[mongodbresourcesgetmongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbcollectionSample.js -[mongodbresourcesgetmongodbcollectionthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbcollectionThroughputSample.js -[mongodbresourcesgetmongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbdatabaseSample.js -[mongodbresourcesgetmongodbdatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoDbdatabaseThroughputSample.js -[mongodbresourcesgetmongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoRoleDefinitionSample.js -[mongodbresourcesgetmongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesGetMongoUserDefinitionSample.js -[mongodbresourceslistmongodbcollectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoDbcollectionsSample.js -[mongodbresourceslistmongodbdatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoDbdatabasesSample.js -[mongodbresourceslistmongoroledefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoRoleDefinitionsSample.js -[mongodbresourceslistmongouserdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesListMongoUserDefinitionsSample.js -[mongodbresourcesmigratemongodbcollectiontoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.js -[mongodbresourcesmigratemongodbcollectiontomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.js -[mongodbresourcesmigratemongodbdatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.js -[mongodbresourcesmigratemongodbdatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.js -[mongodbresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesRetrieveContinuousBackupInformationSample.js -[mongodbresourcesupdatemongodbcollectionthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.js -[mongodbresourcesupdatemongodbdatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.js -[notebookworkspacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesCreateOrUpdateSample.js -[notebookworkspacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesDeleteSample.js -[notebookworkspacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesGetSample.js -[notebookworkspaceslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesListByDatabaseAccountSample.js -[notebookworkspaceslistconnectioninfosample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesListConnectionInfoSample.js -[notebookworkspacesregenerateauthtokensample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesRegenerateAuthTokenSample.js -[notebookworkspacesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/notebookWorkspacesStartSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/operationsListSample.js -[partitionkeyrangeidlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/partitionKeyRangeIdListMetricsSample.js -[partitionkeyrangeidregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/partitionKeyRangeIdRegionListMetricsSample.js -[percentilelistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileListMetricsSample.js -[percentilesourcetargetlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileSourceTargetListMetricsSample.js -[percentiletargetlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/percentileTargetListMetricsSample.js -[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsCreateOrUpdateSample.js -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsDeleteSample.js -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsGetSample.js -[privateendpointconnectionslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateEndpointConnectionsListByDatabaseAccountSample.js -[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateLinkResourcesGetSample.js -[privatelinkresourceslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/privateLinkResourcesListByDatabaseAccountSample.js -[restorabledatabaseaccountsgetbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsGetByLocationSample.js -[restorabledatabaseaccountslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsListByLocationSample.js -[restorabledatabaseaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableDatabaseAccountsListSample.js -[restorablegremlindatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinDatabasesListSample.js -[restorablegremlingraphslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinGraphsListSample.js -[restorablegremlinresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableGremlinResourcesListSample.js -[restorablemongodbcollectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbCollectionsListSample.js -[restorablemongodbdatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbDatabasesListSample.js -[restorablemongodbresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableMongodbResourcesListSample.js -[restorablesqlcontainerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlContainersListSample.js -[restorablesqldatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlDatabasesListSample.js -[restorablesqlresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableSqlResourcesListSample.js -[restorabletableresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableTableResourcesListSample.js -[restorabletableslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/restorableTablesListSample.js -[servicecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceCreateSample.js -[servicedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceDeleteSample.js -[servicegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceGetSample.js -[servicelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/serviceListSample.js -[sqlresourcescreateupdateclientencryptionkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateClientEncryptionKeySample.js -[sqlresourcescreateupdatesqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlContainerSample.js -[sqlresourcescreateupdatesqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlDatabaseSample.js -[sqlresourcescreateupdatesqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlRoleAssignmentSample.js -[sqlresourcescreateupdatesqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlRoleDefinitionSample.js -[sqlresourcescreateupdatesqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlStoredProcedureSample.js -[sqlresourcescreateupdatesqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlTriggerSample.js -[sqlresourcescreateupdatesqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.js -[sqlresourcesdeletesqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlContainerSample.js -[sqlresourcesdeletesqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlDatabaseSample.js -[sqlresourcesdeletesqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlRoleAssignmentSample.js -[sqlresourcesdeletesqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlRoleDefinitionSample.js -[sqlresourcesdeletesqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlStoredProcedureSample.js -[sqlresourcesdeletesqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlTriggerSample.js -[sqlresourcesdeletesqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesDeleteSqlUserDefinedFunctionSample.js -[sqlresourcesgetclientencryptionkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetClientEncryptionKeySample.js -[sqlresourcesgetsqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlContainerSample.js -[sqlresourcesgetsqlcontainerthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlContainerThroughputSample.js -[sqlresourcesgetsqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlDatabaseSample.js -[sqlresourcesgetsqldatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlDatabaseThroughputSample.js -[sqlresourcesgetsqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlRoleAssignmentSample.js -[sqlresourcesgetsqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlRoleDefinitionSample.js -[sqlresourcesgetsqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlStoredProcedureSample.js -[sqlresourcesgetsqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlTriggerSample.js -[sqlresourcesgetsqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesGetSqlUserDefinedFunctionSample.js -[sqlresourceslistclientencryptionkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListClientEncryptionKeysSample.js -[sqlresourceslistsqlcontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlContainersSample.js -[sqlresourceslistsqldatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlDatabasesSample.js -[sqlresourceslistsqlroleassignmentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlRoleAssignmentsSample.js -[sqlresourceslistsqlroledefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlRoleDefinitionsSample.js -[sqlresourceslistsqlstoredproceduressample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlStoredProceduresSample.js -[sqlresourceslistsqltriggerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlTriggersSample.js -[sqlresourceslistsqluserdefinedfunctionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesListSqlUserDefinedFunctionsSample.js -[sqlresourcesmigratesqlcontainertoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlContainerToAutoscaleSample.js -[sqlresourcesmigratesqlcontainertomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlContainerToManualThroughputSample.js -[sqlresourcesmigratesqldatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.js -[sqlresourcesmigratesqldatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.js -[sqlresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesRetrieveContinuousBackupInformationSample.js -[sqlresourcesupdatesqlcontainerthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesUpdateSqlContainerThroughputSample.js -[sqlresourcesupdatesqldatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/sqlResourcesUpdateSqlDatabaseThroughputSample.js -[tableresourcescreateupdatetablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesCreateUpdateTableSample.js -[tableresourcesdeletetablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesDeleteTableSample.js -[tableresourcesgettablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesGetTableSample.js -[tableresourcesgettablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesGetTableThroughputSample.js -[tableresourceslisttablessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesListTablesSample.js -[tableresourcesmigratetabletoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesMigrateTableToAutoscaleSample.js -[tableresourcesmigratetabletomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesMigrateTableToManualThroughputSample.js -[tableresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesRetrieveContinuousBackupInformationSample.js -[tableresourcesupdatetablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/javascript/tableResourcesUpdateTableThroughputSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-cosmosdb?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/arm-cosmosdb/README.md diff --git a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/README.md b/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/README.md deleted file mode 100644 index 2bcee4557cbd..000000000000 --- a/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/README.md +++ /dev/null @@ -1,441 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [cassandraClustersCreateUpdateSample.ts][cassandraclusterscreateupdatesample] | Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterCreate.json | -| [cassandraClustersDeallocateSample.ts][cassandraclustersdeallocatesample] | Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDeallocate.json | -| [cassandraClustersDeleteSample.ts][cassandraclustersdeletesample] | Deletes a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDelete.json | -| [cassandraClustersGetSample.ts][cassandraclustersgetsample] | Get the properties of a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterGet.json | -| [cassandraClustersInvokeCommandSample.ts][cassandraclustersinvokecommandsample] | Invoke a command like nodetool for cassandra maintenance x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraCommand.json | -| [cassandraClustersListByResourceGroupSample.ts][cassandraclusterslistbyresourcegroupsample] | List all managed Cassandra clusters in this resource group. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json | -| [cassandraClustersListBySubscriptionSample.ts][cassandraclusterslistbysubscriptionsample] | List all managed Cassandra clusters in this subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json | -| [cassandraClustersStartSample.ts][cassandraclustersstartsample] | Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of this cluster with reserved data disk. This won't do anything on an already running cluster. Use Deallocate to deallocate the cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterStart.json | -| [cassandraClustersStatusSample.ts][cassandraclustersstatussample] | Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraStatus.json | -| [cassandraClustersUpdateSample.ts][cassandraclustersupdatesample] | Updates some of the properties of a managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterPatch.json | -| [cassandraDataCentersCreateUpdateSample.ts][cassandradatacenterscreateupdatesample] | Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterCreate.json | -| [cassandraDataCentersDeleteSample.ts][cassandradatacentersdeletesample] | Delete a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterDelete.json | -| [cassandraDataCentersGetSample.ts][cassandradatacentersgetsample] | Get the properties of a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterGet.json | -| [cassandraDataCentersListSample.ts][cassandradatacenterslistsample] | List all data centers in a particular managed Cassandra cluster. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterList.json | -| [cassandraDataCentersUpdateSample.ts][cassandradatacentersupdatesample] | Update some of the properties of a managed Cassandra data center. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterPatch.json | -| [cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts][cassandraresourcescreateupdatecassandrakeyspacesample] | Create or update an Azure Cosmos DB Cassandra keyspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json | -| [cassandraResourcesCreateUpdateCassandraTableSample.ts][cassandraresourcescreateupdatecassandratablesample] | Create or update an Azure Cosmos DB Cassandra Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableCreateUpdate.json | -| [cassandraResourcesDeleteCassandraKeyspaceSample.ts][cassandraresourcesdeletecassandrakeyspacesample] | Deletes an existing Azure Cosmos DB Cassandra keyspace. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceDelete.json | -| [cassandraResourcesDeleteCassandraTableSample.ts][cassandraresourcesdeletecassandratablesample] | Deletes an existing Azure Cosmos DB Cassandra table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableDelete.json | -| [cassandraResourcesGetCassandraKeyspaceSample.ts][cassandraresourcesgetcassandrakeyspacesample] | Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceGet.json | -| [cassandraResourcesGetCassandraKeyspaceThroughputSample.ts][cassandraresourcesgetcassandrakeyspacethroughputsample] | Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json | -| [cassandraResourcesGetCassandraTableSample.ts][cassandraresourcesgetcassandratablesample] | Gets the Cassandra table under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableGet.json | -| [cassandraResourcesGetCassandraTableThroughputSample.ts][cassandraresourcesgetcassandratablethroughputsample] | Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputGet.json | -| [cassandraResourcesListCassandraKeyspacesSample.ts][cassandraresourceslistcassandrakeyspacessample] | Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceList.json | -| [cassandraResourcesListCassandraTablesSample.ts][cassandraresourceslistcassandratablessample] | Lists the Cassandra table under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableList.json | -| [cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts][cassandraresourcesmigratecassandrakeyspacetoautoscalesample] | Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json | -| [cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts][cassandraresourcesmigratecassandrakeyspacetomanualthroughputsample] | Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json | -| [cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts][cassandraresourcesmigratecassandratabletoautoscalesample] | Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json | -| [cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts][cassandraresourcesmigratecassandratabletomanualthroughputsample] | Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json | -| [cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts][cassandraresourcesupdatecassandrakeyspacethroughputsample] | Update RUs per second of an Azure Cosmos DB Cassandra Keyspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json | -| [cassandraResourcesUpdateCassandraTableThroughputSample.ts][cassandraresourcesupdatecassandratablethroughputsample] | Update RUs per second of an Azure Cosmos DB Cassandra table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputUpdate.json | -| [collectionListMetricDefinitionsSample.ts][collectionlistmetricdefinitionssample] | Retrieves metric definitions for the given collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetricDefinitions.json | -| [collectionListMetricsSample.ts][collectionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetrics.json | -| [collectionListUsagesSample.ts][collectionlistusagessample] | Retrieves the usages (most recent storage data) for the given collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetUsages.json | -| [collectionPartitionListMetricsSample.ts][collectionpartitionlistmetricssample] | Retrieves the metrics determined by the given filter for the given collection, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetMetrics.json | -| [collectionPartitionListUsagesSample.ts][collectionpartitionlistusagessample] | Retrieves the usages (most recent storage data) for the given collection, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetUsages.json | -| [collectionPartitionRegionListMetricsSample.ts][collectionpartitionregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given collection and region, split by partition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json | -| [collectionRegionListMetricsSample.ts][collectionregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account, collection and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRegionCollectionGetMetrics.json | -| [databaseAccountRegionListMetricsSample.ts][databaseaccountregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json | -| [databaseAccountsCheckNameExistsSample.ts][databaseaccountschecknameexistssample] | Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCheckNameExists.json | -| [databaseAccountsCreateOrUpdateSample.ts][databaseaccountscreateorupdatesample] | Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMax.json | -| [databaseAccountsDeleteSample.ts][databaseaccountsdeletesample] | Deletes an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountDelete.json | -| [databaseAccountsFailoverPriorityChangeSample.ts][databaseaccountsfailoverprioritychangesample] | Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json | -| [databaseAccountsGetReadOnlyKeysSample.ts][databaseaccountsgetreadonlykeyssample] | Lists the read-only access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json | -| [databaseAccountsGetSample.ts][databaseaccountsgetsample] | Retrieves the properties of an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGet.json | -| [databaseAccountsListByResourceGroupSample.ts][databaseaccountslistbyresourcegroupsample] | Lists all the Azure Cosmos DB database accounts available under the given resource group. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json | -| [databaseAccountsListConnectionStringsSample.ts][databaseaccountslistconnectionstringssample] | Lists the connection strings for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json | -| [databaseAccountsListKeysSample.ts][databaseaccountslistkeyssample] | Lists the access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListKeys.json | -| [databaseAccountsListMetricDefinitionsSample.ts][databaseaccountslistmetricdefinitionssample] | Retrieves metric definitions for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json | -| [databaseAccountsListMetricsSample.ts][databaseaccountslistmetricssample] | Retrieves the metrics determined by the given filter for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetrics.json | -| [databaseAccountsListReadOnlyKeysSample.ts][databaseaccountslistreadonlykeyssample] | Lists the read-only access keys for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json | -| [databaseAccountsListSample.ts][databaseaccountslistsample] | Lists all the Azure Cosmos DB database accounts available under the subscription. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountList.json | -| [databaseAccountsListUsagesSample.ts][databaseaccountslistusagessample] | Retrieves the usages (most recent data) for the given database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetUsages.json | -| [databaseAccountsOfflineRegionSample.ts][databaseaccountsofflineregionsample] | Offline the specified region for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOfflineRegion.json | -| [databaseAccountsOnlineRegionSample.ts][databaseaccountsonlineregionsample] | Online the specified region for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOnlineRegion.json | -| [databaseAccountsRegenerateKeySample.ts][databaseaccountsregeneratekeysample] | Regenerates an access key for the specified Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegenerateKey.json | -| [databaseAccountsUpdateSample.ts][databaseaccountsupdatesample] | Updates the properties of an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountPatch.json | -| [databaseListMetricDefinitionsSample.ts][databaselistmetricdefinitionssample] | Retrieves metric definitions for the given database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetricDefinitions.json | -| [databaseListMetricsSample.ts][databaselistmetricssample] | Retrieves the metrics determined by the given filter for the given database account and database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetrics.json | -| [databaseListUsagesSample.ts][databaselistusagessample] | Retrieves the usages (most recent data) for the given database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetUsages.json | -| [gremlinResourcesCreateUpdateGremlinDatabaseSample.ts][gremlinresourcescreateupdategremlindatabasesample] | Create or update an Azure Cosmos DB Gremlin database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json | -| [gremlinResourcesCreateUpdateGremlinGraphSample.ts][gremlinresourcescreateupdategremlingraphsample] | Create or update an Azure Cosmos DB Gremlin graph x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphCreateUpdate.json | -| [gremlinResourcesDeleteGremlinDatabaseSample.ts][gremlinresourcesdeletegremlindatabasesample] | Deletes an existing Azure Cosmos DB Gremlin database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseDelete.json | -| [gremlinResourcesDeleteGremlinGraphSample.ts][gremlinresourcesdeletegremlingraphsample] | Deletes an existing Azure Cosmos DB Gremlin graph. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphDelete.json | -| [gremlinResourcesGetGremlinDatabaseSample.ts][gremlinresourcesgetgremlindatabasesample] | Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseGet.json | -| [gremlinResourcesGetGremlinDatabaseThroughputSample.ts][gremlinresourcesgetgremlindatabasethroughputsample] | Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputGet.json | -| [gremlinResourcesGetGremlinGraphSample.ts][gremlinresourcesgetgremlingraphsample] | Gets the Gremlin graph under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphGet.json | -| [gremlinResourcesGetGremlinGraphThroughputSample.ts][gremlinresourcesgetgremlingraphthroughputsample] | Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputGet.json | -| [gremlinResourcesListGremlinDatabasesSample.ts][gremlinresourceslistgremlindatabasessample] | Lists the Gremlin databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseList.json | -| [gremlinResourcesListGremlinGraphsSample.ts][gremlinresourceslistgremlingraphssample] | Lists the Gremlin graph under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphList.json | -| [gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts][gremlinresourcesmigrategremlindatabasetoautoscalesample] | Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json | -| [gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts][gremlinresourcesmigrategremlindatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json | -| [gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts][gremlinresourcesmigrategremlingraphtoautoscalesample] | Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json | -| [gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts][gremlinresourcesmigrategremlingraphtomanualthroughputsample] | Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json | -| [gremlinResourcesRetrieveContinuousBackupInformationSample.ts][gremlinresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a gremlin graph. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphBackupInformation.json | -| [gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts][gremlinresourcesupdategremlindatabasethroughputsample] | Update RUs per second of an Azure Cosmos DB Gremlin database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json | -| [gremlinResourcesUpdateGremlinGraphThroughputSample.ts][gremlinresourcesupdategremlingraphthroughputsample] | Update RUs per second of an Azure Cosmos DB Gremlin graph x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputUpdate.json | -| [locationsGetSample.ts][locationsgetsample] | Get the properties of an existing Cosmos DB location x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationGet.json | -| [locationsListSample.ts][locationslistsample] | List Cosmos DB locations and their properties x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationList.json | -| [mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts][mongodbresourcescreateupdatemongodbcollectionsample] | Create or update an Azure Cosmos DB MongoDB Collection x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json | -| [mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts][mongodbresourcescreateupdatemongodbdatabasesample] | Create or updates Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json | -| [mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts][mongodbresourcescreateupdatemongoroledefinitionsample] | Creates or updates an Azure Cosmos DB Mongo Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json | -| [mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts][mongodbresourcescreateupdatemongouserdefinitionsample] | Creates or updates an Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json | -| [mongoDbResourcesDeleteMongoDbcollectionSample.ts][mongodbresourcesdeletemongodbcollectionsample] | Deletes an existing Azure Cosmos DB MongoDB Collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionDelete.json | -| [mongoDbResourcesDeleteMongoDbdatabaseSample.ts][mongodbresourcesdeletemongodbdatabasesample] | Deletes an existing Azure Cosmos DB MongoDB database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseDelete.json | -| [mongoDbResourcesDeleteMongoRoleDefinitionSample.ts][mongodbresourcesdeletemongoroledefinitionsample] | Deletes an existing Azure Cosmos DB Mongo Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionDelete.json | -| [mongoDbResourcesDeleteMongoUserDefinitionSample.ts][mongodbresourcesdeletemongouserdefinitionsample] | Deletes an existing Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionDelete.json | -| [mongoDbResourcesGetMongoDbcollectionSample.ts][mongodbresourcesgetmongodbcollectionsample] | Gets the MongoDB collection under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionGet.json | -| [mongoDbResourcesGetMongoDbcollectionThroughputSample.ts][mongodbresourcesgetmongodbcollectionthroughputsample] | Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputGet.json | -| [mongoDbResourcesGetMongoDbdatabaseSample.ts][mongodbresourcesgetmongodbdatabasesample] | Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseGet.json | -| [mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts][mongodbresourcesgetmongodbdatabasethroughputsample] | Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json | -| [mongoDbResourcesGetMongoRoleDefinitionSample.ts][mongodbresourcesgetmongoroledefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionGet.json | -| [mongoDbResourcesGetMongoUserDefinitionSample.ts][mongodbresourcesgetmongouserdefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionGet.json | -| [mongoDbResourcesListMongoDbcollectionsSample.ts][mongodbresourceslistmongodbcollectionssample] | Lists the MongoDB collection under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionList.json | -| [mongoDbResourcesListMongoDbdatabasesSample.ts][mongodbresourceslistmongodbdatabasessample] | Lists the MongoDB databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseList.json | -| [mongoDbResourcesListMongoRoleDefinitionsSample.ts][mongodbresourceslistmongoroledefinitionssample] | Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionList.json | -| [mongoDbResourcesListMongoUserDefinitionsSample.ts][mongodbresourceslistmongouserdefinitionssample] | Retrieves the list of all Azure Cosmos DB Mongo User Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionList.json | -| [mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts][mongodbresourcesmigratemongodbcollectiontoautoscalesample] | Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json | -| [mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts][mongodbresourcesmigratemongodbcollectiontomanualthroughputsample] | Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json | -| [mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts][mongodbresourcesmigratemongodbdatabasetoautoscalesample] | Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json | -| [mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts][mongodbresourcesmigratemongodbdatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json | -| [mongoDbResourcesRetrieveContinuousBackupInformationSample.ts][mongodbresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a Mongodb collection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionBackupInformation.json | -| [mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts][mongodbresourcesupdatemongodbcollectionthroughputsample] | Update the RUs per second of an Azure Cosmos DB MongoDB collection x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json | -| [mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts][mongodbresourcesupdatemongodbdatabasethroughputsample] | Update RUs per second of the an Azure Cosmos DB MongoDB database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json | -| [notebookWorkspacesCreateOrUpdateSample.ts][notebookworkspacescreateorupdatesample] | Creates the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceCreate.json | -| [notebookWorkspacesDeleteSample.ts][notebookworkspacesdeletesample] | Deletes the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceDelete.json | -| [notebookWorkspacesGetSample.ts][notebookworkspacesgetsample] | Gets the notebook workspace for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceGet.json | -| [notebookWorkspacesListByDatabaseAccountSample.ts][notebookworkspaceslistbydatabaseaccountsample] | Gets the notebook workspace resources of an existing Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceList.json | -| [notebookWorkspacesListConnectionInfoSample.ts][notebookworkspaceslistconnectioninfosample] | Retrieves the connection info for the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json | -| [notebookWorkspacesRegenerateAuthTokenSample.ts][notebookworkspacesregenerateauthtokensample] | Regenerates the auth token for the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json | -| [notebookWorkspacesStartSample.ts][notebookworkspacesstartsample] | Starts the notebook workspace x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceStart.json | -| [operationsListSample.ts][operationslistsample] | Lists all of the available Cosmos DB Resource Provider operations. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBOperationsList.json | -| [partitionKeyRangeIdListMetricsSample.ts][partitionkeyrangeidlistmetricssample] | Retrieves the metrics determined by the given filter for the given partition key range id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdGetMetrics.json | -| [partitionKeyRangeIdRegionListMetricsSample.ts][partitionkeyrangeidregionlistmetricssample] | Retrieves the metrics determined by the given filter for the given partition key range id and region. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json | -| [percentileListMetricsSample.ts][percentilelistmetricssample] | Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileGetMetrics.json | -| [percentileSourceTargetListMetricsSample.ts][percentilesourcetargetlistmetricssample] | Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json | -| [percentileTargetListMetricsSample.ts][percentiletargetlistmetricssample] | Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileTargetGetMetrics.json | -| [privateEndpointConnectionsCreateOrUpdateSample.ts][privateendpointconnectionscreateorupdatesample] | Approve or reject a private endpoint connection with a given name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json | -| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection with a given name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionDelete.json | -| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets a private endpoint connection. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionGet.json | -| [privateEndpointConnectionsListByDatabaseAccountSample.ts][privateendpointconnectionslistbydatabaseaccountsample] | List all private endpoint connections on a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionListGet.json | -| [privateLinkResourcesGetSample.ts][privatelinkresourcesgetsample] | Gets the private link resources that need to be created for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceGet.json | -| [privateLinkResourcesListByDatabaseAccountSample.ts][privatelinkresourceslistbydatabaseaccountsample] | Gets the private link resources that need to be created for a Cosmos DB account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceListGet.json | -| [restorableDatabaseAccountsGetByLocationSample.ts][restorabledatabaseaccountsgetbylocationsample] | Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/\*' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountGet.json | -| [restorableDatabaseAccountsListByLocationSample.ts][restorabledatabaseaccountslistbylocationsample] | Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountList.json | -| [restorableDatabaseAccountsListSample.ts][restorabledatabaseaccountslistsample] | Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json | -| [restorableGremlinDatabasesListSample.ts][restorablegremlindatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json | -| [restorableGremlinGraphsListSample.ts][restorablegremlingraphslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinGraphList.json | -| [restorableGremlinResourcesListSample.ts][restorablegremlinresourceslistsample] | Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinResourceList.json | -| [restorableMongodbCollectionsListSample.ts][restorablemongodbcollectionslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB collections under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbCollectionList.json | -| [restorableMongodbDatabasesListSample.ts][restorablemongodbdatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB MongoDB databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbDatabaseList.json | -| [restorableMongodbResourcesListSample.ts][restorablemongodbresourceslistsample] | Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbResourceList.json | -| [restorableSqlContainersListSample.ts][restorablesqlcontainerslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB SQL containers under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlContainerList.json | -| [restorableSqlDatabasesListSample.ts][restorablesqldatabaseslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB SQL databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlDatabaseList.json | -| [restorableSqlResourcesListSample.ts][restorablesqlresourceslistsample] | Return a list of database and container combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlResourceList.json | -| [restorableTableResourcesListSample.ts][restorabletableresourceslistsample] | Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableResourceList.json | -| [restorableTablesListSample.ts][restorabletableslistsample] | Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableList.json | -| [serviceCreateSample.ts][servicecreatesample] | Creates a service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceCreate.json | -| [serviceDeleteSample.ts][servicedeletesample] | Deletes service with the given serviceName. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceDelete.json | -| [serviceGetSample.ts][servicegetsample] | Gets the status of service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceGet.json | -| [serviceListSample.ts][servicelistsample] | Gets the status of service. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBServicesList.json | -| [sqlResourcesCreateUpdateClientEncryptionKeySample.ts][sqlresourcescreateupdateclientencryptionkeysample] | Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlContainerSample.ts][sqlresourcescreateupdatesqlcontainersample] | Create or update an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlDatabaseSample.ts][sqlresourcescreateupdatesqldatabasesample] | Create or update an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts][sqlresourcescreateupdatesqlroleassignmentsample] | Creates or updates an Azure Cosmos DB SQL Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts][sqlresourcescreateupdatesqlroledefinitionsample] | Creates or updates an Azure Cosmos DB SQL Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlStoredProcedureSample.ts][sqlresourcescreateupdatesqlstoredproceduresample] | Create or update an Azure Cosmos DB SQL storedProcedure x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlTriggerSample.ts][sqlresourcescreateupdatesqltriggersample] | Create or update an Azure Cosmos DB SQL trigger x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerCreateUpdate.json | -| [sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts][sqlresourcescreateupdatesqluserdefinedfunctionsample] | Create or update an Azure Cosmos DB SQL userDefinedFunction x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json | -| [sqlResourcesDeleteSqlContainerSample.ts][sqlresourcesdeletesqlcontainersample] | Deletes an existing Azure Cosmos DB SQL container. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerDelete.json | -| [sqlResourcesDeleteSqlDatabaseSample.ts][sqlresourcesdeletesqldatabasesample] | Deletes an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseDelete.json | -| [sqlResourcesDeleteSqlRoleAssignmentSample.ts][sqlresourcesdeletesqlroleassignmentsample] | Deletes an existing Azure Cosmos DB SQL Role Assignment. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentDelete.json | -| [sqlResourcesDeleteSqlRoleDefinitionSample.ts][sqlresourcesdeletesqlroledefinitionsample] | Deletes an existing Azure Cosmos DB SQL Role Definition. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionDelete.json | -| [sqlResourcesDeleteSqlStoredProcedureSample.ts][sqlresourcesdeletesqlstoredproceduresample] | Deletes an existing Azure Cosmos DB SQL storedProcedure. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureDelete.json | -| [sqlResourcesDeleteSqlTriggerSample.ts][sqlresourcesdeletesqltriggersample] | Deletes an existing Azure Cosmos DB SQL trigger. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerDelete.json | -| [sqlResourcesDeleteSqlUserDefinedFunctionSample.ts][sqlresourcesdeletesqluserdefinedfunctionsample] | Deletes an existing Azure Cosmos DB SQL userDefinedFunction. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json | -| [sqlResourcesGetClientEncryptionKeySample.ts][sqlresourcesgetclientencryptionkeysample] | Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyGet.json | -| [sqlResourcesGetSqlContainerSample.ts][sqlresourcesgetsqlcontainersample] | Gets the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerGet.json | -| [sqlResourcesGetSqlContainerThroughputSample.ts][sqlresourcesgetsqlcontainerthroughputsample] | Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputGet.json | -| [sqlResourcesGetSqlDatabaseSample.ts][sqlresourcesgetsqldatabasesample] | Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseGet.json | -| [sqlResourcesGetSqlDatabaseThroughputSample.ts][sqlresourcesgetsqldatabasethroughputsample] | Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputGet.json | -| [sqlResourcesGetSqlRoleAssignmentSample.ts][sqlresourcesgetsqlroleassignmentsample] | Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentGet.json | -| [sqlResourcesGetSqlRoleDefinitionSample.ts][sqlresourcesgetsqlroledefinitionsample] | Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionGet.json | -| [sqlResourcesGetSqlStoredProcedureSample.ts][sqlresourcesgetsqlstoredproceduresample] | Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureGet.json | -| [sqlResourcesGetSqlTriggerSample.ts][sqlresourcesgetsqltriggersample] | Gets the SQL trigger under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerGet.json | -| [sqlResourcesGetSqlUserDefinedFunctionSample.ts][sqlresourcesgetsqluserdefinedfunctionsample] | Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionGet.json | -| [sqlResourcesListClientEncryptionKeysSample.ts][sqlresourceslistclientencryptionkeyssample] | Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeysList.json | -| [sqlResourcesListSqlContainersSample.ts][sqlresourceslistsqlcontainerssample] | Lists the SQL container under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerList.json | -| [sqlResourcesListSqlDatabasesSample.ts][sqlresourceslistsqldatabasessample] | Lists the SQL databases under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseList.json | -| [sqlResourcesListSqlRoleAssignmentsSample.ts][sqlresourceslistsqlroleassignmentssample] | Retrieves the list of all Azure Cosmos DB SQL Role Assignments. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentList.json | -| [sqlResourcesListSqlRoleDefinitionsSample.ts][sqlresourceslistsqlroledefinitionssample] | Retrieves the list of all Azure Cosmos DB SQL Role Definitions. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionList.json | -| [sqlResourcesListSqlStoredProceduresSample.ts][sqlresourceslistsqlstoredproceduressample] | Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureList.json | -| [sqlResourcesListSqlTriggersSample.ts][sqlresourceslistsqltriggerssample] | Lists the SQL trigger under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerList.json | -| [sqlResourcesListSqlUserDefinedFunctionsSample.ts][sqlresourceslistsqluserdefinedfunctionssample] | Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionList.json | -| [sqlResourcesMigrateSqlContainerToAutoscaleSample.ts][sqlresourcesmigratesqlcontainertoautoscalesample] | Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json | -| [sqlResourcesMigrateSqlContainerToManualThroughputSample.ts][sqlresourcesmigratesqlcontainertomanualthroughputsample] | Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json | -| [sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts][sqlresourcesmigratesqldatabasetoautoscalesample] | Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json | -| [sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts][sqlresourcesmigratesqldatabasetomanualthroughputsample] | Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json | -| [sqlResourcesRetrieveContinuousBackupInformationSample.ts][sqlresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a container resource. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerBackupInformation.json | -| [sqlResourcesUpdateSqlContainerThroughputSample.ts][sqlresourcesupdatesqlcontainerthroughputsample] | Update RUs per second of an Azure Cosmos DB SQL container x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputUpdate.json | -| [sqlResourcesUpdateSqlDatabaseThroughputSample.ts][sqlresourcesupdatesqldatabasethroughputsample] | Update RUs per second of an Azure Cosmos DB SQL database x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json | -| [tableResourcesCreateUpdateTableSample.ts][tableresourcescreateupdatetablesample] | Create or update an Azure Cosmos DB Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableCreateUpdate.json | -| [tableResourcesDeleteTableSample.ts][tableresourcesdeletetablesample] | Deletes an existing Azure Cosmos DB Table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableDelete.json | -| [tableResourcesGetTableSample.ts][tableresourcesgettablesample] | Gets the Tables under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableGet.json | -| [tableResourcesGetTableThroughputSample.ts][tableresourcesgettablethroughputsample] | Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputGet.json | -| [tableResourcesListTablesSample.ts][tableresourceslisttablessample] | Lists the Tables under an existing Azure Cosmos DB database account. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableList.json | -| [tableResourcesMigrateTableToAutoscaleSample.ts][tableresourcesmigratetabletoautoscalesample] | Migrate an Azure Cosmos DB Table from manual throughput to autoscale x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToAutoscale.json | -| [tableResourcesMigrateTableToManualThroughputSample.ts][tableresourcesmigratetabletomanualthroughputsample] | Migrate an Azure Cosmos DB Table from autoscale to manual throughput x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToManualThroughput.json | -| [tableResourcesRetrieveContinuousBackupInformationSample.ts][tableresourcesretrievecontinuousbackupinformationsample] | Retrieves continuous backup information for a table. x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableBackupInformation.json | -| [tableResourcesUpdateTableThroughputSample.ts][tableresourcesupdatetablethroughputsample] | Update RUs per second of an Azure Cosmos DB Table x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputUpdate.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/cassandraClustersCreateUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx dev-tool run vendored cross-env COSMOSDB_SUBSCRIPTION_ID="" COSMOSDB_RESOURCE_GROUP="" node dist/cassandraClustersCreateUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[cassandraclusterscreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersCreateUpdateSample.ts -[cassandraclustersdeallocatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersDeallocateSample.ts -[cassandraclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersDeleteSample.ts -[cassandraclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersGetSample.ts -[cassandraclustersinvokecommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersInvokeCommandSample.ts -[cassandraclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersListByResourceGroupSample.ts -[cassandraclusterslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersListBySubscriptionSample.ts -[cassandraclustersstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersStartSample.ts -[cassandraclustersstatussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersStatusSample.ts -[cassandraclustersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraClustersUpdateSample.ts -[cassandradatacenterscreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersCreateUpdateSample.ts -[cassandradatacentersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersDeleteSample.ts -[cassandradatacentersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersGetSample.ts -[cassandradatacenterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersListSample.ts -[cassandradatacentersupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraDataCentersUpdateSample.ts -[cassandraresourcescreateupdatecassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesCreateUpdateCassandraKeyspaceSample.ts -[cassandraresourcescreateupdatecassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesCreateUpdateCassandraTableSample.ts -[cassandraresourcesdeletecassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesDeleteCassandraKeyspaceSample.ts -[cassandraresourcesdeletecassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesDeleteCassandraTableSample.ts -[cassandraresourcesgetcassandrakeyspacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraKeyspaceSample.ts -[cassandraresourcesgetcassandrakeyspacethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraKeyspaceThroughputSample.ts -[cassandraresourcesgetcassandratablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraTableSample.ts -[cassandraresourcesgetcassandratablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesGetCassandraTableThroughputSample.ts -[cassandraresourceslistcassandrakeyspacessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesListCassandraKeyspacesSample.ts -[cassandraresourceslistcassandratablessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesListCassandraTablesSample.ts -[cassandraresourcesmigratecassandrakeyspacetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToAutoscaleSample.ts -[cassandraresourcesmigratecassandrakeyspacetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraKeyspaceToManualThroughputSample.ts -[cassandraresourcesmigratecassandratabletoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraTableToAutoscaleSample.ts -[cassandraresourcesmigratecassandratabletomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesMigrateCassandraTableToManualThroughputSample.ts -[cassandraresourcesupdatecassandrakeyspacethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesUpdateCassandraKeyspaceThroughputSample.ts -[cassandraresourcesupdatecassandratablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/cassandraResourcesUpdateCassandraTableThroughputSample.ts -[collectionlistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListMetricDefinitionsSample.ts -[collectionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListMetricsSample.ts -[collectionlistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionListUsagesSample.ts -[collectionpartitionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionListMetricsSample.ts -[collectionpartitionlistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionListUsagesSample.ts -[collectionpartitionregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionPartitionRegionListMetricsSample.ts -[collectionregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/collectionRegionListMetricsSample.ts -[databaseaccountregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountRegionListMetricsSample.ts -[databaseaccountschecknameexistssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsCheckNameExistsSample.ts -[databaseaccountscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsCreateOrUpdateSample.ts -[databaseaccountsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsDeleteSample.ts -[databaseaccountsfailoverprioritychangesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsFailoverPriorityChangeSample.ts -[databaseaccountsgetreadonlykeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsGetReadOnlyKeysSample.ts -[databaseaccountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsGetSample.ts -[databaseaccountslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListByResourceGroupSample.ts -[databaseaccountslistconnectionstringssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListConnectionStringsSample.ts -[databaseaccountslistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListKeysSample.ts -[databaseaccountslistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListMetricDefinitionsSample.ts -[databaseaccountslistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListMetricsSample.ts -[databaseaccountslistreadonlykeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListReadOnlyKeysSample.ts -[databaseaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListSample.ts -[databaseaccountslistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsListUsagesSample.ts -[databaseaccountsofflineregionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsOfflineRegionSample.ts -[databaseaccountsonlineregionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsOnlineRegionSample.ts -[databaseaccountsregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsRegenerateKeySample.ts -[databaseaccountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseAccountsUpdateSample.ts -[databaselistmetricdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListMetricDefinitionsSample.ts -[databaselistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListMetricsSample.ts -[databaselistusagessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/databaseListUsagesSample.ts -[gremlinresourcescreateupdategremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesCreateUpdateGremlinDatabaseSample.ts -[gremlinresourcescreateupdategremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesCreateUpdateGremlinGraphSample.ts -[gremlinresourcesdeletegremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesDeleteGremlinDatabaseSample.ts -[gremlinresourcesdeletegremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesDeleteGremlinGraphSample.ts -[gremlinresourcesgetgremlindatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinDatabaseSample.ts -[gremlinresourcesgetgremlindatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinDatabaseThroughputSample.ts -[gremlinresourcesgetgremlingraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinGraphSample.ts -[gremlinresourcesgetgremlingraphthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesGetGremlinGraphThroughputSample.ts -[gremlinresourceslistgremlindatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesListGremlinDatabasesSample.ts -[gremlinresourceslistgremlingraphssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesListGremlinGraphsSample.ts -[gremlinresourcesmigrategremlindatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinDatabaseToAutoscaleSample.ts -[gremlinresourcesmigrategremlindatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinDatabaseToManualThroughputSample.ts -[gremlinresourcesmigrategremlingraphtoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinGraphToAutoscaleSample.ts -[gremlinresourcesmigrategremlingraphtomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesMigrateGremlinGraphToManualThroughputSample.ts -[gremlinresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesRetrieveContinuousBackupInformationSample.ts -[gremlinresourcesupdategremlindatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesUpdateGremlinDatabaseThroughputSample.ts -[gremlinresourcesupdategremlingraphthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/gremlinResourcesUpdateGremlinGraphThroughputSample.ts -[locationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/locationsGetSample.ts -[locationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/locationsListSample.ts -[mongodbresourcescreateupdatemongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoDbcollectionSample.ts -[mongodbresourcescreateupdatemongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoDbdatabaseSample.ts -[mongodbresourcescreateupdatemongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoRoleDefinitionSample.ts -[mongodbresourcescreateupdatemongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesCreateUpdateMongoUserDefinitionSample.ts -[mongodbresourcesdeletemongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoDbcollectionSample.ts -[mongodbresourcesdeletemongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoDbdatabaseSample.ts -[mongodbresourcesdeletemongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoRoleDefinitionSample.ts -[mongodbresourcesdeletemongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesDeleteMongoUserDefinitionSample.ts -[mongodbresourcesgetmongodbcollectionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbcollectionSample.ts -[mongodbresourcesgetmongodbcollectionthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbcollectionThroughputSample.ts -[mongodbresourcesgetmongodbdatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbdatabaseSample.ts -[mongodbresourcesgetmongodbdatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoDbdatabaseThroughputSample.ts -[mongodbresourcesgetmongoroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoRoleDefinitionSample.ts -[mongodbresourcesgetmongouserdefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesGetMongoUserDefinitionSample.ts -[mongodbresourceslistmongodbcollectionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoDbcollectionsSample.ts -[mongodbresourceslistmongodbdatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoDbdatabasesSample.ts -[mongodbresourceslistmongoroledefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoRoleDefinitionsSample.ts -[mongodbresourceslistmongouserdefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesListMongoUserDefinitionsSample.ts -[mongodbresourcesmigratemongodbcollectiontoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToAutoscaleSample.ts -[mongodbresourcesmigratemongodbcollectiontomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbcollectionToManualThroughputSample.ts -[mongodbresourcesmigratemongodbdatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToAutoscaleSample.ts -[mongodbresourcesmigratemongodbdatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesMigrateMongoDbdatabaseToManualThroughputSample.ts -[mongodbresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesRetrieveContinuousBackupInformationSample.ts -[mongodbresourcesupdatemongodbcollectionthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesUpdateMongoDbcollectionThroughputSample.ts -[mongodbresourcesupdatemongodbdatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/mongoDbResourcesUpdateMongoDbdatabaseThroughputSample.ts -[notebookworkspacescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesCreateOrUpdateSample.ts -[notebookworkspacesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesDeleteSample.ts -[notebookworkspacesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesGetSample.ts -[notebookworkspaceslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesListByDatabaseAccountSample.ts -[notebookworkspaceslistconnectioninfosample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesListConnectionInfoSample.ts -[notebookworkspacesregenerateauthtokensample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesRegenerateAuthTokenSample.ts -[notebookworkspacesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/notebookWorkspacesStartSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/operationsListSample.ts -[partitionkeyrangeidlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/partitionKeyRangeIdListMetricsSample.ts -[partitionkeyrangeidregionlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/partitionKeyRangeIdRegionListMetricsSample.ts -[percentilelistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileListMetricsSample.ts -[percentilesourcetargetlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileSourceTargetListMetricsSample.ts -[percentiletargetlistmetricssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/percentileTargetListMetricsSample.ts -[privateendpointconnectionscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsDeleteSample.ts -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsGetSample.ts -[privateendpointconnectionslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateEndpointConnectionsListByDatabaseAccountSample.ts -[privatelinkresourcesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateLinkResourcesGetSample.ts -[privatelinkresourceslistbydatabaseaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/privateLinkResourcesListByDatabaseAccountSample.ts -[restorabledatabaseaccountsgetbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsGetByLocationSample.ts -[restorabledatabaseaccountslistbylocationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsListByLocationSample.ts -[restorabledatabaseaccountslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableDatabaseAccountsListSample.ts -[restorablegremlindatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinDatabasesListSample.ts -[restorablegremlingraphslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinGraphsListSample.ts -[restorablegremlinresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableGremlinResourcesListSample.ts -[restorablemongodbcollectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbCollectionsListSample.ts -[restorablemongodbdatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbDatabasesListSample.ts -[restorablemongodbresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableMongodbResourcesListSample.ts -[restorablesqlcontainerslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlContainersListSample.ts -[restorablesqldatabaseslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlDatabasesListSample.ts -[restorablesqlresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableSqlResourcesListSample.ts -[restorabletableresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableTableResourcesListSample.ts -[restorabletableslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/restorableTablesListSample.ts -[servicecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceCreateSample.ts -[servicedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceDeleteSample.ts -[servicegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceGetSample.ts -[servicelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/serviceListSample.ts -[sqlresourcescreateupdateclientencryptionkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateClientEncryptionKeySample.ts -[sqlresourcescreateupdatesqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlContainerSample.ts -[sqlresourcescreateupdatesqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlDatabaseSample.ts -[sqlresourcescreateupdatesqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlRoleAssignmentSample.ts -[sqlresourcescreateupdatesqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlRoleDefinitionSample.ts -[sqlresourcescreateupdatesqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlStoredProcedureSample.ts -[sqlresourcescreateupdatesqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlTriggerSample.ts -[sqlresourcescreateupdatesqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesCreateUpdateSqlUserDefinedFunctionSample.ts -[sqlresourcesdeletesqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlContainerSample.ts -[sqlresourcesdeletesqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlDatabaseSample.ts -[sqlresourcesdeletesqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlRoleAssignmentSample.ts -[sqlresourcesdeletesqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlRoleDefinitionSample.ts -[sqlresourcesdeletesqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlStoredProcedureSample.ts -[sqlresourcesdeletesqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlTriggerSample.ts -[sqlresourcesdeletesqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesDeleteSqlUserDefinedFunctionSample.ts -[sqlresourcesgetclientencryptionkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetClientEncryptionKeySample.ts -[sqlresourcesgetsqlcontainersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlContainerSample.ts -[sqlresourcesgetsqlcontainerthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlContainerThroughputSample.ts -[sqlresourcesgetsqldatabasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlDatabaseSample.ts -[sqlresourcesgetsqldatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlDatabaseThroughputSample.ts -[sqlresourcesgetsqlroleassignmentsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlRoleAssignmentSample.ts -[sqlresourcesgetsqlroledefinitionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlRoleDefinitionSample.ts -[sqlresourcesgetsqlstoredproceduresample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlStoredProcedureSample.ts -[sqlresourcesgetsqltriggersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlTriggerSample.ts -[sqlresourcesgetsqluserdefinedfunctionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesGetSqlUserDefinedFunctionSample.ts -[sqlresourceslistclientencryptionkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListClientEncryptionKeysSample.ts -[sqlresourceslistsqlcontainerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlContainersSample.ts -[sqlresourceslistsqldatabasessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlDatabasesSample.ts -[sqlresourceslistsqlroleassignmentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlRoleAssignmentsSample.ts -[sqlresourceslistsqlroledefinitionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlRoleDefinitionsSample.ts -[sqlresourceslistsqlstoredproceduressample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlStoredProceduresSample.ts -[sqlresourceslistsqltriggerssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlTriggersSample.ts -[sqlresourceslistsqluserdefinedfunctionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesListSqlUserDefinedFunctionsSample.ts -[sqlresourcesmigratesqlcontainertoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlContainerToAutoscaleSample.ts -[sqlresourcesmigratesqlcontainertomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlContainerToManualThroughputSample.ts -[sqlresourcesmigratesqldatabasetoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlDatabaseToAutoscaleSample.ts -[sqlresourcesmigratesqldatabasetomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesMigrateSqlDatabaseToManualThroughputSample.ts -[sqlresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesRetrieveContinuousBackupInformationSample.ts -[sqlresourcesupdatesqlcontainerthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesUpdateSqlContainerThroughputSample.ts -[sqlresourcesupdatesqldatabasethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/sqlResourcesUpdateSqlDatabaseThroughputSample.ts -[tableresourcescreateupdatetablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesCreateUpdateTableSample.ts -[tableresourcesdeletetablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesDeleteTableSample.ts -[tableresourcesgettablesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesGetTableSample.ts -[tableresourcesgettablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesGetTableThroughputSample.ts -[tableresourceslisttablessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesListTablesSample.ts -[tableresourcesmigratetabletoautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesMigrateTableToAutoscaleSample.ts -[tableresourcesmigratetabletomanualthroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesMigrateTableToManualThroughputSample.ts -[tableresourcesretrievecontinuousbackupinformationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesRetrieveContinuousBackupInformationSample.ts -[tableresourcesupdatetablethroughputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/cosmosdb/arm-cosmosdb/samples/v16/typescript/src/tableResourcesUpdateTableThroughputSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-cosmosdb?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/arm-cosmosdb/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts b/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts index e3a6c1e8d423..a630556bdd2a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts @@ -15,6 +15,7 @@ import { } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { + ChaosFaultImpl, DatabaseAccountsImpl, OperationsImpl, DatabaseImpl, @@ -28,14 +29,17 @@ import { CollectionPartitionImpl, PartitionKeyRangeIdImpl, PartitionKeyRangeIdRegionImpl, + GraphResourcesImpl, SqlResourcesImpl, MongoDBResourcesImpl, TableResourcesImpl, CassandraResourcesImpl, GremlinResourcesImpl, LocationsImpl, + DataTransferJobsImpl, CassandraClustersImpl, CassandraDataCentersImpl, + NetworkSecurityPerimeterConfigurationsImpl, NotebookWorkspacesImpl, PrivateEndpointConnectionsImpl, PrivateLinkResourcesImpl, @@ -52,8 +56,13 @@ import { RestorableTablesImpl, RestorableTableResourcesImpl, ServiceImpl, -} from "./operations"; + ThroughputPoolsImpl, + ThroughputPoolImpl, + ThroughputPoolAccountsImpl, + ThroughputPoolAccountImpl, +} from "./operations/index.js"; import { + ChaosFault, DatabaseAccounts, Operations, Database, @@ -67,14 +76,17 @@ import { CollectionPartition, PartitionKeyRangeId, PartitionKeyRangeIdRegion, + GraphResources, SqlResources, MongoDBResources, TableResources, CassandraResources, GremlinResources, Locations, + DataTransferJobs, CassandraClusters, CassandraDataCenters, + NetworkSecurityPerimeterConfigurations, NotebookWorkspaces, PrivateEndpointConnections, PrivateLinkResources, @@ -91,8 +103,12 @@ import { RestorableTables, RestorableTableResources, Service, -} from "./operationsInterfaces"; -import { CosmosDBManagementClientOptionalParams } from "./models"; + ThroughputPools, + ThroughputPool, + ThroughputPoolAccounts, + ThroughputPoolAccount, +} from "./operationsInterfaces/index.js"; +import { CosmosDBManagementClientOptionalParams } from "./models/index.js"; export class CosmosDBManagementClient extends coreClient.ServiceClient { $host: string; @@ -102,7 +118,7 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { /** * Initializes a new instance of the CosmosDBManagementClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param options The parameter options */ constructor( @@ -126,7 +142,7 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-cosmosdb/16.2.0`; + const packageDetails = `azsdk-js-arm-cosmosdb/16.3.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -180,7 +196,8 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-11-15"; + this.apiVersion = options.apiVersion || "2024-12-01-preview"; + this.chaosFault = new ChaosFaultImpl(this); this.databaseAccounts = new DatabaseAccountsImpl(this); this.operations = new OperationsImpl(this); this.database = new DatabaseImpl(this); @@ -194,14 +211,18 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { this.collectionPartition = new CollectionPartitionImpl(this); this.partitionKeyRangeId = new PartitionKeyRangeIdImpl(this); this.partitionKeyRangeIdRegion = new PartitionKeyRangeIdRegionImpl(this); + this.graphResources = new GraphResourcesImpl(this); this.sqlResources = new SqlResourcesImpl(this); this.mongoDBResources = new MongoDBResourcesImpl(this); this.tableResources = new TableResourcesImpl(this); this.cassandraResources = new CassandraResourcesImpl(this); this.gremlinResources = new GremlinResourcesImpl(this); this.locations = new LocationsImpl(this); + this.dataTransferJobs = new DataTransferJobsImpl(this); this.cassandraClusters = new CassandraClustersImpl(this); this.cassandraDataCenters = new CassandraDataCentersImpl(this); + this.networkSecurityPerimeterConfigurations = + new NetworkSecurityPerimeterConfigurationsImpl(this); this.notebookWorkspaces = new NotebookWorkspacesImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); @@ -220,6 +241,10 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { this.restorableTables = new RestorableTablesImpl(this); this.restorableTableResources = new RestorableTableResourcesImpl(this); this.service = new ServiceImpl(this); + this.throughputPools = new ThroughputPoolsImpl(this); + this.throughputPool = new ThroughputPoolImpl(this); + this.throughputPoolAccounts = new ThroughputPoolAccountsImpl(this); + this.throughputPoolAccount = new ThroughputPoolAccountImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -251,6 +276,7 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { this.pipeline.addPolicy(apiVersionPolicy); } + chaosFault: ChaosFault; databaseAccounts: DatabaseAccounts; operations: Operations; database: Database; @@ -264,14 +290,17 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { collectionPartition: CollectionPartition; partitionKeyRangeId: PartitionKeyRangeId; partitionKeyRangeIdRegion: PartitionKeyRangeIdRegion; + graphResources: GraphResources; sqlResources: SqlResources; mongoDBResources: MongoDBResources; tableResources: TableResources; cassandraResources: CassandraResources; gremlinResources: GremlinResources; locations: Locations; + dataTransferJobs: DataTransferJobs; cassandraClusters: CassandraClusters; cassandraDataCenters: CassandraDataCenters; + networkSecurityPerimeterConfigurations: NetworkSecurityPerimeterConfigurations; notebookWorkspaces: NotebookWorkspaces; privateEndpointConnections: PrivateEndpointConnections; privateLinkResources: PrivateLinkResources; @@ -288,4 +317,8 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { restorableTables: RestorableTables; restorableTableResources: RestorableTableResources; service: Service; + throughputPools: ThroughputPools; + throughputPool: ThroughputPool; + throughputPoolAccounts: ThroughputPoolAccounts; + throughputPoolAccount: ThroughputPoolAccount; } diff --git a/sdk/cosmosdb/arm-cosmosdb/src/index.ts b/sdk/cosmosdb/arm-cosmosdb/src/index.ts index b4d35fbb2d75..8b9e6e85a797 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/index.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/index.ts @@ -7,7 +7,7 @@ */ /// -export { getContinuationToken } from "./pagingHelper"; -export * from "./models"; -export { CosmosDBManagementClient } from "./cosmosDBManagementClient"; -export * from "./operationsInterfaces"; +export { getContinuationToken } from "./pagingHelper.js"; +export * from "./models/index.js"; +export { CosmosDBManagementClient } from "./cosmosDBManagementClient.js"; +export * from "./operationsInterfaces/index.js"; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts index 2f59ae1aa644..3317f770cd4f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts @@ -12,6 +12,11 @@ export type BackupPolicyUnion = | BackupPolicy | PeriodicModeBackupPolicy | ContinuousModeBackupPolicy; +export type DataTransferDataSourceSinkUnion = + | DataTransferDataSourceSink + | BaseCosmosDataTransferDataSourceSinkUnion + | CosmosMongoVCoreDataTransferDataSourceSink + | AzureBlobDataTransferDataSourceSink; export type ServiceResourcePropertiesUnion = | ServiceResourceProperties | DataTransferServiceResourceProperties @@ -24,40 +29,113 @@ export type ServiceResourceCreateUpdatePropertiesUnion = | SqlDedicatedGatewayServiceResourceCreateUpdateProperties | GraphAPIComputeServiceResourceCreateUpdateProperties | MaterializedViewsBuilderServiceResourceCreateUpdateProperties; +export type BaseCosmosDataTransferDataSourceSinkUnion = + | BaseCosmosDataTransferDataSourceSink + | CosmosCassandraDataTransferDataSourceSink + | CosmosMongoDataTransferDataSourceSink + | CosmosSqlDataTransferDataSourceSink; -/** Identity for the resource. */ -export interface ManagedServiceIdentity { +/** Chaos Fault List Response. */ +export interface ChaosFaultListResponse { /** - * The principal id of the system assigned identity. This property will only be provided for a system assigned identity. + * List of Chaos Faults. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalId?: string; + readonly value?: ChaosFaultResource[]; /** - * The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. + * The link used to get the next page of results. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly tenantId?: string; - /** The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. */ - type?: ResourceIdentityType; - /** The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: { - [ - propertyName: string - ]: Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties; - }; + readonly nextLink?: string; } -export interface Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties { +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { /** - * The principal id of user assigned identity. + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly principalId?: string; + readonly id?: string; /** - * The client id of user assigned identity. + * The name of the resource * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly clientId?: string; + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; } /** IpAddressOrRange object */ @@ -97,7 +175,7 @@ export interface Location { */ readonly documentEndpoint?: string; /** - * The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. + * The provisioning state of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; @@ -147,25 +225,6 @@ export interface PrivateLinkServiceConnectionStateProperty { readonly actionsRequired?: string; } -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { - /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; -} - export interface ApiProperties { /** Describes the version of the MongoDB account. */ serverVersion?: ServerVersion; @@ -235,12 +294,43 @@ export interface CorsPolicy { maxAgeInSeconds?: number; } +/** Indicates what diagnostic log settings are to be enabled. */ +export interface DiagnosticLogSettings { + /** Describe the level of detail with which queries are to be logged. */ + enableFullTextQuery?: EnableFullTextQuery; +} + /** The object that represents all properties related to capacity enforcement on an account. */ export interface Capacity { /** The total throughput limit imposed on the account. A totalThroughputLimit of 2000 imposes a strict limit of max throughput that can be provisioned on that account to be 2000. A totalThroughputLimit of -1 indicates no limits on provisioning of throughput. */ totalThroughputLimit?: number; } +/** The transition state information related capacity mode change with update request. */ +export interface CapacityModeChangeTransitionState { + /** The transition status of capacity mode. */ + capacityModeTransitionStatus?: CapacityModeTransitionStatus; + /** Indicates the current capacity mode of the account. */ + currentCapacityMode?: CapacityMode; + /** Indicates the previous capacity mode of the account before successful transition. */ + previousCapacityMode?: CapacityMode; + /** + * Begin time in UTC of the capacity mode change. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capacityModeTransitionBeginTimestamp?: Date; + /** + * End time in UTC of the capacity mode change. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capacityModeTransitionEndTimestamp?: Date; + /** + * End time in UTC of the last successful capacity mode change. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly capacityModeLastSuccessfulTransitionEndTimestamp?: Date; +} + /** The metadata related to each access key for the given Cosmos DB database account. */ export interface DatabaseAccountKeysMetadata { /** @@ -274,22 +364,6 @@ export interface AccountKeyMetadata { readonly generationTime?: Date; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - /** The core properties of ARM resources. */ export interface ARMResourceProperties { /** @@ -311,6 +385,43 @@ export interface ARMResourceProperties { location?: string; /** Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". */ tags?: { [propertyName: string]: string }; + /** Identity for the resource. */ + identity?: ManagedServiceIdentity; +} + +/** Identity for the resource. */ +export interface ManagedServiceIdentity { + /** + * The principal id of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. */ + type?: ResourceIdentityType; + /** The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + userAssignedIdentities?: { + [ + propertyName: string + ]: Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties; + }; +} + +export interface Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties { + /** + * The principal id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client id of user assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; } /** Parameters for patching Azure Cosmos DB database account properties. */ @@ -365,10 +476,16 @@ export interface DatabaseAccountUpdateParameters { networkAclBypass?: NetworkAclBypass; /** An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */ networkAclBypassResourceIds?: string[]; + /** The Object representing the different Diagnostic log settings for the Cosmos DB Account. */ + diagnosticLogSettings?: DiagnosticLogSettings; /** Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ disableLocalAuth?: boolean; /** The object that represents all properties related to capacity enforcement on an account. */ capacity?: Capacity; + /** Indicates the capacityMode of the Cosmos DB account. */ + capacityMode?: CapacityMode; + /** Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */ + enableMaterializedViews?: boolean; /** * This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -376,13 +493,17 @@ export interface DatabaseAccountUpdateParameters { readonly keysMetadata?: DatabaseAccountKeysMetadata; /** Flag to indicate enabling/disabling of Partition Merge feature on the account */ enablePartitionMerge?: boolean; - /** Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. */ - minimalTlsVersion?: MinimalTlsVersion; - /** Flag to indicate enabling/disabling of Burst Capacity feature on the account */ + /** Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account */ enableBurstCapacity?: boolean; + /** Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. */ + minimalTlsVersion?: MinimalTlsVersion; /** Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. */ customerManagedKeyStatus?: string; - /** Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account */ + /** Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account */ + enablePriorityBasedExecution?: boolean; + /** Enum to indicate default Priority Level of request for Priority Based Execution. */ + defaultPriorityLevel?: DefaultPriorityLevel; + /** Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account */ enablePerRegionPerPartitionAutoscale?: boolean; } @@ -451,55 +572,6 @@ export interface RegionForOnlineOffline { region: string; } -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - /** Parameters to regenerate the keys within the database account. */ export interface DatabaseAccountRegenerateKeyParameters { /** The access key to regenerate. */ @@ -776,42 +848,19 @@ export interface MetricAvailability { readonly retention?: string; } -/** The List operation response, that contains the SQL databases and their properties. */ -export interface SqlDatabaseListResult { +/** The List operation response, that contains the Graph resource and their properties. */ +export interface GraphResourcesListResult { /** - * List of SQL databases and their properties. + * List of Graph resource and their properties. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: SqlDatabaseGetResults[]; + readonly value?: GraphResourceGetResults[]; } -/** Cosmos DB SQL database resource object */ -export interface SqlDatabaseResource { - /** Name of the Cosmos DB SQL database */ +/** Cosmos DB Graph resource object */ +export interface GraphResource { + /** Name of the Cosmos DB Graph */ id: string; - /** Parameters to indicate the information about the restore */ - restoreParameters?: ResourceRestoreParameters; - /** Enum to indicate the mode of resource creation. */ - createMode?: CreateMode; -} - -/** The system generated resource properties associated with SQL databases, SQL containers, Gremlin databases and Gremlin graphs. */ -export interface ExtendedResourceProperties { - /** - * A system generated property. A unique identifier. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly rid?: string; - /** - * A system generated property that denotes the last updated timestamp of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly ts?: number; - /** - * A system generated property representing the resource etag required for optimistic concurrency control. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; } /** Cosmos DB options resource object */ @@ -835,6 +884,44 @@ export interface CreateUpdateOptions { autoscaleSettings?: AutoscaleSettings; } +/** The List operation response, that contains the SQL databases and their properties. */ +export interface SqlDatabaseListResult { + /** + * List of SQL databases and their properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: SqlDatabaseGetResults[]; +} + +/** Cosmos DB SQL database resource object */ +export interface SqlDatabaseResource { + /** Name of the Cosmos DB SQL database */ + id: string; + /** Parameters to indicate the information about the restore */ + restoreParameters?: ResourceRestoreParameters; + /** Enum to indicate the mode of resource creation. */ + createMode?: CreateMode; +} + +/** The system generated resource properties associated with SQL databases, SQL containers, Gremlin databases and Gremlin graphs. */ +export interface ExtendedResourceProperties { + /** + * A system generated property. A unique identifier. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly rid?: string; + /** + * A system generated property that denotes the last updated timestamp of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly ts?: number; + /** + * A system generated property representing the resource etag required for optimistic concurrency control. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly etag?: string; +} + /** Cosmos DB resource throughput object. Either throughput is required or autoscaleSettings is required, but not both. */ export interface ThroughputSettingsResource { /** Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. */ @@ -861,6 +948,8 @@ export interface ThroughputSettingsResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly softAllowedMaximumThroughput?: string; + /** Array of Throughput Bucket limits to be applied to the Cosmos DB container */ + throughputBuckets?: ThroughputBucketResource[]; } /** Cosmos DB provisioned throughput settings object */ @@ -890,6 +979,72 @@ export interface ThroughputPolicyResource { incrementPercent?: number; } +/** Cosmos DB throughput bucket object */ +export interface ThroughputBucketResource { + /** Represents the throughput bucket id */ + id: number; + /** Represents maximum percentage throughput that can be used by the bucket */ + maxThroughputPercentage: number; +} + +/** The List operation response, that contains the client encryption keys and their properties. */ +export interface ClientEncryptionKeysListResult { + /** + * List of client encryption keys and their properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ClientEncryptionKeyGetResults[]; +} + +/** Cosmos DB client encryption key resource object. */ +export interface ClientEncryptionKeyResource { + /** Name of the ClientEncryptionKey */ + id?: string; + /** Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. */ + encryptionAlgorithm?: string; + /** Wrapped (encrypted) form of the key represented as a byte array. */ + wrappedDataEncryptionKey?: Uint8Array; + /** Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. */ + keyWrapMetadata?: KeyWrapMetadata; +} + +/** Represents key wrap metadata that a key wrapping provider can use to wrap/unwrap a client encryption key. */ +export interface KeyWrapMetadata { + /** The name of associated KeyEncryptionKey (aka CustomerManagedKey). */ + name?: string; + /** ProviderName of KeyStoreProvider. */ + 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 */ +export interface ARMProxyResource { + /** + * The unique resource identifier of the database account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the database account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of Azure resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** Parameters to create and update ClientEncryptionKey. */ +export interface ClientEncryptionKeyCreateUpdateParameters { + /** The standard JSON format of a ClientEncryptionKey */ + resource: ClientEncryptionKeyResource; +} + /** The List operation response, that contains the containers and their properties. */ export interface SqlContainerListResult { /** @@ -921,6 +1076,8 @@ export interface SqlContainerResource { restoreParameters?: ResourceRestoreParameters; /** Enum to indicate the mode of resource creation. */ createMode?: CreateMode; + /** The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. */ + materializedViewDefinition?: MaterializedViewDefinition; /** List of computed properties */ computedProperties?: ComputedProperty[]; /** The vector embedding policy for the container. */ @@ -1046,6 +1203,19 @@ export interface ClientEncryptionIncludedPath { encryptionAlgorithm: string; } +/** Materialized View definition for the container. */ +export interface MaterializedViewDefinition { + /** + * An unique identifier for the source collection. This is a system generated property. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly sourceCollectionRid?: string; + /** The name of the source container on which the Materialized View will be created. */ + sourceCollectionId: string; + /** The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. */ + definition: string; +} + /** The definition of a computed property */ export interface ComputedProperty { /** The name of a computed property, for example - "cp_lowerName" */ @@ -1072,62 +1242,69 @@ export interface VectorEmbedding { dimensions: number; } -/** The List operation response, that contains the client encryption keys and their properties. */ -export interface ClientEncryptionKeysListResult { +/** 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 client encryption keys and their properties. + * List of physical partitions and their properties. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: ClientEncryptionKeyGetResults[]; -} - -/** Cosmos DB client encryption key resource object. */ -export interface ClientEncryptionKeyResource { - /** Name of the ClientEncryptionKey */ - id?: string; - /** Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. */ - encryptionAlgorithm?: string; - /** Wrapped (encrypted) form of the key represented as a byte array. */ - wrappedDataEncryptionKey?: Uint8Array; - /** Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. */ - keyWrapMetadata?: KeyWrapMetadata; + readonly physicalPartitionStorageInfoCollection?: PhysicalPartitionStorageInfo[]; } -/** Represents key wrap metadata that a key wrapping provider can use to wrap/unwrap a client encryption key. */ -export interface KeyWrapMetadata { - /** The name of associated KeyEncryptionKey (aka CustomerManagedKey). */ - name?: string; - /** ProviderName of KeyStoreProvider. */ - 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 */ -export interface ARMProxyResource { +/** The storage of a physical partition */ +export interface PhysicalPartitionStorageInfo { /** - * The unique resource identifier of the database account. + * 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 name of the database account. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of Azure resource. + * The storage in KB for the physical partition. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly type?: string; + readonly storageInKB?: number; } -/** Parameters to create and update ClientEncryptionKey. */ -export interface ClientEncryptionKeyCreateUpdateParameters { - /** The standard JSON format of a ClientEncryptionKey */ - resource: ClientEncryptionKeyResource; +/** 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. */ @@ -1431,6 +1608,96 @@ export interface LocationProperties { readonly status?: Status; } +/** The List operation response, that contains the Cassandra views and their properties. */ +export interface CassandraViewListResult { + /** + * List of Cassandra views and their properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: CassandraViewGetResults[]; +} + +/** Cosmos DB Cassandra view resource object */ +export interface CassandraViewResource { + /** Name of the Cosmos DB Cassandra view */ + id: string; + /** View Definition of the Cosmos DB Cassandra view */ + viewDefinition: string; +} + +/** The properties of a DataTransfer Job */ +export interface DataTransferJobProperties { + /** + * Job Name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly jobName?: string; + /** Source DataStore details */ + source: DataTransferDataSourceSinkUnion; + /** Destination DataStore details */ + destination: DataTransferDataSourceSinkUnion; + /** + * Job Status + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * 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 totalCount?: number; + /** + * Last Updated Time (ISO-8601 format). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastUpdatedUtcTime?: Date; + /** Worker count */ + workerCount?: number; + /** + * Error response for Faulted job + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: ErrorResponse; + /** + * Total Duration of Job + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly duration?: string; + /** Mode of job execution */ + mode?: DataTransferJobMode; +} + +/** Base class for all DataTransfer source/sink */ +export interface DataTransferDataSourceSink { + /** Polymorphic discriminator, which specifies the different types this object can be */ + component: + | "BaseCosmosDataTransferDataSourceSink" + | "CosmosDBCassandra" + | "CosmosDBMongo" + | "CosmosDBMongoVCore" + | "CosmosDBSql" + | "AzureBlobStorage"; +} + +/** The List operation response, that contains the Data Transfer jobs and their properties. */ +export interface DataTransferJobFeedResults { + /** + * List of Data Transfer jobs and their properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: DataTransferJobGetResults[]; + /** + * URL to get the next set of Data Transfer job list results if there are any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + /** List of managed Cassandra clusters. */ export interface ListClusters { /** Container for the array of clusters. */ @@ -1457,6 +1724,8 @@ export interface ClusterResourceProperties { prometheusEndpoint?: SeedNode; /** Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. */ repairEnabled?: boolean; + /** The form of AutoReplicate that is being used by this cluster. */ + autoReplicate?: AutoReplicate; /** List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. */ clientCertificates?: Certificate[]; /** List of TLS certificates used to authorize gossip from unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be verifiable using one of the certificates provided in this property. */ @@ -1473,18 +1742,28 @@ export interface ClusterResourceProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly seedNodes?: SeedNode[]; + /** List of the data center names for unmanaged data centers in this cluster to be included in auto-replication. */ + externalDataCenters?: string[]; /** (Deprecated) Number of hours to wait between taking a backup of the cluster. */ hoursBetweenBackups?: number; /** Whether the cluster and associated data centers has been deallocated. */ deallocated?: boolean; /** Whether Cassandra audit logging is enabled */ cassandraAuditLoggingEnabled?: boolean; + /** Type of the cluster. If set to Production, some operations might not be permitted on cluster. */ + clusterType?: ClusterType; /** Error related to resource provisioning. */ provisionError?: CassandraError; + /** Extensions to be added or updated on cluster. */ + extensions?: string[]; + /** List of backup schedules that define when you want to back up your data. */ + backupSchedules?: BackupSchedule[]; + /** How the nodes in the cluster react to scheduled events */ + scheduledEventStrategy?: ScheduledEventStrategy; /** How to connect to the azure services needed for running the cluster */ azureConnectionMethod?: AzureConnectionType; /** - * If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect to. + * If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect to. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly privateLinkResourceId?: string; @@ -1511,6 +1790,15 @@ export interface CassandraError { additionalErrorInfo?: string; } +export interface BackupSchedule { + /** The unique identifier of backup schedule. */ + scheduleName?: string; + /** The cron expression that defines when you want to back up your data. */ + cronExpression?: string; + /** The retention period (hours) of the backups. If you want to retain data forever, set retention to 0. */ + retentionInHours?: number; +} + /** The core properties of ARM resources. */ export interface ManagedCassandraARMResourceProperties { /** @@ -1572,6 +1860,76 @@ export interface CommandOutput { commandOutput?: string; } +/** Specification of which command to run where */ +export interface CommandAsyncPostBody { + /** The command which should be run */ + command: string; + /** The arguments for the command to be run */ + arguments?: Record; + /** IP address of the cassandra host to run the command on */ + host: string; + /** If true, stops cassandra before executing the command and then start it again */ + cassandraStopStart?: boolean; + /** If true, allows the command to *write* to the cassandra directory, otherwise read-only. */ + readWrite?: boolean; +} + +/** resource representing a command */ +export interface CommandPublicResource { + /** The command which should be run */ + command?: string; + /** The unique id of command */ + commandId?: string; + /** The arguments for the command to be run */ + arguments?: Record; + /** IP address of the cassandra host to run the command on */ + host?: string; + /** Whether command has admin privileges */ + isAdmin?: boolean; + /** If true, stops cassandra before executing the command and then start it again */ + cassandraStopStart?: boolean; + /** If true, allows the command to *write* to the cassandra directory, otherwise read-only. */ + readWrite?: boolean; + /** Result output of the command. */ + result?: string; + /** Status of the command. */ + status?: CommandStatus; + /** The name of the file where the result is written. */ + outputFile?: string; +} + +/** List of commands for cluster. */ +export interface ListCommands { + /** + * Container for array of commands. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: CommandPublicResource[]; +} + +/** List of restorable backups for a Cassandra cluster. */ +export interface ListBackups { + /** + * Container for array of backups. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: BackupResource[]; +} + +/** A restorable backup of a Cassandra cluster. */ +export interface BackupResource { + /** The unique identifier of backup. */ + backupId?: string; + /** The current state of the backup. */ + backupState?: BackupState; + /** The time at which the backup process begins. */ + backupStartTimestamp?: Date; + /** The time at which the backup process ends. */ + backupStopTimestamp?: Date; + /** The time at which the backup will expire. */ + backupExpiryTimestamp?: Date; +} + /** List of managed Cassandra data centers and their properties. */ export interface ListDataCenters { /** @@ -1713,6 +2071,8 @@ export interface ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDa memoryTotalKB?: number; /** A float representing the current system-wide CPU utilization as a percentage. */ cpuUsage?: number; + /** If node has been updated to latest model */ + isLatestModel?: boolean; } /** The set of data plane operations permitted through this Role Definition. */ @@ -1787,30 +2147,165 @@ export interface MongoUserDefinitionListResult { readonly value?: MongoUserDefinitionGetResults[]; } -/** A list of notebook workspace resources */ -export interface NotebookWorkspaceListResult { - /** Array of notebook workspace resources */ - value?: NotebookWorkspace[]; +/** Result of a list NSP (network security perimeter) configurations request. */ +export interface NetworkSecurityPerimeterConfigurationListResult { + /** Array of network security perimeter results. */ + value?: NetworkSecurityPerimeterConfiguration[]; + /** The link used to get the next page of results. */ + nextLink?: string; } -/** The connection info for the given notebook workspace */ -export interface NotebookWorkspaceConnectionInfoResult { +/** Network security configuration properties. */ +export interface NetworkSecurityPerimeterConfigurationProperties { /** - * Specifies auth token used for connecting to Notebook server (uses token-based auth). + * Provisioning state of a network security perimeter configuration that is being created or updated. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly authToken?: string; + readonly provisioningState?: NetworkSecurityPerimeterConfigurationProvisioningState; /** - * Specifies the endpoint of Notebook server. + * List of provisioning issues, if any * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly notebookServerEndpoint?: string; + readonly provisioningIssues?: ProvisioningIssue[]; + /** Information about a network security perimeter (NSP) */ + networkSecurityPerimeter?: NetworkSecurityPerimeter; + /** Information about resource association */ + resourceAssociation?: ResourceAssociation; + /** Network security perimeter configuration profile */ + profile?: NetworkSecurityProfile; } -/** A list of private endpoint connections */ -export interface PrivateEndpointConnectionListResult { - /** Array of private endpoint connections */ - value?: PrivateEndpointConnection[]; +/** Describes a provisioning issue for a network security perimeter configuration */ +export interface ProvisioningIssue { + /** + * Name of the issue + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly properties?: ProvisioningIssueProperties; +} + +/** Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules */ +export interface ProvisioningIssueProperties { + /** + * Type of issue + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly issueType?: IssueType; + /** + * Severity of the issue. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly severity?: Severity; + /** + * Description of the issue + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; + /** + * Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly suggestedResourceIds?: string[]; + /** + * Access rules that can be added to the network security profile (NSP) to remediate the issue. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly suggestedAccessRules?: AccessRule[]; +} + +/** Access rule in a network security perimeter configuration profile */ +export interface AccessRule { + /** Name of the access rule */ + name?: string; + /** Properties of Access Rule */ + properties?: AccessRuleProperties; +} + +/** Properties of Access Rule */ +export interface AccessRuleProperties { + /** Direction of Access Rule */ + direction?: AccessRuleDirection; + /** Address prefixes in the CIDR format for inbound rules */ + addressPrefixes?: string[]; + /** Subscriptions for inbound rules */ + subscriptions?: AccessRulePropertiesSubscriptionsItem[]; + /** Network security perimeters for inbound rules */ + networkSecurityPerimeters?: NetworkSecurityPerimeter[]; + /** Fully qualified domain names (FQDN) for outbound rules */ + fullyQualifiedDomainNames?: string[]; + /** Email addresses for outbound rules */ + emailAddresses?: string[]; + /** Phone numbers for outbound rules */ + phoneNumbers?: string[]; +} + +/** Subscription identifiers */ +export interface AccessRulePropertiesSubscriptionsItem { + /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ + id?: string; +} + +/** Information about a network security perimeter (NSP) */ +export interface NetworkSecurityPerimeter { + /** Fully qualified Azure resource ID of the NSP resource */ + id?: string; + /** Universal unique ID (UUID) of the network security perimeter */ + perimeterGuid?: string; + /** Location of the network security perimeter */ + location?: string; +} + +/** Information about resource association */ +export interface ResourceAssociation { + /** Name of the resource association */ + name?: string; + /** Access mode of the resource association */ + accessMode?: ResourceAssociationAccessMode; +} + +/** Network security perimeter configuration profile */ +export interface NetworkSecurityProfile { + /** Name of the profile */ + name?: string; + /** Current access rules version */ + accessRulesVersion?: number; + /** List of Access Rules */ + accessRules?: AccessRule[]; + /** Current diagnostic settings version */ + diagnosticSettingsVersion?: number; + /** List of log categories that are enabled */ + enabledLogCategories?: string[]; +} + +/** A list of notebook workspace resources */ +export interface NotebookWorkspaceListResult { + /** Array of notebook workspace resources */ + value?: NotebookWorkspace[]; +} + +/** The connection info for the given notebook workspace */ +export interface NotebookWorkspaceConnectionInfoResult { + /** + * Specifies auth token used for connecting to Notebook server (uses token-based auth). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly authToken?: string; + /** + * Specifies the endpoint of Notebook server. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly notebookServerEndpoint?: string; +} + +/** A list of private endpoint connections */ +export interface PrivateEndpointConnectionListResult { + /** Array of private endpoint connections */ + value?: PrivateEndpointConnection[]; } /** A list of private link resources */ @@ -1899,10 +2394,10 @@ export interface RestorableDatabaseAccountGetResult { accountName?: string; /** The creation time of the restorable database account (ISO-8601 format). */ creationTime?: Date; - /** The time at which the restorable database account has been deleted (ISO-8601 format). */ - deletionTime?: 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; /** * The API type of the restorable database account. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2626,6 +3121,80 @@ export interface ServiceResourceCreateUpdateProperties { instanceCount?: number; } +/** The List operation response, that contains the throughput pools and their properties. */ +export interface ThroughputPoolsListResult { + /** + * List of throughput pools and their properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ThroughputPoolResource[]; + /** + * The link used to get the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Represents a throughput pool resource for updates. */ +export interface ThroughputPoolUpdate { + /** A provisioning state of the ThroughputPool. */ + provisioningState?: Status; + /** Value for throughput to be shared among CosmosDB resources in the pool. */ + maxThroughput?: number; +} + +/** The List operation response, that contains the global database accounts and their properties. */ +export interface ThroughputPoolAccountsListResult { + /** + * List of global database accounts in a throughput pool and their properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ThroughputPoolAccountResource[]; + /** + * The link used to get the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The set of data plane operations permitted through this Role Definition. */ +export interface PermissionAutoGenerated { + /** The id for the permission. */ + id?: string; + /** An array of data actions that are allowed. */ + dataActions?: string[]; + /** An array of data actions that are denied. */ + notDataActions?: string[]; +} + +/** The relevant Role Definitions. */ +export interface TableRoleDefinitionListResult { + /** + * List of Role Definitions and their properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: TableRoleDefinitionResource[]; + /** + * The link used to get the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The relevant Role Assignments. */ +export interface TableRoleAssignmentListResult { + /** + * List of Role Assignments and their properties + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: TableRoleAssignmentResource[]; + /** + * The link used to get the next page of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + /** Configuration values for periodic mode backup */ export interface PeriodicModeProperties { /** An integer representing the interval in minutes between two backups */ @@ -2638,7 +3207,7 @@ export interface PeriodicModeProperties { /** Configuration values for periodic mode backup */ export interface ContinuousModeProperties { - /** Enum to indicate type of Continuous backup mode */ + /** Enum to indicate type of Continuos backup mode */ tier?: ContinuousTier; } @@ -2685,9 +3254,27 @@ export interface MaterializedViewsBuilderServiceResource { properties?: MaterializedViewsBuilderServiceResourceProperties; } +/** Parameters for creating a Azure Cosmos DB throughput pool account. */ +export interface ThroughputPoolAccountCreateParameters { + /** Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". */ + tags?: { [propertyName: string]: string }; + /** The resource identifier of global database account in the throughputPool. */ + accountResourceIdentifier?: string; + /** The location of global database account in the throughputPool. */ + accountLocation?: string; +} + /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export interface ProxyResource extends Resource {} +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + /** Parameters to indicate the information about the restore. */ export interface RestoreParameters extends RestoreParametersBase { /** Describes the mode of the restore. */ @@ -2698,6 +3285,8 @@ export interface RestoreParameters extends RestoreParametersBase { gremlinDatabasesToRestore?: GremlinDatabaseRestoreResource[]; /** List of specific tables available for restore. */ tablesToRestore?: string[]; + /** The source backup location for restore. */ + sourceBackupLocation?: string; } /** Parameters to indicate the information about the restore. */ @@ -2723,15 +3312,13 @@ export interface ContinuousModeBackupPolicy extends BackupPolicy { export interface DatabaseAccountGetResults extends ARMResourceProperties { /** Indicates the type of database account. This can only be set at database account creation. */ kind?: DatabaseAccountKind; - /** Identity for the resource. */ - identity?: ManagedServiceIdentity; /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; /** - * The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. + * The provisioning state of the resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; @@ -2821,10 +3408,18 @@ export interface DatabaseAccountGetResults extends ARMResourceProperties { networkAclBypass?: NetworkAclBypass; /** An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */ networkAclBypassResourceIds?: string[]; + /** The Object representing the different Diagnostic log settings for the Cosmos DB Account. */ + diagnosticLogSettings?: DiagnosticLogSettings; /** Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ disableLocalAuth?: boolean; /** The object that represents all properties related to capacity enforcement on an account. */ capacity?: Capacity; + /** Indicates the capacityMode of the Cosmos DB account. */ + capacityMode?: CapacityMode; + /** The object that represents the migration state for the CapacityMode of the Cosmos DB account. */ + capacityModeChangeTransitionState?: CapacityModeChangeTransitionState; + /** Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */ + enableMaterializedViews?: boolean; /** * The object that represents the metadata for the Account Keys of the Cosmos DB account. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2832,13 +3427,17 @@ export interface DatabaseAccountGetResults extends ARMResourceProperties { readonly keysMetadata?: DatabaseAccountKeysMetadata; /** Flag to indicate enabling/disabling of Partition Merge feature on the account */ enablePartitionMerge?: boolean; - /** Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. */ - minimalTlsVersion?: MinimalTlsVersion; - /** Flag to indicate enabling/disabling of Burst Capacity feature on the account */ + /** Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account */ enableBurstCapacity?: boolean; + /** Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. */ + minimalTlsVersion?: MinimalTlsVersion; /** Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. */ customerManagedKeyStatus?: string; - /** Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account */ + /** Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account */ + enablePriorityBasedExecution?: boolean; + /** Enum to indicate default Priority Level of request for Priority Based Execution. */ + defaultPriorityLevel?: DefaultPriorityLevel; + /** Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account */ enablePerRegionPerPartitionAutoscale?: boolean; } @@ -2847,8 +3446,6 @@ export interface DatabaseAccountCreateUpdateParameters extends ARMResourceProperties { /** Indicates the type of database account. This can only be set at database account creation. */ kind?: DatabaseAccountKind; - /** Identity for the resource. */ - identity?: ManagedServiceIdentity; /** The consistency policy for the Cosmos DB account. */ consistencyPolicy?: ConsistencyPolicy; /** An array that contains the georeplication locations enabled for the Cosmos DB account. */ @@ -2897,12 +3494,18 @@ export interface DatabaseAccountCreateUpdateParameters networkAclBypass?: NetworkAclBypass; /** An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */ networkAclBypassResourceIds?: string[]; + /** The Object representing the different Diagnostic log settings for the Cosmos DB Account. */ + diagnosticLogSettings?: DiagnosticLogSettings; /** Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ disableLocalAuth?: boolean; /** Parameters to indicate the information about the restore. */ restoreParameters?: RestoreParameters; /** The object that represents all properties related to capacity enforcement on an account. */ capacity?: Capacity; + /** Indicates the capacityMode of the Cosmos DB account. */ + capacityMode?: CapacityMode; + /** Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */ + enableMaterializedViews?: boolean; /** * This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2910,16 +3513,35 @@ export interface DatabaseAccountCreateUpdateParameters readonly keysMetadata?: DatabaseAccountKeysMetadata; /** Flag to indicate enabling/disabling of Partition Merge feature on the account */ enablePartitionMerge?: boolean; - /** Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. */ - minimalTlsVersion?: MinimalTlsVersion; - /** Flag to indicate enabling/disabling of Burst Capacity feature on the account */ + /** Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account */ enableBurstCapacity?: boolean; + /** Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. */ + minimalTlsVersion?: MinimalTlsVersion; /** Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. */ customerManagedKeyStatus?: string; - /** Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account */ + /** Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account */ + enablePriorityBasedExecution?: boolean; + /** Enum to indicate default Priority Level of request for Priority Based Execution. */ + defaultPriorityLevel?: DefaultPriorityLevel; + /** Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account */ enablePerRegionPerPartitionAutoscale?: boolean; } +/** An Azure Cosmos DB Graph resource. */ +export interface GraphResourceGetResults extends ARMResourceProperties { + resource?: GraphResourceGetPropertiesResource; + options?: GraphResourceGetPropertiesOptions; +} + +/** Parameters to create and update Cosmos DB Graph resource. */ +export interface GraphResourceCreateUpdateParameters + extends ARMResourceProperties { + /** The standard JSON format of a Graph resource */ + resource: GraphResource; + /** A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options?: CreateUpdateOptions; +} + /** An Azure Cosmos DB SQL database. */ export interface SqlDatabaseGetResults extends ARMResourceProperties { resource?: SqlDatabaseGetPropertiesResource; @@ -2962,6 +3584,26 @@ export interface SqlContainerCreateUpdateParameters options?: CreateUpdateOptions; } +/** Cosmos DB retrieve throughput parameters object */ +export interface RetrieveThroughputParameters extends ARMResourceProperties { + /** The standard JSON format of a resource throughput */ + resource: RetrieveThroughputPropertiesResource; +} + +/** An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ +export interface PhysicalPartitionThroughputInfoResult + extends ARMResourceProperties { + /** properties of physical partition throughput info */ + resource?: PhysicalPartitionThroughputInfoResultPropertiesResource; +} + +/** Cosmos DB redistribute throughput parameters object */ +export interface RedistributeThroughputParameters + extends ARMResourceProperties { + /** The standard JSON format of a resource throughput */ + resource: RedistributeThroughputPropertiesResource; +} + /** An Azure Cosmos DB storedProcedure. */ export interface SqlStoredProcedureGetResults extends ARMResourceProperties { resource?: SqlStoredProcedureGetPropertiesResource; @@ -3109,6 +3751,21 @@ export interface GremlinGraphCreateUpdateParameters options?: CreateUpdateOptions; } +/** An Azure Cosmos DB Cassandra view. */ +export interface CassandraViewGetResults extends ARMResourceProperties { + resource?: CassandraViewGetPropertiesResource; + options?: CassandraViewGetPropertiesOptions; +} + +/** Parameters to create and update Cosmos DB Cassandra view. */ +export interface CassandraViewCreateUpdateParameters + extends ARMResourceProperties { + /** The standard JSON format of a Cassandra view */ + resource: CassandraViewResource; + /** A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options?: CreateUpdateOptions; +} + /** The access keys for the given database account. */ export interface DatabaseAccountListKeysResult extends DatabaseAccountListReadOnlyKeysResult { @@ -3191,6 +3848,32 @@ export interface PartitionUsage extends Usage { readonly partitionKeyRangeId?: string; } +export interface GraphResourceGetPropertiesResource extends GraphResource {} + +export interface GraphResourceGetPropertiesOptions extends OptionsResource {} + +export interface SqlDatabaseGetPropertiesOptions extends OptionsResource {} + +export interface SqlContainerGetPropertiesOptions extends OptionsResource {} + +export interface MongoDBDatabaseGetPropertiesOptions extends OptionsResource {} + +export interface MongoDBCollectionGetPropertiesOptions + extends OptionsResource {} + +export interface TableGetPropertiesOptions extends OptionsResource {} + +export interface CassandraKeyspaceGetPropertiesOptions + extends OptionsResource {} + +export interface CassandraTableGetPropertiesOptions extends OptionsResource {} + +export interface GremlinDatabaseGetPropertiesOptions extends OptionsResource {} + +export interface GremlinGraphGetPropertiesOptions extends OptionsResource {} + +export interface CassandraViewGetPropertiesOptions extends OptionsResource {} + export interface SqlDatabaseGetPropertiesResource extends SqlDatabaseResource, ExtendedResourceProperties { @@ -3225,14 +3908,14 @@ export interface ThroughputSettingsGetPropertiesResource extends ThroughputSettingsResource, ExtendedResourceProperties {} -export interface SqlContainerGetPropertiesResource - extends SqlContainerResource, - ExtendedResourceProperties {} - export interface ClientEncryptionKeyGetPropertiesResource extends ClientEncryptionKeyResource, ExtendedResourceProperties {} +export interface SqlContainerGetPropertiesResource + extends SqlContainerResource, + ExtendedResourceProperties {} + export interface SqlStoredProcedureGetPropertiesResource extends SqlStoredProcedureResource, ExtendedResourceProperties {} @@ -3273,6 +3956,10 @@ export interface GremlinGraphGetPropertiesResource extends GremlinGraphResource, ExtendedResourceProperties {} +export interface CassandraViewGetPropertiesResource + extends CassandraViewResource, + ExtendedResourceProperties {} + /** Cosmos DB SQL container resource object */ export interface RestorableSqlContainerPropertiesResourceContainer extends SqlContainerResource, @@ -3284,26 +3971,6 @@ export interface RestorableSqlContainerPropertiesResourceContainer readonly self?: string; } -export interface SqlDatabaseGetPropertiesOptions extends OptionsResource {} - -export interface SqlContainerGetPropertiesOptions extends OptionsResource {} - -export interface MongoDBDatabaseGetPropertiesOptions extends OptionsResource {} - -export interface MongoDBCollectionGetPropertiesOptions - extends OptionsResource {} - -export interface TableGetPropertiesOptions extends OptionsResource {} - -export interface CassandraKeyspaceGetPropertiesOptions - extends OptionsResource {} - -export interface CassandraTableGetPropertiesOptions extends OptionsResource {} - -export interface GremlinDatabaseGetPropertiesOptions extends OptionsResource {} - -export interface GremlinGraphGetPropertiesOptions extends OptionsResource {} - /** Client Encryption Key. */ export interface ClientEncryptionKeyGetResults extends ARMProxyResource { resource?: ClientEncryptionKeyGetPropertiesResource; @@ -3315,6 +3982,59 @@ export interface LocationGetResult extends ARMProxyResource { properties?: LocationProperties; } +/** Parameters to create Data Transfer Job */ +export interface CreateJobRequest extends ARMProxyResource { + /** Data Transfer Create Job Properties */ + properties: DataTransferJobProperties; +} + +/** A Cosmos DB Data Transfer Job */ +export interface DataTransferJobGetResults extends ARMProxyResource { + /** + * Job Name + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly jobName?: string; + /** Source DataStore details */ + source?: DataTransferDataSourceSinkUnion; + /** Destination DataStore details */ + destination?: DataTransferDataSourceSinkUnion; + /** + * Job Status + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: string; + /** + * 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 totalCount?: number; + /** + * Last Updated Time (ISO-8601 format). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastUpdatedUtcTime?: Date; + /** Worker count */ + workerCount?: number; + /** + * Error response for Faulted job + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly error?: ErrorResponse; + /** + * Total Duration of Job + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly duration?: string; + /** Mode of job execution */ + mode?: DataTransferJobMode; +} + /** A managed Cassandra data center. */ export interface DataCenterResource extends ARMProxyResource { /** Properties of a managed Cassandra data center. */ @@ -3416,6 +4136,42 @@ export interface ServiceResource extends ARMProxyResource { properties?: ServiceResourcePropertiesUnion; } +/** properties of physical partition throughput info */ +export interface PhysicalPartitionThroughputInfoResultPropertiesResource + extends PhysicalPartitionThroughputInfoProperties {} + +/** A base CosmosDB data source/sink */ +export interface BaseCosmosDataTransferDataSourceSink + extends DataTransferDataSourceSink { + /** Polymorphic discriminator, which specifies the different types this object can be */ + component: + | "BaseCosmosDataTransferDataSourceSink" + | "CosmosDBCassandra" + | "CosmosDBMongo" + | "CosmosDBSql"; + remoteAccountName?: string; +} + +/** A CosmosDB Mongo vCore API data source/sink */ +export interface CosmosMongoVCoreDataTransferDataSourceSink + extends DataTransferDataSourceSink { + /** Polymorphic discriminator, which specifies the different types this object can be */ + component: "CosmosDBMongoVCore"; + databaseName: string; + collectionName: string; + hostName?: string; + connectionStringKeyVaultUri?: string; +} + +/** An Azure Blob Storage data source/sink */ +export interface AzureBlobDataTransferDataSourceSink + extends DataTransferDataSourceSink { + /** Polymorphic discriminator, which specifies the different types this object can be */ + component: "AzureBlobStorage"; + containerName: string; + endpointUrl?: string; +} + /** Representation of a managed Cassandra cluster. */ export interface ClusterResource extends ManagedCassandraARMResourceProperties { /** Properties of a managed Cassandra cluster. */ @@ -3534,6 +4290,23 @@ export interface GraphAPIComputeRegionalServiceResource export interface MaterializedViewsBuilderRegionalServiceResource extends RegionalServiceResource {} +/** A request object to enable/disable the chaos fault */ +export interface ChaosFaultResource extends ProxyResource { + /** Indicates whether what action to take for the Chaos Fault. */ + action?: SupportedActions; + /** Region of the account where the Chaos Fault is to be enabled/disabled. */ + region?: string; + /** Database name. */ + databaseName?: string; + /** Container name. */ + containerName?: string; + /** + * A provisioning state of the Chaos Fault. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + /** A private endpoint connection */ export interface PrivateEndpointConnection extends ProxyResource { /** Private endpoint which the connection belongs to. */ @@ -3546,6 +4319,91 @@ export interface PrivateEndpointConnection extends ProxyResource { provisioningState?: string; } +/** Network security perimeter (NSP) configuration resource */ +export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { + /** Network security configuration properties. */ + properties?: NetworkSecurityPerimeterConfigurationProperties; +} + +/** An Azure Cosmos DB Throughputpool Account */ +export interface ThroughputPoolAccountResource extends ProxyResource { + /** A provisioning state of the ThroughputPool Account. */ + provisioningState?: Status; + /** The resource identifier of global database account in the throughputPool. */ + accountResourceIdentifier?: string; + /** The location of global database account in the throughputPool. */ + accountLocation?: string; + /** + * The instance id of global database account in the throughputPool. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountInstanceId?: string; +} + +/** Parameters to create and update an Azure Cosmos DB Table Role Definition. */ +export interface TableRoleDefinitionResource extends ProxyResource { + /** The path id for the Role Definition. */ + idPropertiesId?: string; + /** A user-friendly name for the Role Definition. Must be unique for the database account. */ + roleName?: string; + /** Indicates whether the Role Definition was built-in or user created. */ + typePropertiesType?: RoleDefinitionType; + /** A set of fully qualified Scopes at or below which Table Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. */ + assignableScopes?: string[]; + /** The set of operations allowed through this Role Definition. */ + permissions?: PermissionAutoGenerated[]; +} + +/** Parameters to create and update an Azure Cosmos DB Table Role Assignment. */ +export interface TableRoleAssignmentResource extends ProxyResource { + /** The unique identifier for the associated Role Definition. */ + roleDefinitionId?: string; + /** The data plane resource path for which access is being granted through this Table Role Assignment. */ + scope?: string; + /** The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Table Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. */ + principalId?: string; + /** + * Provisioning state of the resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; +} + +/** An Azure Cosmos DB Throughputpool. */ +export interface ThroughputPoolResource extends TrackedResource { + /** A provisioning state of the ThroughputPool. */ + provisioningState?: Status; + /** Value for throughput to be shared among CosmosDB resources in the pool. */ + maxThroughput?: number; +} + +/** A CosmosDB Cassandra API data source/sink */ +export interface CosmosCassandraDataTransferDataSourceSink + extends BaseCosmosDataTransferDataSourceSink { + /** Polymorphic discriminator, which specifies the different types this object can be */ + component: "CosmosDBCassandra"; + keyspaceName: string; + tableName: string; +} + +/** A CosmosDB Mongo API data source/sink */ +export interface CosmosMongoDataTransferDataSourceSink + extends BaseCosmosDataTransferDataSourceSink { + /** Polymorphic discriminator, which specifies the different types this object can be */ + component: "CosmosDBMongo"; + databaseName: string; + collectionName: string; +} + +/** A CosmosDB No Sql API data source/sink */ +export interface CosmosSqlDataTransferDataSourceSink + extends BaseCosmosDataTransferDataSourceSink { + /** Polymorphic discriminator, which specifies the different types this object can be */ + component: "CosmosDBSql"; + databaseName: string; + containerName: string; +} + /** Defines headers for DatabaseAccounts_delete operation. */ export interface DatabaseAccountsDeleteHeaders { /** URI to poll for completion status. */ @@ -3586,6 +4444,22 @@ export interface DatabaseAccountsRegenerateKeyHeaders { location?: string; } +/** Defines headers for GraphResources_createUpdateGraph operation. */ +export interface GraphResourcesCreateUpdateGraphHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for GraphResources_deleteGraphResource operation. */ +export interface GraphResourcesDeleteGraphResourceHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + /** Defines headers for SqlResources_createUpdateSqlDatabase operation. */ export interface SqlResourcesCreateUpdateSqlDatabaseHeaders { /** URI to poll for completion status. */ @@ -3626,6 +4500,14 @@ export interface SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders { location?: string; } +/** Defines headers for SqlResources_createUpdateClientEncryptionKey operation. */ +export interface SqlResourcesCreateUpdateClientEncryptionKeyHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + /** Defines headers for SqlResources_createUpdateSqlContainer operation. */ export interface SqlResourcesCreateUpdateSqlContainerHeaders { /** URI to poll for completion status. */ @@ -3642,6 +4524,22 @@ export interface SqlResourcesDeleteSqlContainerHeaders { location?: string; } +/** Defines headers for SqlResources_sqlDatabasePartitionMerge operation. */ +export interface SqlResourcesSqlDatabasePartitionMergeHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for SqlResources_listSqlContainerPartitionMerge operation. */ +export interface SqlResourcesListSqlContainerPartitionMergeHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + /** Defines headers for SqlResources_updateSqlContainerThroughput operation. */ export interface SqlResourcesUpdateSqlContainerThroughputHeaders { /** URI to poll for completion status. */ @@ -3666,8 +4564,32 @@ export interface SqlResourcesMigrateSqlContainerToManualThroughputHeaders { location?: string; } -/** Defines headers for SqlResources_createUpdateClientEncryptionKey operation. */ -export interface SqlResourcesCreateUpdateClientEncryptionKeyHeaders { +/** Defines headers for SqlResources_sqlDatabaseRetrieveThroughputDistribution operation. */ +export interface SqlResourcesSqlDatabaseRetrieveThroughputDistributionHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for SqlResources_sqlDatabaseRedistributeThroughput operation. */ +export interface SqlResourcesSqlDatabaseRedistributeThroughputHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for SqlResources_sqlContainerRetrieveThroughputDistribution operation. */ +export interface SqlResourcesSqlContainerRetrieveThroughputDistributionHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for SqlResources_sqlContainerRedistributeThroughput operation. */ +export interface SqlResourcesSqlContainerRedistributeThroughputHeaders { /** URI to poll for completion status. */ azureAsyncOperation?: string; /** URI to poll for completion status. */ @@ -3762,6 +4684,38 @@ export interface MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputHeaders location?: string; } +/** Defines headers for MongoDBResources_mongoDBDatabaseRetrieveThroughputDistribution operation. */ +export interface MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for MongoDBResources_mongoDBDatabaseRedistributeThroughput operation. */ +export interface MongoDBResourcesMongoDBDatabaseRedistributeThroughputHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for MongoDBResources_mongoDBContainerRetrieveThroughputDistribution operation. */ +export interface MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for MongoDBResources_mongoDBContainerRedistributeThroughput operation. */ +export interface MongoDBResourcesMongoDBContainerRedistributeThroughputHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + /** Defines headers for MongoDBResources_createUpdateMongoDBCollection operation. */ export interface MongoDBResourcesCreateUpdateMongoDBCollectionHeaders { /** URI to poll for completion status. */ @@ -3778,6 +4732,22 @@ export interface MongoDBResourcesDeleteMongoDBCollectionHeaders { location?: string; } +/** Defines headers for MongoDBResources_mongoDBDatabasePartitionMerge operation. */ +export interface MongoDBResourcesMongoDBDatabasePartitionMergeHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for MongoDBResources_listMongoDBCollectionPartitionMerge operation. */ +export interface MongoDBResourcesListMongoDBCollectionPartitionMergeHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + /** Defines headers for MongoDBResources_updateMongoDBCollectionThroughput operation. */ export interface MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders { /** URI to poll for completion status. */ @@ -3842,6 +4812,38 @@ export interface TableResourcesMigrateTableToManualThroughputHeaders { location?: string; } +/** Defines headers for TableResources_createUpdateTableRoleDefinition operation. */ +export interface TableResourcesCreateUpdateTableRoleDefinitionHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for TableResources_deleteTableRoleDefinition operation. */ +export interface TableResourcesDeleteTableRoleDefinitionHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for TableResources_createUpdateTableRoleAssignment operation. */ +export interface TableResourcesCreateUpdateTableRoleAssignmentHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for TableResources_deleteTableRoleAssignment operation. */ +export interface TableResourcesDeleteTableRoleAssignmentHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + /** Defines headers for CassandraResources_createUpdateCassandraKeyspace operation. */ export interface CassandraResourcesCreateUpdateCassandraKeyspaceHeaders { /** URI to poll for completion status. */ @@ -3882,40 +4884,80 @@ export interface CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHea location?: string; } -/** Defines headers for CassandraResources_createUpdateCassandraTable operation. */ -export interface CassandraResourcesCreateUpdateCassandraTableHeaders { +/** Defines headers for CassandraResources_createUpdateCassandraTable operation. */ +export interface CassandraResourcesCreateUpdateCassandraTableHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for CassandraResources_deleteCassandraTable operation. */ +export interface CassandraResourcesDeleteCassandraTableHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for CassandraResources_updateCassandraTableThroughput operation. */ +export interface CassandraResourcesUpdateCassandraTableThroughputHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for CassandraResources_migrateCassandraTableToAutoscale operation. */ +export interface CassandraResourcesMigrateCassandraTableToAutoscaleHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for CassandraResources_migrateCassandraTableToManualThroughput operation. */ +export interface CassandraResourcesMigrateCassandraTableToManualThroughputHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for CassandraResources_createUpdateCassandraView operation. */ +export interface CassandraResourcesCreateUpdateCassandraViewHeaders { /** URI to poll for completion status. */ azureAsyncOperation?: string; /** URI to poll for completion status. */ location?: string; } -/** Defines headers for CassandraResources_deleteCassandraTable operation. */ -export interface CassandraResourcesDeleteCassandraTableHeaders { +/** Defines headers for CassandraResources_deleteCassandraView operation. */ +export interface CassandraResourcesDeleteCassandraViewHeaders { /** URI to poll for completion status. */ azureAsyncOperation?: string; /** URI to poll for completion status. */ location?: string; } -/** Defines headers for CassandraResources_updateCassandraTableThroughput operation. */ -export interface CassandraResourcesUpdateCassandraTableThroughputHeaders { +/** Defines headers for CassandraResources_updateCassandraViewThroughput operation. */ +export interface CassandraResourcesUpdateCassandraViewThroughputHeaders { /** URI to poll for completion status. */ azureAsyncOperation?: string; /** URI to poll for completion status. */ location?: string; } -/** Defines headers for CassandraResources_migrateCassandraTableToAutoscale operation. */ -export interface CassandraResourcesMigrateCassandraTableToAutoscaleHeaders { +/** Defines headers for CassandraResources_migrateCassandraViewToAutoscale operation. */ +export interface CassandraResourcesMigrateCassandraViewToAutoscaleHeaders { /** URI to poll for completion status. */ azureAsyncOperation?: string; /** URI to poll for completion status. */ location?: string; } -/** Defines headers for CassandraResources_migrateCassandraTableToManualThroughput operation. */ -export interface CassandraResourcesMigrateCassandraTableToManualThroughputHeaders { +/** Defines headers for CassandraResources_migrateCassandraViewToManualThroughput operation. */ +export interface CassandraResourcesMigrateCassandraViewToManualThroughputHeaders { /** URI to poll for completion status. */ azureAsyncOperation?: string; /** URI to poll for completion status. */ @@ -4002,14 +5044,19 @@ export interface GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders { location?: string; } -/** Defines headers for Service_create operation. */ -export interface ServiceCreateHeaders { +/** Defines headers for CassandraClusters_invokeCommandAsync operation. */ +export interface CassandraClustersInvokeCommandAsyncHeaders { /** URI to poll for completion status. */ azureAsyncOperation?: string; /** URI to poll for completion status. */ location?: string; } +/** Defines headers for NetworkSecurityPerimeterConfigurations_reconcile operation. */ +export interface NetworkSecurityPerimeterConfigurationsReconcileHeaders { + location?: string; +} + /** Defines headers for Service_delete operation. */ export interface ServiceDeleteHeaders { /** URI to poll for completion status. */ @@ -4018,6 +5065,54 @@ export interface ServiceDeleteHeaders { location?: string; } +/** Defines headers for ThroughputPool_update operation. */ +export interface ThroughputPoolUpdateHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for ThroughputPool_delete operation. */ +export interface ThroughputPoolDeleteHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Defines headers for ThroughputPoolAccount_delete operation. */ +export interface ThroughputPoolAccountDeleteHeaders { + /** URI to poll for completion status. */ + azureAsyncOperation?: string; + /** URI to poll for completion status. */ + location?: string; +} + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + /** Known values of {@link DatabaseAccountKind} that the service accepts. */ export enum KnownDatabaseAccountKind { /** GlobalDocumentDB */ @@ -4201,6 +5296,54 @@ export enum KnownBackupPolicyMigrationStatus { */ export type BackupPolicyMigrationStatus = string; +/** Known values of {@link CapacityMode} that the service accepts. */ +export enum KnownCapacityMode { + /** None */ + None = "None", + /** Provisioned */ + Provisioned = "Provisioned", + /** Serverless */ + Serverless = "Serverless", +} + +/** + * Defines values for CapacityMode. \ + * {@link KnownCapacityMode} can be used interchangeably with CapacityMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **Provisioned** \ + * **Serverless** + */ +export type CapacityMode = string; + +/** Known values of {@link CapacityModeTransitionStatus} that the service accepts. */ +export enum KnownCapacityModeTransitionStatus { + /** Invalid */ + Invalid = "Invalid", + /** Initialized */ + Initialized = "Initialized", + /** InProgress */ + InProgress = "InProgress", + /** Completed */ + Completed = "Completed", + /** Failed */ + Failed = "Failed", +} + +/** + * Defines values for CapacityModeTransitionStatus. \ + * {@link KnownCapacityModeTransitionStatus} can be used interchangeably with CapacityModeTransitionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **Initialized** \ + * **InProgress** \ + * **Completed** \ + * **Failed** + */ +export type CapacityModeTransitionStatus = string; + /** Known values of {@link MinimalTlsVersion} that the service accepts. */ export enum KnownMinimalTlsVersion { /** Tls */ @@ -4222,29 +5365,23 @@ export enum KnownMinimalTlsVersion { */ export type MinimalTlsVersion = string; -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key", +/** Known values of {@link DefaultPriorityLevel} that the service accepts. */ +export enum KnownDefaultPriorityLevel { + /** High */ + High = "High", + /** Low */ + Low = "Low", } /** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * Defines values for DefaultPriorityLevel. \ + * {@link KnownDefaultPriorityLevel} can be used interchangeably with DefaultPriorityLevel, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** + * **High** \ + * **Low** */ -export type CreatedByType = string; +export type DefaultPriorityLevel = string; /** Known values of {@link Kind} that the service accepts. */ export enum KnownKind { @@ -4612,6 +5749,27 @@ export enum KnownDistanceFunction { */ export type DistanceFunction = string; +/** Known values of {@link ThroughputPolicyType} that the service accepts. */ +export enum KnownThroughputPolicyType { + /** None */ + None = "none", + /** Equal */ + Equal = "equal", + /** Custom */ + 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 */ @@ -4690,6 +5848,14 @@ export enum KnownStatus { Online = "Online", /** Deleting */ Deleting = "Deleting", + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Updating */ + Updating = "Updating", } /** @@ -4701,10 +5867,59 @@ export enum KnownStatus { * **Initializing** \ * **InternallyReady** \ * **Online** \ - * **Deleting** + * **Deleting** \ + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Updating** */ export type Status = string; +/** Known values of {@link DataTransferComponent} that the service accepts. */ +export enum KnownDataTransferComponent { + /** CosmosDBCassandra */ + CosmosDBCassandra = "CosmosDBCassandra", + /** CosmosDBMongo */ + CosmosDBMongo = "CosmosDBMongo", + /** CosmosDBMongoVCore */ + CosmosDBMongoVCore = "CosmosDBMongoVCore", + /** CosmosDBSql */ + CosmosDBSql = "CosmosDBSql", + /** AzureBlobStorage */ + AzureBlobStorage = "AzureBlobStorage", +} + +/** + * Defines values for DataTransferComponent. \ + * {@link KnownDataTransferComponent} can be used interchangeably with DataTransferComponent, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **CosmosDBCassandra** \ + * **CosmosDBMongo** \ + * **CosmosDBMongoVCore** \ + * **CosmosDBSql** \ + * **AzureBlobStorage** + */ +export type DataTransferComponent = string; + +/** Known values of {@link DataTransferJobMode} that the service accepts. */ +export enum KnownDataTransferJobMode { + /** Offline */ + Offline = "Offline", + /** Online */ + Online = "Online", +} + +/** + * Defines values for DataTransferJobMode. \ + * {@link KnownDataTransferJobMode} can be used interchangeably with DataTransferJobMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Offline** \ + * **Online** + */ +export type DataTransferJobMode = string; + /** Known values of {@link ManagedCassandraProvisioningState} that the service accepts. */ export enum KnownManagedCassandraProvisioningState { /** Creating */ @@ -4756,6 +5971,66 @@ export enum KnownAuthenticationMethod { */ export type AuthenticationMethod = string; +/** Known values of {@link AutoReplicate} that the service accepts. */ +export enum KnownAutoReplicate { + /** None */ + None = "None", + /** SystemKeyspaces */ + SystemKeyspaces = "SystemKeyspaces", + /** AllKeyspaces */ + AllKeyspaces = "AllKeyspaces", +} + +/** + * Defines values for AutoReplicate. \ + * {@link KnownAutoReplicate} can be used interchangeably with AutoReplicate, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemKeyspaces** \ + * **AllKeyspaces** + */ +export type AutoReplicate = string; + +/** Known values of {@link ClusterType} that the service accepts. */ +export enum KnownClusterType { + /** Production */ + Production = "Production", + /** NonProduction */ + NonProduction = "NonProduction", +} + +/** + * Defines values for ClusterType. \ + * {@link KnownClusterType} can be used interchangeably with ClusterType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Production** \ + * **NonProduction** + */ +export type ClusterType = string; + +/** Known values of {@link ScheduledEventStrategy} that the service accepts. */ +export enum KnownScheduledEventStrategy { + /** Ignore */ + Ignore = "Ignore", + /** StopAny */ + StopAny = "StopAny", + /** StopByRack */ + StopByRack = "StopByRack", +} + +/** + * Defines values for ScheduledEventStrategy. \ + * {@link KnownScheduledEventStrategy} can be used interchangeably with ScheduledEventStrategy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Ignore** \ + * **StopAny** \ + * **StopByRack** + */ +export type ScheduledEventStrategy = string; + /** Known values of {@link AzureConnectionType} that the service accepts. */ export enum KnownAzureConnectionType { /** None */ @@ -4792,6 +6067,60 @@ export enum KnownManagedCassandraResourceIdentityType { */ export type ManagedCassandraResourceIdentityType = string; +/** Known values of {@link CommandStatus} that the service accepts. */ +export enum KnownCommandStatus { + /** Done */ + Done = "Done", + /** Running */ + Running = "Running", + /** Enqueue */ + Enqueue = "Enqueue", + /** Processing */ + Processing = "Processing", + /** Finished */ + Finished = "Finished", + /** Failed */ + Failed = "Failed", +} + +/** + * Defines values for CommandStatus. \ + * {@link KnownCommandStatus} can be used interchangeably with CommandStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Done** \ + * **Running** \ + * **Enqueue** \ + * **Processing** \ + * **Finished** \ + * **Failed** + */ +export type CommandStatus = string; + +/** Known values of {@link BackupState} that the service accepts. */ +export enum KnownBackupState { + /** Initiated */ + Initiated = "Initiated", + /** InProgress */ + InProgress = "InProgress", + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", +} + +/** + * Defines values for BackupState. \ + * {@link KnownBackupState} can be used interchangeably with BackupState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Initiated** \ + * **InProgress** \ + * **Succeeded** \ + * **Failed** + */ +export type BackupState = string; + /** Known values of {@link ConnectionState} that the service accepts. */ export enum KnownConnectionState { /** Unknown */ @@ -4837,17 +6166,131 @@ export enum KnownNodeState { } /** - * Defines values for NodeState. \ - * {@link KnownNodeState} can be used interchangeably with NodeState, + * Defines values for NodeState. \ + * {@link KnownNodeState} can be used interchangeably with NodeState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Normal** \ + * **Leaving** \ + * **Joining** \ + * **Moving** \ + * **Stopped** + */ +export type NodeState = string; + +/** Known values of {@link NetworkSecurityPerimeterConfigurationProvisioningState} that the service accepts. */ +export enum KnownNetworkSecurityPerimeterConfigurationProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting", + /** Accepted */ + Accepted = "Accepted", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", +} + +/** + * Defines values for NetworkSecurityPerimeterConfigurationProvisioningState. \ + * {@link KnownNetworkSecurityPerimeterConfigurationProvisioningState} can be used interchangeably with NetworkSecurityPerimeterConfigurationProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Accepted** \ + * **Failed** \ + * **Canceled** + */ +export type NetworkSecurityPerimeterConfigurationProvisioningState = string; + +/** Known values of {@link IssueType} that the service accepts. */ +export enum KnownIssueType { + /** Unknown issue type */ + Unknown = "Unknown", + /** An error occurred while applying the network security perimeter (NSP) configuration. */ + ConfigurationPropagationFailure = "ConfigurationPropagationFailure", + /** A network connectivity issue is happening on the resource which could be addressed either by adding new resources to the network security perimeter (NSP) or by modifying access rules. */ + MissingPerimeterConfiguration = "MissingPerimeterConfiguration", + /** An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to perform outbound access as a member of the NSP. */ + MissingIdentityConfiguration = "MissingIdentityConfiguration", +} + +/** + * Defines values for IssueType. \ + * {@link KnownIssueType} can be used interchangeably with IssueType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown**: Unknown issue type \ + * **ConfigurationPropagationFailure**: An error occurred while applying the network security perimeter (NSP) configuration. \ + * **MissingPerimeterConfiguration**: A network connectivity issue is happening on the resource which could be addressed either by adding new resources to the network security perimeter (NSP) or by modifying access rules. \ + * **MissingIdentityConfiguration**: An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to perform outbound access as a member of the NSP. + */ +export type IssueType = string; + +/** Known values of {@link Severity} that the service accepts. */ +export enum KnownSeverity { + /** Warning */ + Warning = "Warning", + /** Error */ + Error = "Error", +} + +/** + * Defines values for Severity. \ + * {@link KnownSeverity} can be used interchangeably with Severity, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Warning** \ + * **Error** + */ +export type Severity = string; + +/** Known values of {@link AccessRuleDirection} that the service accepts. */ +export enum KnownAccessRuleDirection { + /** Applies to inbound network traffic to the secured resources. */ + Inbound = "Inbound", + /** Applies to outbound network traffic from the secured resources */ + Outbound = "Outbound", +} + +/** + * Defines values for AccessRuleDirection. \ + * {@link KnownAccessRuleDirection} can be used interchangeably with AccessRuleDirection, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Inbound**: Applies to inbound network traffic to the secured resources. \ + * **Outbound**: Applies to outbound network traffic from the secured resources + */ +export type AccessRuleDirection = string; + +/** Known values of {@link ResourceAssociationAccessMode} that the service accepts. */ +export enum KnownResourceAssociationAccessMode { + /** Enforced access mode - traffic to the resource that failed access checks is blocked */ + Enforced = "Enforced", + /** Learning access mode - traffic to the resource is enabled for analysis but not blocked */ + Learning = "Learning", + /** Audit access mode - traffic to the resource that fails access checks is logged but not blocked */ + Audit = "Audit", +} + +/** + * Defines values for ResourceAssociationAccessMode. \ + * {@link KnownResourceAssociationAccessMode} can be used interchangeably with ResourceAssociationAccessMode, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Normal** \ - * **Leaving** \ - * **Joining** \ - * **Moving** \ - * **Stopped** + * **Enforced**: Enforced access mode - traffic to the resource that failed access checks is blocked \ + * **Learning**: Learning access mode - traffic to the resource is enabled for analysis but not blocked \ + * **Audit**: Audit access mode - traffic to the resource that fails access checks is logged but not blocked */ -export type NodeState = string; +export type ResourceAssociationAccessMode = string; /** Known values of {@link NotebookWorkspaceName} that the service accepts. */ export enum KnownNotebookWorkspaceName { @@ -5049,12 +6492,8 @@ export enum KnownNodeStatus { * **Down** */ export type NodeStatus = string; -/** Defines values for ResourceIdentityType. */ -export type ResourceIdentityType = - | "SystemAssigned" - | "UserAssigned" - | "SystemAssigned,UserAssigned" - | "None"; +/** Defines values for SupportedActions. */ +export type SupportedActions = "Enable" | "Disable"; /** Defines values for DefaultConsistencyLevel. */ export type DefaultConsistencyLevel = | "Eventual" @@ -5064,11 +6503,52 @@ export type DefaultConsistencyLevel = | "ConsistentPrefix"; /** Defines values for NetworkAclBypass. */ export type NetworkAclBypass = "None" | "AzureServices"; +/** Defines values for EnableFullTextQuery. */ +export type EnableFullTextQuery = "None" | "True" | "False"; +/** Defines values for ResourceIdentityType. */ +export type ResourceIdentityType = + | "SystemAssigned" + | "UserAssigned" + | "SystemAssigned,UserAssigned" + | "None"; /** Defines values for MongoRoleDefinitionType. */ export type MongoRoleDefinitionType = "BuiltInRole" | "CustomRole"; /** Defines values for RoleDefinitionType. */ export type RoleDefinitionType = "BuiltInRole" | "CustomRole"; +/** Optional parameters. */ +export interface ChaosFaultListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ChaosFaultListOperationResponse = ChaosFaultListResponse; + +/** Optional parameters. */ +export interface ChaosFaultEnableDisableOptionalParams + 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 enableDisable operation. */ +export type ChaosFaultEnableDisableResponse = ChaosFaultResource; + +/** Optional parameters. */ +export interface ChaosFaultGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ChaosFaultGetResponse = ChaosFaultResource; + +/** Optional parameters. */ +export interface ChaosFaultListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ChaosFaultListNextResponse = ChaosFaultListResponse; + /** Optional parameters. */ export interface DatabaseAccountsGetOptionalParams extends coreClient.OperationOptions {} @@ -5371,6 +6851,41 @@ export interface PartitionKeyRangeIdRegionListMetricsOptionalParams export type PartitionKeyRangeIdRegionListMetricsResponse = PartitionMetricListResult; +/** Optional parameters. */ +export interface GraphResourcesListGraphsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listGraphs operation. */ +export type GraphResourcesListGraphsResponse = GraphResourcesListResult; + +/** Optional parameters. */ +export interface GraphResourcesGetGraphOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getGraph operation. */ +export type GraphResourcesGetGraphResponse = GraphResourceGetResults; + +/** Optional parameters. */ +export interface GraphResourcesCreateUpdateGraphOptionalParams + 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 createUpdateGraph operation. */ +export type GraphResourcesCreateUpdateGraphResponse = GraphResourceGetResults; + +/** Optional parameters. */ +export interface GraphResourcesDeleteGraphResourceOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + /** Optional parameters. */ export interface SqlResourcesListSqlDatabasesOptionalParams extends coreClient.OperationOptions {} @@ -5457,6 +6972,35 @@ export interface SqlResourcesMigrateSqlDatabaseToManualThroughputOptionalParams export type SqlResourcesMigrateSqlDatabaseToManualThroughputResponse = ThroughputSettingsGetResults; +/** Optional parameters. */ +export interface SqlResourcesListClientEncryptionKeysOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listClientEncryptionKeys operation. */ +export type SqlResourcesListClientEncryptionKeysResponse = + ClientEncryptionKeysListResult; + +/** Optional parameters. */ +export interface SqlResourcesGetClientEncryptionKeyOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getClientEncryptionKey operation. */ +export type SqlResourcesGetClientEncryptionKeyResponse = + ClientEncryptionKeyGetResults; + +/** Optional parameters. */ +export interface SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams + 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 createUpdateClientEncryptionKey operation. */ +export type SqlResourcesCreateUpdateClientEncryptionKeyResponse = + ClientEncryptionKeyGetResults; + /** Optional parameters. */ export interface SqlResourcesListSqlContainersOptionalParams extends coreClient.OperationOptions {} @@ -5497,6 +7041,32 @@ export interface SqlResourcesDeleteSqlContainerOptionalParams export type SqlResourcesDeleteSqlContainerResponse = SqlResourcesDeleteSqlContainerHeaders; +/** Optional parameters. */ +export interface SqlResourcesSqlDatabasePartitionMergeOptionalParams + 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 sqlDatabasePartitionMerge operation. */ +export type SqlResourcesSqlDatabasePartitionMergeResponse = + PhysicalPartitionStorageInfoCollection; + +/** 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 {} @@ -5545,23 +7115,33 @@ export type SqlResourcesMigrateSqlContainerToManualThroughputResponse = ThroughputSettingsGetResults; /** Optional parameters. */ -export interface SqlResourcesListClientEncryptionKeysOptionalParams - extends coreClient.OperationOptions {} +export interface SqlResourcesSqlDatabaseRetrieveThroughputDistributionOptionalParams + 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 listClientEncryptionKeys operation. */ -export type SqlResourcesListClientEncryptionKeysResponse = - ClientEncryptionKeysListResult; +/** Contains response data for the sqlDatabaseRetrieveThroughputDistribution operation. */ +export type SqlResourcesSqlDatabaseRetrieveThroughputDistributionResponse = + PhysicalPartitionThroughputInfoResult; /** Optional parameters. */ -export interface SqlResourcesGetClientEncryptionKeyOptionalParams - extends coreClient.OperationOptions {} +export interface SqlResourcesSqlDatabaseRedistributeThroughputOptionalParams + 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 getClientEncryptionKey operation. */ -export type SqlResourcesGetClientEncryptionKeyResponse = - ClientEncryptionKeyGetResults; +/** Contains response data for the sqlDatabaseRedistributeThroughput operation. */ +export type SqlResourcesSqlDatabaseRedistributeThroughputResponse = + PhysicalPartitionThroughputInfoResult; /** Optional parameters. */ -export interface SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams +export interface SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -5569,9 +7149,22 @@ export interface SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams resumeFrom?: string; } -/** Contains response data for the createUpdateClientEncryptionKey operation. */ -export type SqlResourcesCreateUpdateClientEncryptionKeyResponse = - ClientEncryptionKeyGetResults; +/** 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 @@ -5874,6 +7467,58 @@ export interface MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptiona export type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputResponse = ThroughputSettingsGetResults; +/** Optional parameters. */ +export interface MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionOptionalParams + 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 mongoDBDatabaseRetrieveThroughputDistribution operation. */ +export type MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionResponse = + PhysicalPartitionThroughputInfoResult; + +/** Optional parameters. */ +export interface MongoDBResourcesMongoDBDatabaseRedistributeThroughputOptionalParams + 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 mongoDBDatabaseRedistributeThroughput operation. */ +export type MongoDBResourcesMongoDBDatabaseRedistributeThroughputResponse = + PhysicalPartitionThroughputInfoResult; + +/** 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 {} @@ -5916,6 +7561,32 @@ export interface MongoDBResourcesDeleteMongoDBCollectionOptionalParams export type MongoDBResourcesDeleteMongoDBCollectionResponse = MongoDBResourcesDeleteMongoDBCollectionHeaders; +/** Optional parameters. */ +export interface MongoDBResourcesMongoDBDatabasePartitionMergeOptionalParams + 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 mongoDBDatabasePartitionMerge operation. */ +export type MongoDBResourcesMongoDBDatabasePartitionMergeResponse = + PhysicalPartitionStorageInfoCollection; + +/** 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 {} @@ -6113,7 +7784,67 @@ export type TableResourcesUpdateTableThroughputResponse = ThroughputSettingsGetResults; /** Optional parameters. */ -export interface TableResourcesMigrateTableToAutoscaleOptionalParams +export interface TableResourcesMigrateTableToAutoscaleOptionalParams + 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 migrateTableToAutoscale operation. */ +export type TableResourcesMigrateTableToAutoscaleResponse = + ThroughputSettingsGetResults; + +/** Optional parameters. */ +export interface TableResourcesMigrateTableToManualThroughputOptionalParams + 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 migrateTableToManualThroughput operation. */ +export type TableResourcesMigrateTableToManualThroughputResponse = + ThroughputSettingsGetResults; + +/** Optional parameters. */ +export interface TableResourcesRetrieveContinuousBackupInformationOptionalParams + 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 retrieveContinuousBackupInformation operation. */ +export type TableResourcesRetrieveContinuousBackupInformationResponse = + BackupInformation; + +/** Optional parameters. */ +export interface TableResourcesGetTableRoleDefinitionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getTableRoleDefinition operation. */ +export type TableResourcesGetTableRoleDefinitionResponse = + TableRoleDefinitionResource; + +/** Optional parameters. */ +export interface TableResourcesCreateUpdateTableRoleDefinitionOptionalParams + 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 createUpdateTableRoleDefinition operation. */ +export type TableResourcesCreateUpdateTableRoleDefinitionResponse = + TableRoleDefinitionResource; + +/** Optional parameters. */ +export interface TableResourcesDeleteTableRoleDefinitionOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -6121,12 +7852,24 @@ export interface TableResourcesMigrateTableToAutoscaleOptionalParams resumeFrom?: string; } -/** Contains response data for the migrateTableToAutoscale operation. */ -export type TableResourcesMigrateTableToAutoscaleResponse = - ThroughputSettingsGetResults; +/** Optional parameters. */ +export interface TableResourcesListTableRoleDefinitionsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listTableRoleDefinitions operation. */ +export type TableResourcesListTableRoleDefinitionsResponse = + TableRoleDefinitionListResult; /** Optional parameters. */ -export interface TableResourcesMigrateTableToManualThroughputOptionalParams +export interface TableResourcesGetTableRoleAssignmentOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getTableRoleAssignment operation. */ +export type TableResourcesGetTableRoleAssignmentResponse = + TableRoleAssignmentResource; + +/** Optional parameters. */ +export interface TableResourcesCreateUpdateTableRoleAssignmentOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -6134,12 +7877,12 @@ export interface TableResourcesMigrateTableToManualThroughputOptionalParams resumeFrom?: string; } -/** Contains response data for the migrateTableToManualThroughput operation. */ -export type TableResourcesMigrateTableToManualThroughputResponse = - ThroughputSettingsGetResults; +/** Contains response data for the createUpdateTableRoleAssignment operation. */ +export type TableResourcesCreateUpdateTableRoleAssignmentResponse = + TableRoleAssignmentResource; /** Optional parameters. */ -export interface TableResourcesRetrieveContinuousBackupInformationOptionalParams +export interface TableResourcesDeleteTableRoleAssignmentOptionalParams extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; @@ -6147,9 +7890,13 @@ export interface TableResourcesRetrieveContinuousBackupInformationOptionalParams resumeFrom?: string; } -/** Contains response data for the retrieveContinuousBackupInformation operation. */ -export type TableResourcesRetrieveContinuousBackupInformationResponse = - BackupInformation; +/** Optional parameters. */ +export interface TableResourcesListTableRoleAssignmentsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listTableRoleAssignments operation. */ +export type TableResourcesListTableRoleAssignmentsResponse = + TableRoleAssignmentListResult; /** Optional parameters. */ export interface CassandraResourcesListCassandraKeyspacesOptionalParams @@ -6329,6 +8076,91 @@ export interface CassandraResourcesMigrateCassandraTableToManualThroughputOption export type CassandraResourcesMigrateCassandraTableToManualThroughputResponse = ThroughputSettingsGetResults; +/** Optional parameters. */ +export interface CassandraResourcesListCassandraViewsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listCassandraViews operation. */ +export type CassandraResourcesListCassandraViewsResponse = + CassandraViewListResult; + +/** Optional parameters. */ +export interface CassandraResourcesGetCassandraViewOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getCassandraView operation. */ +export type CassandraResourcesGetCassandraViewResponse = + CassandraViewGetResults; + +/** Optional parameters. */ +export interface CassandraResourcesCreateUpdateCassandraViewOptionalParams + 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 createUpdateCassandraView operation. */ +export type CassandraResourcesCreateUpdateCassandraViewResponse = + CassandraViewGetResults; + +/** Optional parameters. */ +export interface CassandraResourcesDeleteCassandraViewOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface CassandraResourcesGetCassandraViewThroughputOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getCassandraViewThroughput operation. */ +export type CassandraResourcesGetCassandraViewThroughputResponse = + ThroughputSettingsGetResults; + +/** Optional parameters. */ +export interface CassandraResourcesUpdateCassandraViewThroughputOptionalParams + 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 updateCassandraViewThroughput operation. */ +export type CassandraResourcesUpdateCassandraViewThroughputResponse = + ThroughputSettingsGetResults; + +/** Optional parameters. */ +export interface CassandraResourcesMigrateCassandraViewToAutoscaleOptionalParams + 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 migrateCassandraViewToAutoscale operation. */ +export type CassandraResourcesMigrateCassandraViewToAutoscaleResponse = + ThroughputSettingsGetResults; + +/** Optional parameters. */ +export interface CassandraResourcesMigrateCassandraViewToManualThroughputOptionalParams + 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 migrateCassandraViewToManualThroughput operation. */ +export type CassandraResourcesMigrateCassandraViewToManualThroughputResponse = + ThroughputSettingsGetResults; + /** Optional parameters. */ export interface GremlinResourcesListGremlinDatabasesOptionalParams extends coreClient.OperationOptions {} @@ -6532,6 +8364,64 @@ export interface LocationsGetOptionalParams /** Contains response data for the get operation. */ export type LocationsGetResponse = LocationGetResult; +/** Optional parameters. */ +export interface DataTransferJobsCreateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the create operation. */ +export type DataTransferJobsCreateResponse = DataTransferJobGetResults; + +/** Optional parameters. */ +export interface DataTransferJobsGetOptionalParams + extends coreClient.OperationOptions {} + +/** 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 DataTransferJobsCompleteOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the complete operation. */ +export type DataTransferJobsCompleteResponse = DataTransferJobGetResults; + +/** Optional parameters. */ +export interface DataTransferJobsListByDatabaseAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByDatabaseAccount operation. */ +export type DataTransferJobsListByDatabaseAccountResponse = + DataTransferJobFeedResults; + +/** Optional parameters. */ +export interface DataTransferJobsListByDatabaseAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByDatabaseAccountNext operation. */ +export type DataTransferJobsListByDatabaseAccountNextResponse = + DataTransferJobFeedResults; + /** Optional parameters. */ export interface CassandraClustersListBySubscriptionOptionalParams extends coreClient.OperationOptions {} @@ -6598,9 +8488,51 @@ export interface CassandraClustersInvokeCommandOptionalParams /** Contains response data for the invokeCommand operation. */ export type CassandraClustersInvokeCommandResponse = CommandOutput; +/** Optional parameters. */ +export interface CassandraClustersInvokeCommandAsyncOptionalParams + 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 invokeCommandAsync operation. */ +export type CassandraClustersInvokeCommandAsyncResponse = CommandPublicResource; + +/** Optional parameters. */ +export interface CassandraClustersListCommandOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listCommand operation. */ +export type CassandraClustersListCommandResponse = ListCommands; + +/** Optional parameters. */ +export interface CassandraClustersGetCommandAsyncOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getCommandAsync operation. */ +export type CassandraClustersGetCommandAsyncResponse = CommandPublicResource; + +/** Optional parameters. */ +export interface CassandraClustersListBackupsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBackups operation. */ +export type CassandraClustersListBackupsResponse = ListBackups; + +/** Optional parameters. */ +export interface CassandraClustersGetBackupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getBackup operation. */ +export type CassandraClustersGetBackupResponse = BackupResource; + /** Optional parameters. */ export interface CassandraClustersDeallocateOptionalParams extends coreClient.OperationOptions { + /** Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of Cluster Type Production might cause data loss */ + xMsForceDeallocate?: string; /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -6670,6 +8602,43 @@ export interface CassandraDataCentersUpdateOptionalParams /** Contains response data for the update operation. */ export type CassandraDataCentersUpdateResponse = DataCenterResource; +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type NetworkSecurityPerimeterConfigurationsListResponse = + NetworkSecurityPerimeterConfigurationListResult; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type NetworkSecurityPerimeterConfigurationsGetResponse = + NetworkSecurityPerimeterConfiguration; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsReconcileOptionalParams + 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 reconcile operation. */ +export type NetworkSecurityPerimeterConfigurationsReconcileResponse = + NetworkSecurityPerimeterConfigurationsReconcileHeaders; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterConfigurationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type NetworkSecurityPerimeterConfigurationsListNextResponse = + NetworkSecurityPerimeterConfigurationListResult; + /** Optional parameters. */ export interface NotebookWorkspacesListByDatabaseAccountOptionalParams extends coreClient.OperationOptions {} @@ -6975,6 +8944,129 @@ export interface ServiceDeleteOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface ThroughputPoolsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ThroughputPoolsListResponse = ThroughputPoolsListResult; + +/** Optional parameters. */ +export interface ThroughputPoolsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ThroughputPoolsListByResourceGroupResponse = + ThroughputPoolsListResult; + +/** Optional parameters. */ +export interface ThroughputPoolsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ThroughputPoolsListNextResponse = ThroughputPoolsListResult; + +/** Optional parameters. */ +export interface ThroughputPoolsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ThroughputPoolsListByResourceGroupNextResponse = + ThroughputPoolsListResult; + +/** Optional parameters. */ +export interface ThroughputPoolGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ThroughputPoolGetResponse = ThroughputPoolResource; + +/** Optional parameters. */ +export interface ThroughputPoolCreateOrUpdateOptionalParams + 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 createOrUpdate operation. */ +export type ThroughputPoolCreateOrUpdateResponse = ThroughputPoolResource; + +/** Optional parameters. */ +export interface ThroughputPoolUpdateOptionalParams + extends coreClient.OperationOptions { + /** The parameters to provide for the current Throughput Pool. */ + body?: ThroughputPoolUpdate; + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type ThroughputPoolUpdateResponse = ThroughputPoolResource; + +/** Optional parameters. */ +export interface ThroughputPoolDeleteOptionalParams + 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 delete operation. */ +export type ThroughputPoolDeleteResponse = ThroughputPoolDeleteHeaders; + +/** Optional parameters. */ +export interface ThroughputPoolAccountsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ThroughputPoolAccountsListResponse = + ThroughputPoolAccountsListResult; + +/** Optional parameters. */ +export interface ThroughputPoolAccountsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ThroughputPoolAccountsListNextResponse = + ThroughputPoolAccountsListResult; + +/** Optional parameters. */ +export interface ThroughputPoolAccountGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ThroughputPoolAccountGetResponse = ThroughputPoolAccountResource; + +/** Optional parameters. */ +export interface ThroughputPoolAccountCreateOptionalParams + 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 create operation. */ +export type ThroughputPoolAccountCreateResponse = ThroughputPoolAccountResource; + +/** Optional parameters. */ +export interface ThroughputPoolAccountDeleteOptionalParams + 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 delete operation. */ +export type ThroughputPoolAccountDeleteResponse = + ThroughputPoolAccountDeleteHeaders; + /** Optional parameters. */ export interface CosmosDBManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts index 81db239e449a..43074b0cbe21 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts @@ -8,20 +8,49 @@ import * as coreClient from "@azure/core-client"; -export const ManagedServiceIdentity: coreClient.CompositeMapper = { +export const ChaosFaultListResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagedServiceIdentity", + className: "ChaosFaultListResponse", modelProperties: { - principalId: { - serializedName: "principalId", + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ChaosFaultResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", readOnly: true, type: { name: "String", }, }, - tenantId: { - serializedName: "tenantId", + }, + }, +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", readOnly: true, type: { name: "String", @@ -29,25 +58,131 @@ export const ManagedServiceIdentity: coreClient.CompositeMapper = { }, type: { serializedName: "type", + readOnly: true, type: { - name: "Enum", - allowedValues: [ - "SystemAssigned", - "UserAssigned", - "SystemAssigned,UserAssigned", - "None", - ], + name: "String", }, }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", + systemData: { + serializedName: "systemData", type: { - name: "Dictionary", - value: { + name: "Composite", + className: "SystemData", + }, + }, + }, + }, +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String", + }, + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime", + }, + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String", + }, + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String", + }, + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { type: { name: "Composite", - className: - "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties", + className: "ErrorDetail", + }, + }, + }, + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", }, }, }, @@ -56,30 +191,29 @@ export const ManagedServiceIdentity: coreClient.CompositeMapper = { }, }; -export const Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: - "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", }, - clientId: { - serializedName: "clientId", - readOnly: true, - type: { - name: "String", - }, + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } }, }, }, }, - }; + }, +}; export const IpAddressOrRange: coreClient.CompositeMapper = { type: { @@ -301,36 +435,6 @@ export const PrivateLinkServiceConnectionStateProperty: coreClient.CompositeMapp }, }; -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - export const ApiProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -539,6 +643,22 @@ export const CorsPolicy: coreClient.CompositeMapper = { }, }; +export const DiagnosticLogSettings: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DiagnosticLogSettings", + modelProperties: { + enableFullTextQuery: { + serializedName: "enableFullTextQuery", + type: { + name: "Enum", + allowedValues: ["None", "True", "False"], + }, + }, + }, + }, +}; + export const Capacity: coreClient.CompositeMapper = { type: { name: "Composite", @@ -557,16 +677,64 @@ export const Capacity: coreClient.CompositeMapper = { }, }; -export const DatabaseAccountKeysMetadata: coreClient.CompositeMapper = { +export const CapacityModeChangeTransitionState: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatabaseAccountKeysMetadata", + className: "CapacityModeChangeTransitionState", modelProperties: { - primaryMasterKey: { - serializedName: "primaryMasterKey", + capacityModeTransitionStatus: { + serializedName: "capacityModeTransitionStatus", type: { - name: "Composite", - className: "AccountKeyMetadata", + name: "String", + }, + }, + currentCapacityMode: { + serializedName: "currentCapacityMode", + type: { + name: "String", + }, + }, + previousCapacityMode: { + serializedName: "previousCapacityMode", + type: { + name: "String", + }, + }, + capacityModeTransitionBeginTimestamp: { + serializedName: "capacityModeTransitionBeginTimestamp", + readOnly: true, + type: { + name: "DateTime", + }, + }, + capacityModeTransitionEndTimestamp: { + serializedName: "capacityModeTransitionEndTimestamp", + readOnly: true, + type: { + name: "DateTime", + }, + }, + capacityModeLastSuccessfulTransitionEndTimestamp: { + serializedName: "capacityModeLastSuccessfulTransitionEndTimestamp", + readOnly: true, + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const DatabaseAccountKeysMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatabaseAccountKeysMetadata", + modelProperties: { + primaryMasterKey: { + serializedName: "primaryMasterKey", + type: { + name: "Composite", + className: "AccountKeyMetadata", }, }, secondaryMasterKey: { @@ -610,65 +778,70 @@ export const AccountKeyMetadata: coreClient.CompositeMapper = { }, }; -export const SystemData: coreClient.CompositeMapper = { +export const ARMResourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SystemData", + className: "ARMResourceProperties", modelProperties: { - createdBy: { - serializedName: "createdBy", + id: { + serializedName: "id", + readOnly: true, type: { name: "String", }, }, - createdByType: { - serializedName: "createdByType", + name: { + serializedName: "name", + readOnly: true, type: { name: "String", }, }, - createdAt: { - serializedName: "createdAt", + type: { + serializedName: "type", + readOnly: true, type: { - name: "DateTime", + name: "String", }, }, - lastModifiedBy: { - serializedName: "lastModifiedBy", + location: { + serializedName: "location", type: { name: "String", }, }, - lastModifiedByType: { - serializedName: "lastModifiedByType", + tags: { + serializedName: "tags", type: { - name: "String", + name: "Dictionary", + value: { type: { name: "String" } }, }, }, - lastModifiedAt: { - serializedName: "lastModifiedAt", + identity: { + serializedName: "identity", type: { - name: "DateTime", + name: "Composite", + className: "ManagedServiceIdentity", }, }, }, }, }; -export const ARMResourceProperties: coreClient.CompositeMapper = { +export const ManagedServiceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ARMResourceProperties", + className: "ManagedServiceIdentity", modelProperties: { - id: { - serializedName: "id", + principalId: { + serializedName: "principalId", readOnly: true, type: { name: "String", }, }, - name: { - serializedName: "name", + tenantId: { + serializedName: "tenantId", readOnly: true, type: { name: "String", @@ -676,28 +849,58 @@ export const ARMResourceProperties: coreClient.CompositeMapper = { }, type: { serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", type: { - name: "String", + name: "Enum", + allowedValues: [ + "SystemAssigned", + "UserAssigned", + "SystemAssigned,UserAssigned", + "None", + ], }, }, - tags: { - serializedName: "tags", + userAssignedIdentities: { + serializedName: "userAssignedIdentities", type: { name: "Dictionary", - value: { type: { name: "String" } }, + value: { + type: { + name: "Composite", + className: + "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties", + }, + }, }, }, }, }, }; +export const Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: + "Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String", + }, + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + export const DatabaseAccountUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -895,6 +1098,13 @@ export const DatabaseAccountUpdateParameters: coreClient.CompositeMapper = { }, }, }, + diagnosticLogSettings: { + serializedName: "properties.diagnosticLogSettings", + type: { + name: "Composite", + className: "DiagnosticLogSettings", + }, + }, disableLocalAuth: { serializedName: "properties.disableLocalAuth", type: { @@ -908,6 +1118,18 @@ export const DatabaseAccountUpdateParameters: coreClient.CompositeMapper = { className: "Capacity", }, }, + capacityMode: { + serializedName: "properties.capacityMode", + type: { + name: "String", + }, + }, + enableMaterializedViews: { + serializedName: "properties.enableMaterializedViews", + type: { + name: "Boolean", + }, + }, keysMetadata: { serializedName: "properties.keysMetadata", type: { @@ -921,20 +1143,32 @@ export const DatabaseAccountUpdateParameters: coreClient.CompositeMapper = { name: "Boolean", }, }, + enableBurstCapacity: { + serializedName: "properties.enableBurstCapacity", + type: { + name: "Boolean", + }, + }, minimalTlsVersion: { serializedName: "properties.minimalTlsVersion", type: { name: "String", }, }, - enableBurstCapacity: { - serializedName: "properties.enableBurstCapacity", + customerManagedKeyStatus: { + serializedName: "properties.customerManagedKeyStatus", + type: { + name: "String", + }, + }, + enablePriorityBasedExecution: { + serializedName: "properties.enablePriorityBasedExecution", type: { name: "Boolean", }, }, - customerManagedKeyStatus: { - serializedName: "properties.customerManagedKeyStatus", + defaultPriorityLevel: { + serializedName: "properties.defaultPriorityLevel", type: { name: "String", }, @@ -1092,159 +1326,63 @@ export const RegionForOnlineOffline: coreClient.CompositeMapper = { }, }; -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail", +export const DatabaseAccountRegenerateKeyParameters: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DatabaseAccountRegenerateKeyParameters", + modelProperties: { + keyKind: { + serializedName: "keyKind", + required: true, + type: { + name: "String", + }, }, }, }, - }, -}; + }; -export const ErrorDetail: coreClient.CompositeMapper = { +export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorDetail", + className: "OperationListResult", modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - readOnly: true, + value: { + serializedName: "value", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ErrorDetail", + className: "Operation", }, }, }, }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, + nextLink: { + serializedName: "nextLink", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - }, - }, + name: "String", }, }, }, }, }; -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { +export const Operation: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ErrorAdditionalInfo", + className: "Operation", modelProperties: { - type: { - serializedName: "type", - readOnly: true, + name: { + serializedName: "name", type: { name: "String", }, }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - }, - }, -}; - -export const DatabaseAccountRegenerateKeyParameters: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "DatabaseAccountRegenerateKeyParameters", - modelProperties: { - keyKind: { - serializedName: "keyKind", - required: true, - type: { - name: "String", - }, - }, - }, - }, - }; - -export const OperationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Operation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - display: { - serializedName: "display", + display: { + serializedName: "display", type: { name: "Composite", className: "OperationDisplay", @@ -1724,10 +1862,10 @@ export const MetricAvailability: coreClient.CompositeMapper = { }, }; -export const SqlDatabaseListResult: coreClient.CompositeMapper = { +export const GraphResourcesListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlDatabaseListResult", + className: "GraphResourcesListResult", modelProperties: { value: { serializedName: "value", @@ -1737,7 +1875,7 @@ export const SqlDatabaseListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SqlDatabaseGetResults", + className: "GraphResourceGetResults", }, }, }, @@ -1746,10 +1884,10 @@ export const SqlDatabaseListResult: coreClient.CompositeMapper = { }, }; -export const SqlDatabaseResource: coreClient.CompositeMapper = { +export const GraphResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlDatabaseResource", + className: "GraphResource", modelProperties: { id: { serializedName: "id", @@ -1758,58 +1896,51 @@ export const SqlDatabaseResource: coreClient.CompositeMapper = { name: "String", }, }, - restoreParameters: { - serializedName: "restoreParameters", + }, + }, +}; + +export const OptionsResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OptionsResource", + modelProperties: { + throughput: { + serializedName: "throughput", type: { - name: "Composite", - className: "ResourceRestoreParameters", + name: "Number", }, }, - createMode: { - defaultValue: "Default", - serializedName: "createMode", + autoscaleSettings: { + serializedName: "autoscaleSettings", type: { - name: "String", + name: "Composite", + className: "AutoscaleSettings", }, }, }, }, }; -export const ExtendedResourceProperties: coreClient.CompositeMapper = { +export const AutoscaleSettings: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExtendedResourceProperties", + className: "AutoscaleSettings", modelProperties: { - rid: { - serializedName: "_rid", - readOnly: true, - type: { - name: "String", - }, - }, - ts: { - serializedName: "_ts", - readOnly: true, + maxThroughput: { + serializedName: "maxThroughput", type: { name: "Number", }, }, - etag: { - serializedName: "_etag", - readOnly: true, - type: { - name: "String", - }, - }, }, }, }; -export const OptionsResource: coreClient.CompositeMapper = { +export const CreateUpdateOptions: coreClient.CompositeMapper = { type: { name: "Composite", - className: "OptionsResource", + className: "CreateUpdateOptions", modelProperties: { throughput: { serializedName: "throughput", @@ -1828,37 +1959,82 @@ export const OptionsResource: coreClient.CompositeMapper = { }, }; -export const AutoscaleSettings: coreClient.CompositeMapper = { +export const SqlDatabaseListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "AutoscaleSettings", + className: "SqlDatabaseListResult", modelProperties: { - maxThroughput: { - serializedName: "maxThroughput", + value: { + serializedName: "value", + readOnly: true, type: { - name: "Number", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SqlDatabaseGetResults", + }, + }, }, }, }, }, }; -export const CreateUpdateOptions: coreClient.CompositeMapper = { +export const SqlDatabaseResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CreateUpdateOptions", + className: "SqlDatabaseResource", modelProperties: { - throughput: { - serializedName: "throughput", + id: { + serializedName: "id", + required: true, type: { - name: "Number", + name: "String", }, }, - autoscaleSettings: { - serializedName: "autoscaleSettings", + restoreParameters: { + serializedName: "restoreParameters", type: { name: "Composite", - className: "AutoscaleSettings", + className: "ResourceRestoreParameters", + }, + }, + createMode: { + defaultValue: "Default", + serializedName: "createMode", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ExtendedResourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtendedResourceProperties", + modelProperties: { + rid: { + serializedName: "_rid", + readOnly: true, + type: { + name: "String", + }, + }, + ts: { + serializedName: "_ts", + readOnly: true, + type: { + name: "Number", + }, + }, + etag: { + serializedName: "_etag", + readOnly: true, + type: { + name: "String", }, }, }, @@ -1911,6 +2087,18 @@ export const ThroughputSettingsResource: coreClient.CompositeMapper = { name: "String", }, }, + throughputBuckets: { + serializedName: "throughputBuckets", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ThroughputBucketResource", + }, + }, + }, + }, }, }, }; @@ -1982,10 +2170,33 @@ export const ThroughputPolicyResource: coreClient.CompositeMapper = { }, }; -export const SqlContainerListResult: coreClient.CompositeMapper = { +export const ThroughputBucketResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlContainerListResult", + className: "ThroughputBucketResource", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "Number", + }, + }, + maxThroughputPercentage: { + serializedName: "maxThroughputPercentage", + required: true, + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const ClientEncryptionKeysListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClientEncryptionKeysListResult", modelProperties: { value: { serializedName: "value", @@ -1995,7 +2206,7 @@ export const SqlContainerListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "SqlContainerGetResults", + className: "ClientEncryptionKeyGetResults", }, }, }, @@ -2004,42 +2215,178 @@ export const SqlContainerListResult: coreClient.CompositeMapper = { }, }; -export const SqlContainerResource: coreClient.CompositeMapper = { +export const ClientEncryptionKeyResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlContainerResource", + className: "ClientEncryptionKeyResource", modelProperties: { id: { serializedName: "id", - required: true, type: { name: "String", }, }, - indexingPolicy: { - serializedName: "indexingPolicy", + encryptionAlgorithm: { + serializedName: "encryptionAlgorithm", type: { - name: "Composite", - className: "IndexingPolicy", + name: "String", }, }, - partitionKey: { - serializedName: "partitionKey", + wrappedDataEncryptionKey: { + serializedName: "wrappedDataEncryptionKey", type: { - name: "Composite", - className: "ContainerPartitionKey", + name: "ByteArray", }, }, - defaultTtl: { - serializedName: "defaultTtl", + keyWrapMetadata: { + serializedName: "keyWrapMetadata", type: { - name: "Number", + name: "Composite", + className: "KeyWrapMetadata", }, }, - uniqueKeyPolicy: { - serializedName: "uniqueKeyPolicy", - type: { - name: "Composite", + }, + }, +}; + +export const KeyWrapMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeyWrapMetadata", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + type: { + name: "String", + }, + }, + algorithm: { + serializedName: "algorithm", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ARMProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ARMProxyResource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ClientEncryptionKeyCreateUpdateParameters: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ClientEncryptionKeyCreateUpdateParameters", + modelProperties: { + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "ClientEncryptionKeyResource", + }, + }, + }, + }, + }; + +export const SqlContainerListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlContainerListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SqlContainerGetResults", + }, + }, + }, + }, + }, + }, +}; + +export const SqlContainerResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlContainerResource", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String", + }, + }, + indexingPolicy: { + serializedName: "indexingPolicy", + type: { + name: "Composite", + className: "IndexingPolicy", + }, + }, + partitionKey: { + serializedName: "partitionKey", + type: { + name: "Composite", + className: "ContainerPartitionKey", + }, + }, + defaultTtl: { + serializedName: "defaultTtl", + type: { + name: "Number", + }, + }, + uniqueKeyPolicy: { + serializedName: "uniqueKeyPolicy", + type: { + name: "Composite", className: "UniqueKeyPolicy", }, }, @@ -2077,6 +2424,13 @@ export const SqlContainerResource: coreClient.CompositeMapper = { name: "String", }, }, + materializedViewDefinition: { + serializedName: "materializedViewDefinition", + type: { + name: "Composite", + className: "MaterializedViewDefinition", + }, + }, computedProperties: { serializedName: "computedProperties", type: { @@ -2511,6 +2865,36 @@ export const ClientEncryptionIncludedPath: coreClient.CompositeMapper = { }, }; +export const MaterializedViewDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MaterializedViewDefinition", + modelProperties: { + sourceCollectionRid: { + serializedName: "sourceCollectionRid", + readOnly: true, + type: { + name: "String", + }, + }, + sourceCollectionId: { + serializedName: "sourceCollectionId", + required: true, + type: { + name: "String", + }, + }, + definition: { + serializedName: "definition", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + export const ComputedProperty: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2590,87 +2974,98 @@ export const VectorEmbedding: coreClient.CompositeMapper = { }, }; -export const ClientEncryptionKeysListResult: coreClient.CompositeMapper = { +export const MergeParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClientEncryptionKeysListResult", + className: "MergeParameters", modelProperties: { - value: { - serializedName: "value", - readOnly: true, + isDryRun: { + serializedName: "isDryRun", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClientEncryptionKeyGetResults", - }, - }, + name: "Boolean", }, }, }, }, }; -export const ClientEncryptionKeyResource: coreClient.CompositeMapper = { +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: "ClientEncryptionKeyResource", + className: "PhysicalPartitionStorageInfo", modelProperties: { id: { serializedName: "id", + readOnly: true, type: { name: "String", }, }, - encryptionAlgorithm: { - serializedName: "encryptionAlgorithm", - type: { - name: "String", - }, - }, - wrappedDataEncryptionKey: { - serializedName: "wrappedDataEncryptionKey", - type: { - name: "ByteArray", - }, - }, - keyWrapMetadata: { - serializedName: "keyWrapMetadata", + storageInKB: { + serializedName: "storageInKB", + readOnly: true, type: { - name: "Composite", - className: "KeyWrapMetadata", + name: "Number", }, }, }, }, }; -export const KeyWrapMetadata: coreClient.CompositeMapper = { +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: "KeyWrapMetadata", + className: "PhysicalPartitionId", modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - type: { - name: "String", - }, - }, - algorithm: { - serializedName: "algorithm", + id: { + serializedName: "id", + required: true, type: { name: "String", }, @@ -2679,47 +3074,88 @@ export const KeyWrapMetadata: coreClient.CompositeMapper = { }, }; -export const ARMProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ARMProxyResource", - modelProperties: { - id: { - serializedName: "id", - readOnly: 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", + }, + }, + }, }, }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", + }, + }; + +export const PhysicalPartitionThroughputInfoResource: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "PhysicalPartitionThroughputInfoResource", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String", + }, }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", + throughput: { + serializedName: "throughput", + type: { + name: "Number", + }, }, }, }, - }, -}; + }; -export const ClientEncryptionKeyCreateUpdateParameters: coreClient.CompositeMapper = +export const RedistributeThroughputPropertiesResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClientEncryptionKeyCreateUpdateParameters", + className: "RedistributeThroughputPropertiesResource", modelProperties: { - resource: { - serializedName: "properties.resource", + throughputPolicy: { + serializedName: "throughputPolicy", + required: true, type: { - name: "Composite", - className: "ClientEncryptionKeyResource", + 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", + }, + }, }, }, }, @@ -3534,6 +3970,189 @@ export const LocationProperties: coreClient.CompositeMapper = { }, }; +export const CassandraViewListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CassandraViewListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CassandraViewGetResults", + }, + }, + }, + }, + }, + }, +}; + +export const CassandraViewResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CassandraViewResource", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String", + }, + }, + viewDefinition: { + serializedName: "viewDefinition", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DataTransferJobProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataTransferJobProperties", + modelProperties: { + jobName: { + serializedName: "jobName", + readOnly: true, + type: { + name: "String", + }, + }, + source: { + serializedName: "source", + type: { + name: "Composite", + className: "DataTransferDataSourceSink", + }, + }, + destination: { + serializedName: "destination", + type: { + name: "Composite", + className: "DataTransferDataSourceSink", + }, + }, + status: { + serializedName: "status", + readOnly: true, + type: { + name: "String", + }, + }, + processedCount: { + serializedName: "processedCount", + readOnly: true, + type: { + name: "Number", + }, + }, + totalCount: { + serializedName: "totalCount", + readOnly: true, + type: { + name: "Number", + }, + }, + lastUpdatedUtcTime: { + serializedName: "lastUpdatedUtcTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + workerCount: { + constraints: { + InclusiveMinimum: 0, + }, + serializedName: "workerCount", + type: { + name: "Number", + }, + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse", + }, + }, + duration: { + serializedName: "duration", + readOnly: true, + type: { + name: "String", + }, + }, + mode: { + serializedName: "mode", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DataTransferDataSourceSink: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataTransferDataSourceSink", + uberParent: "DataTransferDataSourceSink", + polymorphicDiscriminator: { + serializedName: "component", + clientName: "component", + }, + modelProperties: { + component: { + defaultValue: "CosmosDBCassandra", + serializedName: "component", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DataTransferJobFeedResults: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataTransferJobFeedResults", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataTransferJobGetResults", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + export const ListClusters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3615,6 +4234,12 @@ export const ClusterResourceProperties: coreClient.CompositeMapper = { name: "Boolean", }, }, + autoReplicate: { + serializedName: "autoReplicate", + type: { + name: "String", + }, + }, clientCertificates: { serializedName: "clientCertificates", type: { @@ -3677,6 +4302,17 @@ export const ClusterResourceProperties: coreClient.CompositeMapper = { }, }, }, + externalDataCenters: { + serializedName: "externalDataCenters", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, hoursBetweenBackups: { serializedName: "hoursBetweenBackups", type: { @@ -3695,6 +4331,12 @@ export const ClusterResourceProperties: coreClient.CompositeMapper = { name: "Boolean", }, }, + clusterType: { + serializedName: "clusterType", + type: { + name: "String", + }, + }, provisionError: { serializedName: "provisionError", type: { @@ -3702,15 +4344,44 @@ export const ClusterResourceProperties: coreClient.CompositeMapper = { className: "CassandraError", }, }, - azureConnectionMethod: { - serializedName: "azureConnectionMethod", + extensions: { + serializedName: "extensions", type: { - name: "String", - }, - }, - privateLinkResourceId: { - serializedName: "privateLinkResourceId", - readOnly: true, + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + backupSchedules: { + serializedName: "backupSchedules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BackupSchedule", + }, + }, + }, + }, + scheduledEventStrategy: { + serializedName: "scheduledEventStrategy", + type: { + name: "String", + }, + }, + azureConnectionMethod: { + serializedName: "azureConnectionMethod", + type: { + name: "String", + }, + }, + privateLinkResourceId: { + serializedName: "privateLinkResourceId", + readOnly: true, type: { name: "String", }, @@ -3782,6 +4453,33 @@ export const CassandraError: coreClient.CompositeMapper = { }, }; +export const BackupSchedule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupSchedule", + modelProperties: { + scheduleName: { + serializedName: "scheduleName", + type: { + name: "String", + }, + }, + cronExpression: { + serializedName: "cronExpression", + type: { + name: "String", + }, + }, + retentionInHours: { + serializedName: "retentionInHours", + type: { + name: "Number", + }, + }, + }, + }, +}; + export const ManagedCassandraARMResourceProperties: coreClient.CompositeMapper = { type: { @@ -3920,6 +4618,201 @@ export const CommandOutput: coreClient.CompositeMapper = { }, }; +export const CommandAsyncPostBody: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommandAsyncPostBody", + modelProperties: { + command: { + serializedName: "command", + required: true, + type: { + name: "String", + }, + }, + arguments: { + serializedName: "arguments", + type: { + name: "Dictionary", + value: { type: { name: "any" } }, + }, + }, + host: { + serializedName: "host", + required: true, + type: { + name: "String", + }, + }, + cassandraStopStart: { + serializedName: "cassandra-stop-start", + type: { + name: "Boolean", + }, + }, + readWrite: { + serializedName: "readWrite", + type: { + name: "Boolean", + }, + }, + }, + }, +}; + +export const CommandPublicResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommandPublicResource", + modelProperties: { + command: { + serializedName: "command", + type: { + name: "String", + }, + }, + commandId: { + serializedName: "commandId", + type: { + name: "String", + }, + }, + arguments: { + serializedName: "arguments", + type: { + name: "Dictionary", + value: { type: { name: "any" } }, + }, + }, + host: { + serializedName: "host", + type: { + name: "String", + }, + }, + isAdmin: { + serializedName: "isAdmin", + type: { + name: "Boolean", + }, + }, + cassandraStopStart: { + serializedName: "cassandraStopStart", + type: { + name: "Boolean", + }, + }, + readWrite: { + serializedName: "readWrite", + type: { + name: "Boolean", + }, + }, + result: { + serializedName: "result", + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + type: { + name: "String", + }, + }, + outputFile: { + serializedName: "outputFile", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ListCommands: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ListCommands", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CommandPublicResource", + }, + }, + }, + }, + }, + }, +}; + +export const ListBackups: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ListBackups", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BackupResource", + }, + }, + }, + }, + }, + }, +}; + +export const BackupResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupResource", + modelProperties: { + backupId: { + serializedName: "backupId", + type: { + name: "String", + }, + }, + backupState: { + serializedName: "backupState", + type: { + name: "String", + }, + }, + backupStartTimestamp: { + serializedName: "backupStartTimestamp", + type: { + name: "DateTime", + }, + }, + backupStopTimestamp: { + serializedName: "backupStopTimestamp", + type: { + name: "DateTime", + }, + }, + backupExpiryTimestamp: { + serializedName: "backupExpiryTimestamp", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + export const ListDataCenters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4399,6 +5292,12 @@ export const ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatace name: "Number", }, }, + isLatestModel: { + serializedName: "isLatestModel", + type: { + name: "Boolean", + }, + }, }, }, }; @@ -4621,100 +5520,137 @@ export const MongoUserDefinitionListResult: coreClient.CompositeMapper = { }, }; -export const NotebookWorkspaceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NotebookWorkspaceListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NotebookWorkspace", +export const NetworkSecurityPerimeterConfigurationListResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfigurationListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfiguration", + }, }, }, }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, }, }, - }, -}; + }; -export const NotebookWorkspaceConnectionInfoResult: coreClient.CompositeMapper = +export const NetworkSecurityPerimeterConfigurationProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "NotebookWorkspaceConnectionInfoResult", + className: "NetworkSecurityPerimeterConfigurationProperties", modelProperties: { - authToken: { - serializedName: "authToken", + provisioningState: { + serializedName: "provisioningState", readOnly: true, type: { name: "String", }, }, - notebookServerEndpoint: { - serializedName: "notebookServerEndpoint", + provisioningIssues: { + serializedName: "provisioningIssues", readOnly: true, type: { - name: "String", - }, - }, - }, - }, - }; - -export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ProvisioningIssue", + }, }, }, }, + networkSecurityPerimeter: { + serializedName: "networkSecurityPerimeter", + type: { + name: "Composite", + className: "NetworkSecurityPerimeter", + }, + }, + resourceAssociation: { + serializedName: "resourceAssociation", + type: { + name: "Composite", + className: "ResourceAssociation", + }, + }, + profile: { + serializedName: "profile", + type: { + name: "Composite", + className: "NetworkSecurityProfile", + }, + }, }, }, - }, -}; + }; -export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { +export const ProvisioningIssue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkResourceListResult", + className: "ProvisioningIssue", modelProperties: { - value: { - serializedName: "value", + name: { + serializedName: "name", + readOnly: true, type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateLinkResource", - }, - }, + name: "String", + }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ProvisioningIssueProperties", }, }, }, }, }; -export const Permission: coreClient.CompositeMapper = { +export const ProvisioningIssueProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Permission", + className: "ProvisioningIssueProperties", modelProperties: { - dataActions: { - serializedName: "dataActions", + issueType: { + serializedName: "issueType", + readOnly: true, + type: { + name: "String", + }, + }, + severity: { + serializedName: "severity", + readOnly: true, + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + suggestedResourceIds: { + serializedName: "suggestedResourceIds", + readOnly: true, type: { name: "Sequence", element: { @@ -4724,13 +5660,15 @@ export const Permission: coreClient.CompositeMapper = { }, }, }, - notDataActions: { - serializedName: "notDataActions", + suggestedAccessRules: { + serializedName: "suggestedAccessRules", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "String", + name: "Composite", + className: "AccessRule", }, }, }, @@ -4739,116 +5677,103 @@ export const Permission: coreClient.CompositeMapper = { }, }; -export const SqlRoleDefinitionCreateUpdateParameters: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "SqlRoleDefinitionCreateUpdateParameters", - modelProperties: { - roleName: { - serializedName: "properties.roleName", - type: { - name: "String", - }, - }, +export const AccessRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessRule", + modelProperties: { + name: { + serializedName: "name", type: { - serializedName: "properties.type", - type: { - name: "Enum", - allowedValues: ["BuiltInRole", "CustomRole"], - }, - }, - assignableScopes: { - serializedName: "properties.assignableScopes", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, + name: "String", }, - permissions: { - serializedName: "properties.permissions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Permission", - }, - }, - }, + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AccessRuleProperties", }, }, }, - }; + }, +}; -export const SqlRoleDefinitionListResult: coreClient.CompositeMapper = { +export const AccessRuleProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlRoleDefinitionListResult", + className: "AccessRuleProperties", modelProperties: { - value: { - serializedName: "value", - readOnly: true, + direction: { + serializedName: "direction", + type: { + name: "String", + }, + }, + addressPrefixes: { + serializedName: "addressPrefixes", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + subscriptions: { + serializedName: "subscriptions", type: { name: "Sequence", element: { type: { name: "Composite", - className: "SqlRoleDefinitionGetResults", + className: "AccessRulePropertiesSubscriptionsItem", }, }, }, }, - }, - }, -}; - -export const SqlRoleAssignmentCreateUpdateParameters: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "SqlRoleAssignmentCreateUpdateParameters", - modelProperties: { - roleDefinitionId: { - serializedName: "properties.roleDefinitionId", - type: { - name: "String", + networkSecurityPerimeters: { + serializedName: "networkSecurityPerimeters", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkSecurityPerimeter", + }, }, }, - scope: { - serializedName: "properties.scope", - type: { - name: "String", + }, + fullyQualifiedDomainNames: { + serializedName: "fullyQualifiedDomainNames", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, }, }, - principalId: { - serializedName: "properties.principalId", - type: { - name: "String", + }, + emailAddresses: { + serializedName: "emailAddresses", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, }, }, }, - }, - }; - -export const SqlRoleAssignmentListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SqlRoleAssignmentListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, + phoneNumbers: { + serializedName: "phoneNumbers", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "SqlRoleAssignmentGetResults", + name: "String", }, }, }, @@ -4857,53 +5782,37 @@ export const SqlRoleAssignmentListResult: coreClient.CompositeMapper = { }, }; -export const RestorableDatabaseAccountsListResult: coreClient.CompositeMapper = +export const AccessRulePropertiesSubscriptionsItem: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableDatabaseAccountsListResult", + className: "AccessRulePropertiesSubscriptionsItem", modelProperties: { - value: { - serializedName: "value", - readOnly: true, + id: { + serializedName: "id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestorableDatabaseAccountGetResult", - }, - }, + name: "String", }, }, }, }, }; -export const RestorableDatabaseAccountGetResult: coreClient.CompositeMapper = { +export const NetworkSecurityPerimeter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableDatabaseAccountGetResult", + className: "NetworkSecurityPerimeter", modelProperties: { id: { serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, type: { name: "String", }, }, - type: { - serializedName: "type", - readOnly: true, + perimeterGuid: { + serializedName: "perimeterGuid", type: { - name: "String", + name: "Uuid", }, }, location: { @@ -4912,151 +5821,160 @@ export const RestorableDatabaseAccountGetResult: coreClient.CompositeMapper = { name: "String", }, }, - accountName: { - serializedName: "properties.accountName", + }, + }, +}; + +export const ResourceAssociation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceAssociation", + modelProperties: { + name: { + serializedName: "name", type: { name: "String", }, }, - creationTime: { - serializedName: "properties.creationTime", + accessMode: { + serializedName: "accessMode", type: { - name: "DateTime", + name: "String", }, }, - deletionTime: { - serializedName: "properties.deletionTime", - type: { - name: "DateTime", - }, - }, - oldestRestorableTime: { - serializedName: "properties.oldestRestorableTime", + }, + }, +}; + +export const NetworkSecurityProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkSecurityProfile", + modelProperties: { + name: { + serializedName: "name", type: { - name: "DateTime", + name: "String", }, }, - apiType: { - serializedName: "properties.apiType", - readOnly: true, + accessRulesVersion: { + serializedName: "accessRulesVersion", type: { - name: "String", + name: "Number", }, }, - restorableLocations: { - serializedName: "properties.restorableLocations", - readOnly: true, + accessRules: { + serializedName: "accessRules", type: { name: "Sequence", element: { type: { name: "Composite", - className: "RestorableLocationResource", + className: "AccessRule", }, }, }, }, - }, - }, -}; - -export const RestorableLocationResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorableLocationResource", - modelProperties: { - locationName: { - serializedName: "locationName", - readOnly: true, - type: { - name: "String", - }, - }, - regionalDatabaseAccountInstanceId: { - serializedName: "regionalDatabaseAccountInstanceId", - readOnly: true, - type: { - name: "String", - }, - }, - creationTime: { - serializedName: "creationTime", - readOnly: true, + diagnosticSettingsVersion: { + serializedName: "diagnosticSettingsVersion", type: { - name: "DateTime", + name: "Number", }, }, - deletionTime: { - serializedName: "deletionTime", - readOnly: true, + enabledLogCategories: { + serializedName: "enabledLogCategories", type: { - name: "DateTime", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, }, }, }; -export const ContinuousBackupRestoreLocation: coreClient.CompositeMapper = { +export const NotebookWorkspaceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ContinuousBackupRestoreLocation", + className: "NotebookWorkspaceListResult", modelProperties: { - location: { - serializedName: "location", + value: { + serializedName: "value", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NotebookWorkspace", + }, + }, }, }, }, }, }; -export const BackupInformation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BackupInformation", - modelProperties: { - continuousBackupInformation: { - serializedName: "continuousBackupInformation", - type: { - name: "Composite", - className: "ContinuousBackupInformation", +export const NotebookWorkspaceConnectionInfoResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NotebookWorkspaceConnectionInfoResult", + modelProperties: { + authToken: { + serializedName: "authToken", + readOnly: true, + type: { + name: "String", + }, + }, + notebookServerEndpoint: { + serializedName: "notebookServerEndpoint", + readOnly: true, + type: { + name: "String", + }, }, }, }, - }, -}; + }; -export const ContinuousBackupInformation: coreClient.CompositeMapper = { +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ContinuousBackupInformation", + className: "PrivateEndpointConnectionListResult", modelProperties: { - latestRestorableTimestamp: { - serializedName: "latestRestorableTimestamp", + value: { + serializedName: "value", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + }, + }, }, }, }, }, }; -export const RestorableSqlDatabasesListResult: coreClient.CompositeMapper = { +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableSqlDatabasesListResult", + className: "PrivateLinkResourceListResult", modelProperties: { value: { serializedName: "value", - readOnly: true, type: { name: "Sequence", element: { type: { name: "Composite", - className: "RestorableSqlDatabaseGetResult", + className: "PrivateLinkResource", }, }, }, @@ -5065,113 +5983,87 @@ export const RestorableSqlDatabasesListResult: coreClient.CompositeMapper = { }, }; -export const RestorableSqlDatabaseGetResult: coreClient.CompositeMapper = { +export const Permission: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableSqlDatabaseGetResult", + className: "Permission", modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, + dataActions: { + serializedName: "dataActions", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, - resource: { - serializedName: "properties.resource", + notDataActions: { + serializedName: "notDataActions", type: { - name: "Composite", - className: "RestorableSqlDatabasePropertiesResource", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, }, }, }; -export const RestorableSqlDatabasePropertiesResource: coreClient.CompositeMapper = +export const SqlRoleDefinitionCreateUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableSqlDatabasePropertiesResource", + className: "SqlRoleDefinitionCreateUpdateParameters", modelProperties: { - rid: { - serializedName: "_rid", - readOnly: true, - type: { - name: "String", - }, - }, - operationType: { - serializedName: "operationType", - readOnly: true, - type: { - name: "String", - }, - }, - canUndelete: { - serializedName: "canUndelete", - readOnly: true, - type: { - name: "String", - }, - }, - canUndeleteReason: { - serializedName: "canUndeleteReason", - readOnly: true, - type: { - name: "String", - }, - }, - eventTimestamp: { - serializedName: "eventTimestamp", - readOnly: true, + roleName: { + serializedName: "properties.roleName", type: { name: "String", }, }, - ownerId: { - serializedName: "ownerId", - readOnly: true, + type: { + serializedName: "properties.type", type: { - name: "String", + name: "Enum", + allowedValues: ["BuiltInRole", "CustomRole"], }, }, - ownerResourceId: { - serializedName: "ownerResourceId", - readOnly: true, + assignableScopes: { + serializedName: "properties.assignableScopes", type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "String", + }, + }, }, }, - database: { - serializedName: "database", + permissions: { + serializedName: "properties.permissions", type: { - name: "Composite", - className: "RestorableSqlDatabasePropertiesResourceDatabase", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Permission", + }, + }, }, }, }, }, }; -export const RestorableSqlContainersListResult: coreClient.CompositeMapper = { +export const SqlRoleDefinitionListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableSqlContainersListResult", + className: "SqlRoleDefinitionListResult", modelProperties: { value: { serializedName: "value", @@ -5181,7 +6073,7 @@ export const RestorableSqlContainersListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "RestorableSqlContainerGetResult", + className: "SqlRoleDefinitionGetResults", }, }, }, @@ -5190,113 +6082,38 @@ export const RestorableSqlContainersListResult: coreClient.CompositeMapper = { }, }; -export const RestorableSqlContainerGetResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorableSqlContainerGetResult", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - resource: { - serializedName: "properties.resource", - type: { - name: "Composite", - className: "RestorableSqlContainerPropertiesResource", - }, - }, - }, - }, -}; - -export const RestorableSqlContainerPropertiesResource: coreClient.CompositeMapper = +export const SqlRoleAssignmentCreateUpdateParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableSqlContainerPropertiesResource", + className: "SqlRoleAssignmentCreateUpdateParameters", modelProperties: { - rid: { - serializedName: "_rid", - readOnly: true, - type: { - name: "String", - }, - }, - operationType: { - serializedName: "operationType", - readOnly: true, - type: { - name: "String", - }, - }, - canUndelete: { - serializedName: "canUndelete", - readOnly: true, - type: { - name: "String", - }, - }, - canUndeleteReason: { - serializedName: "canUndeleteReason", - readOnly: true, - type: { - name: "String", - }, - }, - eventTimestamp: { - serializedName: "eventTimestamp", - readOnly: true, + roleDefinitionId: { + serializedName: "properties.roleDefinitionId", type: { name: "String", }, }, - ownerId: { - serializedName: "ownerId", - readOnly: true, + scope: { + serializedName: "properties.scope", type: { name: "String", }, }, - ownerResourceId: { - serializedName: "ownerResourceId", - readOnly: true, + principalId: { + serializedName: "properties.principalId", type: { name: "String", }, }, - container: { - serializedName: "container", - type: { - name: "Composite", - className: "RestorableSqlContainerPropertiesResourceContainer", - }, - }, }, }, }; -export const RestorableSqlResourcesListResult: coreClient.CompositeMapper = { +export const SqlRoleAssignmentListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableSqlResourcesListResult", + className: "SqlRoleAssignmentListResult", modelProperties: { value: { serializedName: "value", @@ -5306,7 +6123,7 @@ export const RestorableSqlResourcesListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "RestorableSqlResourcesGetResult", + className: "SqlRoleAssignmentGetResults", }, }, }, @@ -5315,10 +6132,33 @@ export const RestorableSqlResourcesListResult: coreClient.CompositeMapper = { }, }; -export const RestorableSqlResourcesGetResult: coreClient.CompositeMapper = { +export const RestorableDatabaseAccountsListResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RestorableDatabaseAccountsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RestorableDatabaseAccountGetResult", + }, + }, + }, + }, + }, + }, + }; + +export const RestorableDatabaseAccountGetResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableSqlResourcesGetResult", + className: "RestorableDatabaseAccountGetResult", modelProperties: { id: { serializedName: "id", @@ -5341,19 +6181,52 @@ export const RestorableSqlResourcesGetResult: coreClient.CompositeMapper = { name: "String", }, }, - databaseName: { - serializedName: "databaseName", + location: { + serializedName: "location", type: { name: "String", }, }, - collectionNames: { - serializedName: "collectionNames", + accountName: { + serializedName: "properties.accountName", + type: { + name: "String", + }, + }, + creationTime: { + serializedName: "properties.creationTime", + type: { + name: "DateTime", + }, + }, + oldestRestorableTime: { + serializedName: "properties.oldestRestorableTime", + type: { + name: "DateTime", + }, + }, + deletionTime: { + serializedName: "properties.deletionTime", + type: { + name: "DateTime", + }, + }, + apiType: { + serializedName: "properties.apiType", + readOnly: true, + type: { + name: "String", + }, + }, + restorableLocations: { + serializedName: "properties.restorableLocations", + readOnly: true, type: { name: "Sequence", element: { type: { - name: "String", + name: "Composite", + className: "RestorableLocationResource", }, }, }, @@ -5362,85 +6235,167 @@ export const RestorableSqlResourcesGetResult: coreClient.CompositeMapper = { }, }; -export const RestorableMongodbDatabasesListResult: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "RestorableMongodbDatabasesListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestorableMongodbDatabaseGetResult", - }, - }, - }, - }, - }, - }, - }; - -export const RestorableMongodbDatabaseGetResult: coreClient.CompositeMapper = { +export const RestorableLocationResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableMongodbDatabaseGetResult", + className: "RestorableLocationResource", modelProperties: { - id: { - serializedName: "id", + locationName: { + serializedName: "locationName", readOnly: true, type: { name: "String", }, }, - name: { - serializedName: "name", + regionalDatabaseAccountInstanceId: { + serializedName: "regionalDatabaseAccountInstanceId", readOnly: true, type: { name: "String", }, }, - type: { - serializedName: "type", + creationTime: { + serializedName: "creationTime", readOnly: true, type: { - name: "String", + name: "DateTime", }, }, - resource: { - serializedName: "properties.resource", + deletionTime: { + serializedName: "deletionTime", + readOnly: true, type: { - name: "Composite", - className: "RestorableMongodbDatabasePropertiesResource", + name: "DateTime", }, }, }, }, }; -export const RestorableMongodbDatabasePropertiesResource: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "RestorableMongodbDatabasePropertiesResource", - modelProperties: { - rid: { - serializedName: "_rid", - readOnly: true, - type: { - name: "String", - }, +export const ContinuousBackupRestoreLocation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ContinuousBackupRestoreLocation", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", }, - operationType: { - serializedName: "operationType", - readOnly: true, - type: { - name: "String", - }, + }, + }, + }, +}; + +export const BackupInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BackupInformation", + modelProperties: { + continuousBackupInformation: { + serializedName: "continuousBackupInformation", + type: { + name: "Composite", + className: "ContinuousBackupInformation", + }, + }, + }, + }, +}; + +export const ContinuousBackupInformation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ContinuousBackupInformation", + modelProperties: { + latestRestorableTimestamp: { + serializedName: "latestRestorableTimestamp", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RestorableSqlDatabasesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableSqlDatabasesListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RestorableSqlDatabaseGetResult", + }, + }, + }, + }, + }, + }, +}; + +export const RestorableSqlDatabaseGetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableSqlDatabaseGetResult", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "RestorableSqlDatabasePropertiesResource", + }, + }, + }, + }, +}; + +export const RestorableSqlDatabasePropertiesResource: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RestorableSqlDatabasePropertiesResource", + modelProperties: { + rid: { + serializedName: "_rid", + readOnly: true, + type: { + name: "String", + }, + }, + operationType: { + serializedName: "operationType", + readOnly: true, + type: { + name: "String", + }, }, canUndelete: { serializedName: "canUndelete", @@ -5477,76 +6432,81 @@ export const RestorableMongodbDatabasePropertiesResource: coreClient.CompositeMa name: "String", }, }, + database: { + serializedName: "database", + type: { + name: "Composite", + className: "RestorableSqlDatabasePropertiesResourceDatabase", + }, + }, }, }, }; -export const RestorableMongodbCollectionsListResult: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "RestorableMongodbCollectionsListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestorableMongodbCollectionGetResult", - }, +export const RestorableSqlContainersListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableSqlContainersListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RestorableSqlContainerGetResult", }, }, }, }, }, - }; + }, +}; -export const RestorableMongodbCollectionGetResult: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "RestorableMongodbCollectionGetResult", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, +export const RestorableSqlContainerGetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableSqlContainerGetResult", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", }, + }, + type: { + serializedName: "type", + readOnly: true, type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, + name: "String", }, - resource: { - serializedName: "properties.resource", - type: { - name: "Composite", - className: "RestorableMongodbCollectionPropertiesResource", - }, + }, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "RestorableSqlContainerPropertiesResource", }, }, }, - }; + }, +}; -export const RestorableMongodbCollectionPropertiesResource: coreClient.CompositeMapper = +export const RestorableSqlContainerPropertiesResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableMongodbCollectionPropertiesResource", + className: "RestorableSqlContainerPropertiesResource", modelProperties: { rid: { serializedName: "_rid", @@ -5597,37 +6557,43 @@ export const RestorableMongodbCollectionPropertiesResource: coreClient.Composite name: "String", }, }, + container: { + serializedName: "container", + type: { + name: "Composite", + className: "RestorableSqlContainerPropertiesResourceContainer", + }, + }, }, }, }; -export const RestorableMongodbResourcesListResult: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "RestorableMongodbResourcesListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestorableMongodbResourcesGetResult", - }, +export const RestorableSqlResourcesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableSqlResourcesListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RestorableSqlResourcesGetResult", }, }, }, }, }, - }; + }, +}; -export const RestorableMongodbResourcesGetResult: coreClient.CompositeMapper = { +export const RestorableSqlResourcesGetResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableMongodbResourcesGetResult", + className: "RestorableSqlResourcesGetResult", modelProperties: { id: { serializedName: "id", @@ -5671,11 +6637,11 @@ export const RestorableMongodbResourcesGetResult: coreClient.CompositeMapper = { }, }; -export const RestorableGremlinDatabasesListResult: coreClient.CompositeMapper = +export const RestorableMongodbDatabasesListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableGremlinDatabasesListResult", + className: "RestorableMongodbDatabasesListResult", modelProperties: { value: { serializedName: "value", @@ -5685,7 +6651,7 @@ export const RestorableGremlinDatabasesListResult: coreClient.CompositeMapper = element: { type: { name: "Composite", - className: "RestorableGremlinDatabaseGetResult", + className: "RestorableMongodbDatabaseGetResult", }, }, }, @@ -5694,10 +6660,10 @@ export const RestorableGremlinDatabasesListResult: coreClient.CompositeMapper = }, }; -export const RestorableGremlinDatabaseGetResult: coreClient.CompositeMapper = { +export const RestorableMongodbDatabaseGetResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableGremlinDatabaseGetResult", + className: "RestorableMongodbDatabaseGetResult", modelProperties: { id: { serializedName: "id", @@ -5724,18 +6690,18 @@ export const RestorableGremlinDatabaseGetResult: coreClient.CompositeMapper = { serializedName: "properties.resource", type: { name: "Composite", - className: "RestorableGremlinDatabasePropertiesResource", + className: "RestorableMongodbDatabasePropertiesResource", }, }, }, }, }; -export const RestorableGremlinDatabasePropertiesResource: coreClient.CompositeMapper = +export const RestorableMongodbDatabasePropertiesResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableGremlinDatabasePropertiesResource", + className: "RestorableMongodbDatabasePropertiesResource", modelProperties: { rid: { serializedName: "_rid", @@ -5790,70 +6756,72 @@ export const RestorableGremlinDatabasePropertiesResource: coreClient.CompositeMa }, }; -export const RestorableGremlinGraphsListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorableGremlinGraphsListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestorableGremlinGraphGetResult", +export const RestorableMongodbCollectionsListResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RestorableMongodbCollectionsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RestorableMongodbCollectionGetResult", + }, }, }, }, }, }, - }, -}; + }; -export const RestorableGremlinGraphGetResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorableGremlinGraphGetResult", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", +export const RestorableMongodbCollectionGetResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RestorableMongodbCollectionGetResult", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, }, - }, - type: { - serializedName: "type", - readOnly: true, type: { - name: "String", + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, }, - }, - resource: { - serializedName: "properties.resource", - type: { - name: "Composite", - className: "RestorableGremlinGraphPropertiesResource", + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "RestorableMongodbCollectionPropertiesResource", + }, }, }, }, - }, -}; + }; -export const RestorableGremlinGraphPropertiesResource: coreClient.CompositeMapper = +export const RestorableMongodbCollectionPropertiesResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableGremlinGraphPropertiesResource", + className: "RestorableMongodbCollectionPropertiesResource", modelProperties: { rid: { serializedName: "_rid", @@ -5908,11 +6876,11 @@ export const RestorableGremlinGraphPropertiesResource: coreClient.CompositeMappe }, }; -export const RestorableGremlinResourcesListResult: coreClient.CompositeMapper = +export const RestorableMongodbResourcesListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableGremlinResourcesListResult", + className: "RestorableMongodbResourcesListResult", modelProperties: { value: { serializedName: "value", @@ -5922,7 +6890,7 @@ export const RestorableGremlinResourcesListResult: coreClient.CompositeMapper = element: { type: { name: "Composite", - className: "RestorableGremlinResourcesGetResult", + className: "RestorableMongodbResourcesGetResult", }, }, }, @@ -5931,10 +6899,10 @@ export const RestorableGremlinResourcesListResult: coreClient.CompositeMapper = }, }; -export const RestorableGremlinResourcesGetResult: coreClient.CompositeMapper = { +export const RestorableMongodbResourcesGetResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableGremlinResourcesGetResult", + className: "RestorableMongodbResourcesGetResult", modelProperties: { id: { serializedName: "id", @@ -5963,8 +6931,8 @@ export const RestorableGremlinResourcesGetResult: coreClient.CompositeMapper = { name: "String", }, }, - graphNames: { - serializedName: "graphNames", + collectionNames: { + serializedName: "collectionNames", type: { name: "Sequence", element: { @@ -5978,32 +6946,33 @@ export const RestorableGremlinResourcesGetResult: coreClient.CompositeMapper = { }, }; -export const RestorableTablesListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RestorableTablesListResult", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RestorableTableGetResult", +export const RestorableGremlinDatabasesListResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RestorableGremlinDatabasesListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RestorableGremlinDatabaseGetResult", + }, }, }, }, }, }, - }, -}; + }; -export const RestorableTableGetResult: coreClient.CompositeMapper = { +export const RestorableGremlinDatabaseGetResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableTableGetResult", + className: "RestorableGremlinDatabaseGetResult", modelProperties: { id: { serializedName: "id", @@ -6030,49 +6999,355 @@ export const RestorableTableGetResult: coreClient.CompositeMapper = { serializedName: "properties.resource", type: { name: "Composite", - className: "RestorableTablePropertiesResource", + className: "RestorableGremlinDatabasePropertiesResource", }, }, }, }, }; -export const RestorableTablePropertiesResource: coreClient.CompositeMapper = { +export const RestorableGremlinDatabasePropertiesResource: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RestorableGremlinDatabasePropertiesResource", + modelProperties: { + rid: { + serializedName: "_rid", + readOnly: true, + type: { + name: "String", + }, + }, + operationType: { + serializedName: "operationType", + readOnly: true, + type: { + name: "String", + }, + }, + canUndelete: { + serializedName: "canUndelete", + readOnly: true, + type: { + name: "String", + }, + }, + canUndeleteReason: { + serializedName: "canUndeleteReason", + readOnly: true, + type: { + name: "String", + }, + }, + eventTimestamp: { + serializedName: "eventTimestamp", + readOnly: true, + type: { + name: "String", + }, + }, + ownerId: { + serializedName: "ownerId", + readOnly: true, + type: { + name: "String", + }, + }, + ownerResourceId: { + serializedName: "ownerResourceId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const RestorableGremlinGraphsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "RestorableTablePropertiesResource", + className: "RestorableGremlinGraphsListResult", modelProperties: { - rid: { - serializedName: "_rid", + value: { + serializedName: "value", readOnly: true, type: { - name: "String", + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RestorableGremlinGraphGetResult", + }, + }, }, }, - operationType: { - serializedName: "operationType", + }, + }, +}; + +export const RestorableGremlinGraphGetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableGremlinGraphGetResult", + modelProperties: { + id: { + serializedName: "id", readOnly: true, type: { name: "String", }, }, - canUndelete: { - serializedName: "canUndelete", + name: { + serializedName: "name", readOnly: true, type: { name: "String", }, }, - canUndeleteReason: { - serializedName: "canUndeleteReason", + type: { + serializedName: "type", readOnly: true, type: { name: "String", }, }, - eventTimestamp: { - serializedName: "eventTimestamp", - readOnly: true, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "RestorableGremlinGraphPropertiesResource", + }, + }, + }, + }, +}; + +export const RestorableGremlinGraphPropertiesResource: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RestorableGremlinGraphPropertiesResource", + modelProperties: { + rid: { + serializedName: "_rid", + readOnly: true, + type: { + name: "String", + }, + }, + operationType: { + serializedName: "operationType", + readOnly: true, + type: { + name: "String", + }, + }, + canUndelete: { + serializedName: "canUndelete", + readOnly: true, + type: { + name: "String", + }, + }, + canUndeleteReason: { + serializedName: "canUndeleteReason", + readOnly: true, + type: { + name: "String", + }, + }, + eventTimestamp: { + serializedName: "eventTimestamp", + readOnly: true, + type: { + name: "String", + }, + }, + ownerId: { + serializedName: "ownerId", + readOnly: true, + type: { + name: "String", + }, + }, + ownerResourceId: { + serializedName: "ownerResourceId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const RestorableGremlinResourcesListResult: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "RestorableGremlinResourcesListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RestorableGremlinResourcesGetResult", + }, + }, + }, + }, + }, + }, + }; + +export const RestorableGremlinResourcesGetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableGremlinResourcesGetResult", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + databaseName: { + serializedName: "databaseName", + type: { + name: "String", + }, + }, + graphNames: { + serializedName: "graphNames", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const RestorableTablesListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableTablesListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RestorableTableGetResult", + }, + }, + }, + }, + }, + }, +}; + +export const RestorableTableGetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableTableGetResult", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "RestorableTablePropertiesResource", + }, + }, + }, + }, +}; + +export const RestorableTablePropertiesResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableTablePropertiesResource", + modelProperties: { + rid: { + serializedName: "_rid", + readOnly: true, + type: { + name: "String", + }, + }, + operationType: { + serializedName: "operationType", + readOnly: true, + type: { + name: "String", + }, + }, + canUndelete: { + serializedName: "canUndelete", + readOnly: true, + type: { + name: "String", + }, + }, + canUndeleteReason: { + serializedName: "canUndeleteReason", + readOnly: true, + type: { + name: "String", + }, + }, + eventTimestamp: { + serializedName: "eventTimestamp", + readOnly: true, type: { name: "String", }, @@ -6275,21 +7550,195 @@ export const ServiceResourceCreateUpdateProperties: coreClient.CompositeMapper = }, }; -export const PeriodicModeProperties: coreClient.CompositeMapper = { +export const ThroughputPoolsListResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PeriodicModeProperties", + className: "ThroughputPoolsListResult", modelProperties: { - backupIntervalInMinutes: { - constraints: { - InclusiveMinimum: 0, + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ThroughputPoolResource", + }, + }, }, - serializedName: "backupIntervalInMinutes", + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, type: { - name: "Number", + name: "String", }, }, - backupRetentionIntervalInHours: { + }, + }, +}; + +export const ThroughputPoolUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ThroughputPoolUpdate", + modelProperties: { + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String", + }, + }, + maxThroughput: { + serializedName: "properties.maxThroughput", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const ThroughputPoolAccountsListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ThroughputPoolAccountsListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ThroughputPoolAccountResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PermissionAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PermissionAutoGenerated", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String", + }, + }, + dataActions: { + serializedName: "dataActions", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + notDataActions: { + serializedName: "notDataActions", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + }, + }, +}; + +export const TableRoleDefinitionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TableRoleDefinitionListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TableRoleDefinitionResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TableRoleAssignmentListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TableRoleAssignmentListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TableRoleAssignmentResource", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PeriodicModeProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PeriodicModeProperties", + modelProperties: { + backupIntervalInMinutes: { + constraints: { + InclusiveMinimum: 0, + }, + serializedName: "backupIntervalInMinutes", + type: { + name: "Number", + }, + }, + backupRetentionIntervalInHours: { constraints: { InclusiveMinimum: 0, }, @@ -6418,6 +7867,35 @@ export const MaterializedViewsBuilderServiceResource: coreClient.CompositeMapper }, }; +export const ThroughputPoolAccountCreateParameters: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "ThroughputPoolAccountCreateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + accountResourceIdentifier: { + serializedName: "properties.accountResourceIdentifier", + type: { + name: "String", + }, + }, + accountLocation: { + serializedName: "properties.accountLocation", + type: { + name: "String", + }, + }, + }, + }, + }; + export const ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -6428,6 +7906,30 @@ export const ProxyResource: coreClient.CompositeMapper = { }, }; +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + export const RestoreParameters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -6475,6 +7977,12 @@ export const RestoreParameters: coreClient.CompositeMapper = { }, }, }, + sourceBackupLocation: { + serializedName: "sourceBackupLocation", + type: { + name: "String", + }, + }, }, }, }; @@ -6541,13 +8049,6 @@ export const DatabaseAccountGetResults: coreClient.CompositeMapper = { name: "String", }, }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ManagedServiceIdentity", - }, - }, systemData: { serializedName: "systemData", type: { @@ -6823,6 +8324,13 @@ export const DatabaseAccountGetResults: coreClient.CompositeMapper = { }, }, }, + diagnosticLogSettings: { + serializedName: "properties.diagnosticLogSettings", + type: { + name: "Composite", + className: "DiagnosticLogSettings", + }, + }, disableLocalAuth: { serializedName: "properties.disableLocalAuth", type: { @@ -6836,6 +8344,25 @@ export const DatabaseAccountGetResults: coreClient.CompositeMapper = { className: "Capacity", }, }, + capacityMode: { + serializedName: "properties.capacityMode", + type: { + name: "String", + }, + }, + capacityModeChangeTransitionState: { + serializedName: "properties.capacityModeChangeTransitionState", + type: { + name: "Composite", + className: "CapacityModeChangeTransitionState", + }, + }, + enableMaterializedViews: { + serializedName: "properties.enableMaterializedViews", + type: { + name: "Boolean", + }, + }, keysMetadata: { serializedName: "properties.keysMetadata", type: { @@ -6849,20 +8376,32 @@ export const DatabaseAccountGetResults: coreClient.CompositeMapper = { name: "Boolean", }, }, + enableBurstCapacity: { + serializedName: "properties.enableBurstCapacity", + type: { + name: "Boolean", + }, + }, minimalTlsVersion: { serializedName: "properties.minimalTlsVersion", type: { name: "String", }, }, - enableBurstCapacity: { - serializedName: "properties.enableBurstCapacity", + customerManagedKeyStatus: { + serializedName: "properties.customerManagedKeyStatus", + type: { + name: "String", + }, + }, + enablePriorityBasedExecution: { + serializedName: "properties.enablePriorityBasedExecution", type: { name: "Boolean", }, }, - customerManagedKeyStatus: { - serializedName: "properties.customerManagedKeyStatus", + defaultPriorityLevel: { + serializedName: "properties.defaultPriorityLevel", type: { name: "String", }, @@ -6890,13 +8429,6 @@ export const DatabaseAccountCreateUpdateParameters: coreClient.CompositeMapper = name: "String", }, }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ManagedServiceIdentity", - }, - }, consistencyPolicy: { serializedName: "properties.consistencyPolicy", type: { @@ -7085,6 +8617,13 @@ export const DatabaseAccountCreateUpdateParameters: coreClient.CompositeMapper = }, }, }, + diagnosticLogSettings: { + serializedName: "properties.diagnosticLogSettings", + type: { + name: "Composite", + className: "DiagnosticLogSettings", + }, + }, disableLocalAuth: { serializedName: "properties.disableLocalAuth", type: { @@ -7105,6 +8644,18 @@ export const DatabaseAccountCreateUpdateParameters: coreClient.CompositeMapper = className: "Capacity", }, }, + capacityMode: { + serializedName: "properties.capacityMode", + type: { + name: "String", + }, + }, + enableMaterializedViews: { + serializedName: "properties.enableMaterializedViews", + type: { + name: "Boolean", + }, + }, keysMetadata: { serializedName: "properties.keysMetadata", type: { @@ -7118,20 +8669,32 @@ export const DatabaseAccountCreateUpdateParameters: coreClient.CompositeMapper = name: "Boolean", }, }, + enableBurstCapacity: { + serializedName: "properties.enableBurstCapacity", + type: { + name: "Boolean", + }, + }, minimalTlsVersion: { serializedName: "properties.minimalTlsVersion", type: { name: "String", }, }, - enableBurstCapacity: { - serializedName: "properties.enableBurstCapacity", + customerManagedKeyStatus: { + serializedName: "properties.customerManagedKeyStatus", + type: { + name: "String", + }, + }, + enablePriorityBasedExecution: { + serializedName: "properties.enablePriorityBasedExecution", type: { name: "Boolean", }, }, - customerManagedKeyStatus: { - serializedName: "properties.customerManagedKeyStatus", + defaultPriorityLevel: { + serializedName: "properties.defaultPriorityLevel", type: { name: "String", }, @@ -7146,6 +8709,54 @@ export const DatabaseAccountCreateUpdateParameters: coreClient.CompositeMapper = }, }; +export const GraphResourceGetResults: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GraphResourceGetResults", + modelProperties: { + ...ARMResourceProperties.type.modelProperties, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "GraphResourceGetPropertiesResource", + }, + }, + options: { + serializedName: "properties.options", + type: { + name: "Composite", + className: "GraphResourceGetPropertiesOptions", + }, + }, + }, + }, +}; + +export const GraphResourceCreateUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GraphResourceCreateUpdateParameters", + modelProperties: { + ...ARMResourceProperties.type.modelProperties, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "GraphResource", + }, + }, + options: { + serializedName: "properties.options", + type: { + name: "Composite", + className: "CreateUpdateOptions", + }, + }, + }, + }, +}; + export const SqlDatabaseGetResults: coreClient.CompositeMapper = { type: { name: "Composite", @@ -7276,6 +8887,59 @@ 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", @@ -7742,6 +9406,54 @@ export const GremlinGraphCreateUpdateParameters: coreClient.CompositeMapper = { }, }; +export const CassandraViewGetResults: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CassandraViewGetResults", + modelProperties: { + ...ARMResourceProperties.type.modelProperties, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "CassandraViewGetPropertiesResource", + }, + }, + options: { + serializedName: "properties.options", + type: { + name: "Composite", + className: "CassandraViewGetPropertiesOptions", + }, + }, + }, + }, +}; + +export const CassandraViewCreateUpdateParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CassandraViewCreateUpdateParameters", + modelProperties: { + ...ARMResourceProperties.type.modelProperties, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "CassandraViewResource", + }, + }, + options: { + serializedName: "properties.options", + type: { + name: "Composite", + className: "CreateUpdateOptions", + }, + }, + }, + }, +}; + export const DatabaseAccountListKeysResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -7873,6 +9585,128 @@ export const PartitionUsage: coreClient.CompositeMapper = { }, }; +export const GraphResourceGetPropertiesResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GraphResourceGetPropertiesResource", + modelProperties: { + ...GraphResource.type.modelProperties, + }, + }, +}; + +export const GraphResourceGetPropertiesOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GraphResourceGetPropertiesOptions", + modelProperties: { + ...OptionsResource.type.modelProperties, + }, + }, +}; + +export const SqlDatabaseGetPropertiesOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlDatabaseGetPropertiesOptions", + modelProperties: { + ...OptionsResource.type.modelProperties, + }, + }, +}; + +export const SqlContainerGetPropertiesOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlContainerGetPropertiesOptions", + modelProperties: { + ...OptionsResource.type.modelProperties, + }, + }, +}; + +export const MongoDBDatabaseGetPropertiesOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MongoDBDatabaseGetPropertiesOptions", + modelProperties: { + ...OptionsResource.type.modelProperties, + }, + }, +}; + +export const MongoDBCollectionGetPropertiesOptions: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "MongoDBCollectionGetPropertiesOptions", + modelProperties: { + ...OptionsResource.type.modelProperties, + }, + }, + }; + +export const TableGetPropertiesOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TableGetPropertiesOptions", + modelProperties: { + ...OptionsResource.type.modelProperties, + }, + }, +}; + +export const CassandraKeyspaceGetPropertiesOptions: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "CassandraKeyspaceGetPropertiesOptions", + modelProperties: { + ...OptionsResource.type.modelProperties, + }, + }, + }; + +export const CassandraTableGetPropertiesOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CassandraTableGetPropertiesOptions", + modelProperties: { + ...OptionsResource.type.modelProperties, + }, + }, +}; + +export const GremlinDatabaseGetPropertiesOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GremlinDatabaseGetPropertiesOptions", + modelProperties: { + ...OptionsResource.type.modelProperties, + }, + }, +}; + +export const GremlinGraphGetPropertiesOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GremlinGraphGetPropertiesOptions", + modelProperties: { + ...OptionsResource.type.modelProperties, + }, + }, +}; + +export const CassandraViewGetPropertiesOptions: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CassandraViewGetPropertiesOptions", + modelProperties: { + ...OptionsResource.type.modelProperties, + }, + }, +}; + export const SqlDatabaseGetPropertiesResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -7941,17 +9775,6 @@ export const ThroughputSettingsGetPropertiesResource: coreClient.CompositeMapper }, }; -export const SqlContainerGetPropertiesResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SqlContainerGetPropertiesResource", - modelProperties: { - ...SqlContainerResource.type.modelProperties, - ...ExtendedResourceProperties.type.modelProperties, - }, - }, -}; - export const ClientEncryptionKeyGetPropertiesResource: coreClient.CompositeMapper = { type: { @@ -7964,6 +9787,17 @@ export const ClientEncryptionKeyGetPropertiesResource: coreClient.CompositeMappe }, }; +export const SqlContainerGetPropertiesResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SqlContainerGetPropertiesResource", + modelProperties: { + ...SqlContainerResource.type.modelProperties, + ...ExtendedResourceProperties.type.modelProperties, + }, + }, +}; + export const SqlStoredProcedureGetPropertiesResource: coreClient.CompositeMapper = { type: { @@ -8080,6 +9914,17 @@ export const GremlinGraphGetPropertiesResource: coreClient.CompositeMapper = { }, }; +export const CassandraViewGetPropertiesResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CassandraViewGetPropertiesResource", + modelProperties: { + ...CassandraViewResource.type.modelProperties, + ...ExtendedResourceProperties.type.modelProperties, + }, + }, +}; + export const RestorableSqlContainerPropertiesResourceContainer: coreClient.CompositeMapper = { type: { @@ -8099,126 +9944,139 @@ export const RestorableSqlContainerPropertiesResourceContainer: coreClient.Compo }, }; -export const SqlDatabaseGetPropertiesOptions: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SqlDatabaseGetPropertiesOptions", - modelProperties: { - ...OptionsResource.type.modelProperties, - }, - }, -}; - -export const SqlContainerGetPropertiesOptions: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SqlContainerGetPropertiesOptions", - modelProperties: { - ...OptionsResource.type.modelProperties, - }, - }, -}; - -export const MongoDBDatabaseGetPropertiesOptions: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MongoDBDatabaseGetPropertiesOptions", - modelProperties: { - ...OptionsResource.type.modelProperties, - }, - }, -}; - -export const MongoDBCollectionGetPropertiesOptions: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "MongoDBCollectionGetPropertiesOptions", - modelProperties: { - ...OptionsResource.type.modelProperties, - }, - }, - }; - -export const TableGetPropertiesOptions: coreClient.CompositeMapper = { +export const ClientEncryptionKeyGetResults: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TableGetPropertiesOptions", + className: "ClientEncryptionKeyGetResults", modelProperties: { - ...OptionsResource.type.modelProperties, - }, - }, -}; - -export const CassandraKeyspaceGetPropertiesOptions: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "CassandraKeyspaceGetPropertiesOptions", - modelProperties: { - ...OptionsResource.type.modelProperties, + ...ARMProxyResource.type.modelProperties, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "ClientEncryptionKeyGetPropertiesResource", + }, }, }, - }; - -export const CassandraTableGetPropertiesOptions: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CassandraTableGetPropertiesOptions", - modelProperties: { - ...OptionsResource.type.modelProperties, - }, - }, -}; - -export const GremlinDatabaseGetPropertiesOptions: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GremlinDatabaseGetPropertiesOptions", - modelProperties: { - ...OptionsResource.type.modelProperties, - }, }, }; -export const GremlinGraphGetPropertiesOptions: coreClient.CompositeMapper = { +export const LocationGetResult: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GremlinGraphGetPropertiesOptions", + className: "LocationGetResult", modelProperties: { - ...OptionsResource.type.modelProperties, + ...ARMProxyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "LocationProperties", + }, + }, }, }, }; -export const ClientEncryptionKeyGetResults: coreClient.CompositeMapper = { +export const CreateJobRequest: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ClientEncryptionKeyGetResults", + className: "CreateJobRequest", modelProperties: { ...ARMProxyResource.type.modelProperties, - resource: { - serializedName: "properties.resource", + properties: { + serializedName: "properties", type: { name: "Composite", - className: "ClientEncryptionKeyGetPropertiesResource", + className: "DataTransferJobProperties", }, }, }, }, }; -export const LocationGetResult: coreClient.CompositeMapper = { +export const DataTransferJobGetResults: coreClient.CompositeMapper = { type: { name: "Composite", - className: "LocationGetResult", + className: "DataTransferJobGetResults", modelProperties: { ...ARMProxyResource.type.modelProperties, - properties: { - serializedName: "properties", + jobName: { + serializedName: "properties.jobName", + readOnly: true, + type: { + name: "String", + }, + }, + source: { + serializedName: "properties.source", type: { name: "Composite", - className: "LocationProperties", + className: "DataTransferDataSourceSink", + }, + }, + destination: { + serializedName: "properties.destination", + type: { + name: "Composite", + className: "DataTransferDataSourceSink", + }, + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String", + }, + }, + processedCount: { + serializedName: "properties.processedCount", + readOnly: true, + type: { + name: "Number", + }, + }, + totalCount: { + serializedName: "properties.totalCount", + readOnly: true, + type: { + name: "Number", + }, + }, + lastUpdatedUtcTime: { + serializedName: "properties.lastUpdatedUtcTime", + readOnly: true, + type: { + name: "DateTime", + }, + }, + workerCount: { + constraints: { + InclusiveMinimum: 0, + }, + serializedName: "properties.workerCount", + type: { + name: "Number", + }, + }, + error: { + serializedName: "properties.error", + type: { + name: "Composite", + className: "ErrorResponse", + }, + }, + duration: { + serializedName: "properties.duration", + readOnly: true, + type: { + name: "String", + }, + }, + mode: { + serializedName: "properties.mode", + type: { + name: "String", }, }, }, @@ -8514,87 +10372,189 @@ export const ServiceResource: coreClient.CompositeMapper = { }, }; -export const ClusterResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ClusterResource", - modelProperties: { - ...ManagedCassandraARMResourceProperties.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ClusterResourceProperties", - }, +export const PhysicalPartitionThroughputInfoResultPropertiesResource: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "PhysicalPartitionThroughputInfoResultPropertiesResource", + modelProperties: { + ...PhysicalPartitionThroughputInfoProperties.type.modelProperties, }, }, - }, -}; + }; -export const DataTransferServiceResourceProperties: coreClient.CompositeMapper = +export const BaseCosmosDataTransferDataSourceSink: coreClient.CompositeMapper = { - serializedName: "DataTransfer", + serializedName: "BaseCosmosDataTransferDataSourceSink", type: { name: "Composite", - className: "DataTransferServiceResourceProperties", - uberParent: "ServiceResourceProperties", - additionalProperties: { type: { name: "Object" } }, - polymorphicDiscriminator: - ServiceResourceProperties.type.polymorphicDiscriminator, + className: "BaseCosmosDataTransferDataSourceSink", + uberParent: "DataTransferDataSourceSink", + polymorphicDiscriminator: { + serializedName: "component", + clientName: "component", + }, modelProperties: { - ...ServiceResourceProperties.type.modelProperties, - locations: { - serializedName: "locations", - readOnly: true, + ...DataTransferDataSourceSink.type.modelProperties, + remoteAccountName: { + serializedName: "remoteAccountName", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataTransferRegionalServiceResource", - }, - }, + name: "String", }, }, }, }, }; -export const SqlDedicatedGatewayServiceResourceProperties: coreClient.CompositeMapper = +export const CosmosMongoVCoreDataTransferDataSourceSink: coreClient.CompositeMapper = { - serializedName: "SqlDedicatedGateway", + serializedName: "CosmosDBMongoVCore", type: { name: "Composite", - className: "SqlDedicatedGatewayServiceResourceProperties", - uberParent: "ServiceResourceProperties", - additionalProperties: { type: { name: "Object" } }, + className: "CosmosMongoVCoreDataTransferDataSourceSink", + uberParent: "DataTransferDataSourceSink", polymorphicDiscriminator: - ServiceResourceProperties.type.polymorphicDiscriminator, + DataTransferDataSourceSink.type.polymorphicDiscriminator, modelProperties: { - ...ServiceResourceProperties.type.modelProperties, - sqlDedicatedGatewayEndpoint: { - serializedName: "sqlDedicatedGatewayEndpoint", + ...DataTransferDataSourceSink.type.modelProperties, + databaseName: { + serializedName: "databaseName", + required: true, type: { name: "String", }, }, - dedicatedGatewayType: { - serializedName: "dedicatedGatewayType", + collectionName: { + serializedName: "collectionName", + required: true, type: { name: "String", }, }, - locations: { - serializedName: "locations", - readOnly: true, + hostName: { + serializedName: "hostName", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SqlDedicatedGatewayRegionalServiceResource", - }, - }, + name: "String", + }, + }, + connectionStringKeyVaultUri: { + serializedName: "connectionStringKeyVaultUri", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const AzureBlobDataTransferDataSourceSink: coreClient.CompositeMapper = { + serializedName: "AzureBlobStorage", + type: { + name: "Composite", + className: "AzureBlobDataTransferDataSourceSink", + uberParent: "DataTransferDataSourceSink", + polymorphicDiscriminator: + DataTransferDataSourceSink.type.polymorphicDiscriminator, + modelProperties: { + ...DataTransferDataSourceSink.type.modelProperties, + containerName: { + serializedName: "containerName", + required: true, + type: { + name: "String", + }, + }, + endpointUrl: { + serializedName: "endpointUrl", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ClusterResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterResource", + modelProperties: { + ...ManagedCassandraARMResourceProperties.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ClusterResourceProperties", + }, + }, + }, + }, +}; + +export const DataTransferServiceResourceProperties: coreClient.CompositeMapper = + { + serializedName: "DataTransfer", + type: { + name: "Composite", + className: "DataTransferServiceResourceProperties", + uberParent: "ServiceResourceProperties", + additionalProperties: { type: { name: "Object" } }, + polymorphicDiscriminator: + ServiceResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...ServiceResourceProperties.type.modelProperties, + locations: { + serializedName: "locations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataTransferRegionalServiceResource", + }, + }, + }, + }, + }, + }, + }; + +export const SqlDedicatedGatewayServiceResourceProperties: coreClient.CompositeMapper = + { + serializedName: "SqlDedicatedGateway", + type: { + name: "Composite", + className: "SqlDedicatedGatewayServiceResourceProperties", + uberParent: "ServiceResourceProperties", + additionalProperties: { type: { name: "Object" } }, + polymorphicDiscriminator: + ServiceResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...ServiceResourceProperties.type.modelProperties, + sqlDedicatedGatewayEndpoint: { + serializedName: "sqlDedicatedGatewayEndpoint", + type: { + name: "String", + }, + }, + dedicatedGatewayType: { + serializedName: "dedicatedGatewayType", + type: { + name: "String", + }, + }, + locations: { + serializedName: "locations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SqlDedicatedGatewayRegionalServiceResource", + }, + }, }, }, }, @@ -8619,80 +10579,954 @@ export const GraphAPIComputeServiceResourceProperties: coreClient.CompositeMappe name: "String", }, }, - locations: { - serializedName: "locations", - readOnly: true, + locations: { + serializedName: "locations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GraphAPIComputeRegionalServiceResource", + }, + }, + }, + }, + }, + }, + }; + +export const MaterializedViewsBuilderServiceResourceProperties: coreClient.CompositeMapper = + { + serializedName: "MaterializedViewsBuilder", + type: { + name: "Composite", + className: "MaterializedViewsBuilderServiceResourceProperties", + uberParent: "ServiceResourceProperties", + additionalProperties: { type: { name: "Object" } }, + polymorphicDiscriminator: + ServiceResourceProperties.type.polymorphicDiscriminator, + modelProperties: { + ...ServiceResourceProperties.type.modelProperties, + locations: { + serializedName: "locations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MaterializedViewsBuilderRegionalServiceResource", + }, + }, + }, + }, + }, + }, + }; + +export const DataTransferServiceResourceCreateUpdateProperties: coreClient.CompositeMapper = + { + serializedName: "DataTransfer", + type: { + name: "Composite", + className: "DataTransferServiceResourceCreateUpdateProperties", + uberParent: "ServiceResourceCreateUpdateProperties", + polymorphicDiscriminator: + ServiceResourceCreateUpdateProperties.type.polymorphicDiscriminator, + modelProperties: { + ...ServiceResourceCreateUpdateProperties.type.modelProperties, + }, + }, + }; + +export const SqlDedicatedGatewayServiceResourceCreateUpdateProperties: coreClient.CompositeMapper = + { + serializedName: "SqlDedicatedGateway", + type: { + name: "Composite", + className: "SqlDedicatedGatewayServiceResourceCreateUpdateProperties", + uberParent: "ServiceResourceCreateUpdateProperties", + polymorphicDiscriminator: + ServiceResourceCreateUpdateProperties.type.polymorphicDiscriminator, + modelProperties: { + ...ServiceResourceCreateUpdateProperties.type.modelProperties, + dedicatedGatewayType: { + serializedName: "dedicatedGatewayType", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const GraphAPIComputeServiceResourceCreateUpdateProperties: coreClient.CompositeMapper = + { + serializedName: "GraphAPICompute", + type: { + name: "Composite", + className: "GraphAPIComputeServiceResourceCreateUpdateProperties", + uberParent: "ServiceResourceCreateUpdateProperties", + polymorphicDiscriminator: + ServiceResourceCreateUpdateProperties.type.polymorphicDiscriminator, + modelProperties: { + ...ServiceResourceCreateUpdateProperties.type.modelProperties, + }, + }, + }; + +export const MaterializedViewsBuilderServiceResourceCreateUpdateProperties: coreClient.CompositeMapper = + { + serializedName: "MaterializedViewsBuilder", + type: { + name: "Composite", + className: + "MaterializedViewsBuilderServiceResourceCreateUpdateProperties", + uberParent: "ServiceResourceCreateUpdateProperties", + polymorphicDiscriminator: + ServiceResourceCreateUpdateProperties.type.polymorphicDiscriminator, + modelProperties: { + ...ServiceResourceCreateUpdateProperties.type.modelProperties, + }, + }, + }; + +export const DataTransferRegionalServiceResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataTransferRegionalServiceResource", + modelProperties: { + ...RegionalServiceResource.type.modelProperties, + }, + }, +}; + +export const SqlDedicatedGatewayRegionalServiceResource: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlDedicatedGatewayRegionalServiceResource", + modelProperties: { + ...RegionalServiceResource.type.modelProperties, + sqlDedicatedGatewayEndpoint: { + serializedName: "sqlDedicatedGatewayEndpoint", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const GraphAPIComputeRegionalServiceResource: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GraphAPIComputeRegionalServiceResource", + modelProperties: { + ...RegionalServiceResource.type.modelProperties, + graphApiComputeEndpoint: { + serializedName: "graphApiComputeEndpoint", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const MaterializedViewsBuilderRegionalServiceResource: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "MaterializedViewsBuilderRegionalServiceResource", + modelProperties: { + ...RegionalServiceResource.type.modelProperties, + }, + }, + }; + +export const ChaosFaultResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ChaosFaultResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + action: { + serializedName: "properties.action", + type: { + name: "Enum", + allowedValues: ["Enable", "Disable"], + }, + }, + region: { + serializedName: "properties.region", + type: { + name: "String", + }, + }, + databaseName: { + serializedName: "properties.databaseName", + type: { + name: "String", + }, + }, + containerName: { + serializedName: "properties.containerName", + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...ProxyResource.type.modelProperties, + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpointProperty", + }, + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionStateProperty", + }, + }, + groupId: { + serializedName: "properties.groupId", + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const NetworkSecurityPerimeterConfiguration: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfiguration", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "NetworkSecurityPerimeterConfigurationProperties", + }, + }, + }, + }, + }; + +export const ThroughputPoolAccountResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ThroughputPoolAccountResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String", + }, + }, + accountResourceIdentifier: { + serializedName: "properties.accountResourceIdentifier", + type: { + name: "String", + }, + }, + accountLocation: { + serializedName: "properties.accountLocation", + type: { + name: "String", + }, + }, + accountInstanceId: { + serializedName: "properties.accountInstanceId", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TableRoleDefinitionResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TableRoleDefinitionResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + idPropertiesId: { + serializedName: "properties.id", + type: { + name: "String", + }, + }, + roleName: { + serializedName: "properties.roleName", + type: { + name: "String", + }, + }, + typePropertiesType: { + serializedName: "properties.type", + type: { + name: "Enum", + allowedValues: ["BuiltInRole", "CustomRole"], + }, + }, + assignableScopes: { + serializedName: "properties.assignableScopes", + type: { + name: "Sequence", + element: { + type: { + name: "String", + }, + }, + }, + }, + permissions: { + serializedName: "properties.permissions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PermissionAutoGenerated", + }, + }, + }, + }, + }, + }, +}; + +export const TableRoleAssignmentResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TableRoleAssignmentResource", + modelProperties: { + ...ProxyResource.type.modelProperties, + roleDefinitionId: { + serializedName: "properties.roleDefinitionId", + type: { + name: "String", + }, + }, + scope: { + serializedName: "properties.scope", + type: { + name: "String", + }, + }, + principalId: { + serializedName: "properties.principalId", + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ThroughputPoolResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ThroughputPoolResource", + modelProperties: { + ...TrackedResource.type.modelProperties, + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String", + }, + }, + maxThroughput: { + serializedName: "properties.maxThroughput", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CosmosCassandraDataTransferDataSourceSink: coreClient.CompositeMapper = + { + serializedName: "CosmosDBCassandra", + type: { + name: "Composite", + className: "CosmosCassandraDataTransferDataSourceSink", + uberParent: "BaseCosmosDataTransferDataSourceSink", + polymorphicDiscriminator: + BaseCosmosDataTransferDataSourceSink.type.polymorphicDiscriminator, + modelProperties: { + ...BaseCosmosDataTransferDataSourceSink.type.modelProperties, + keyspaceName: { + serializedName: "keyspaceName", + required: true, + type: { + name: "String", + }, + }, + tableName: { + serializedName: "tableName", + required: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const CosmosMongoDataTransferDataSourceSink: coreClient.CompositeMapper = + { + serializedName: "CosmosDBMongo", + type: { + name: "Composite", + className: "CosmosMongoDataTransferDataSourceSink", + uberParent: "BaseCosmosDataTransferDataSourceSink", + polymorphicDiscriminator: + BaseCosmosDataTransferDataSourceSink.type.polymorphicDiscriminator, + modelProperties: { + ...BaseCosmosDataTransferDataSourceSink.type.modelProperties, + databaseName: { + serializedName: "databaseName", + required: true, + type: { + name: "String", + }, + }, + collectionName: { + serializedName: "collectionName", + required: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const CosmosSqlDataTransferDataSourceSink: coreClient.CompositeMapper = { + serializedName: "CosmosDBSql", + type: { + name: "Composite", + className: "CosmosSqlDataTransferDataSourceSink", + uberParent: "BaseCosmosDataTransferDataSourceSink", + polymorphicDiscriminator: + BaseCosmosDataTransferDataSourceSink.type.polymorphicDiscriminator, + modelProperties: { + ...BaseCosmosDataTransferDataSourceSink.type.modelProperties, + databaseName: { + serializedName: "databaseName", + required: true, + type: { + name: "String", + }, + }, + containerName: { + serializedName: "containerName", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DatabaseAccountsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatabaseAccountsDeleteHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DatabaseAccountsFailoverPriorityChangeHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DatabaseAccountsFailoverPriorityChangeHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const DatabaseAccountsOfflineRegionHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DatabaseAccountsOfflineRegionHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const DatabaseAccountsOnlineRegionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatabaseAccountsOnlineRegionHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const DatabaseAccountsRegenerateKeyHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "DatabaseAccountsRegenerateKeyHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const GraphResourcesCreateUpdateGraphHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GraphResourcesCreateUpdateGraphHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const GraphResourcesDeleteGraphResourceHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GraphResourcesDeleteGraphResourceHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const SqlResourcesCreateUpdateSqlDatabaseHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesCreateUpdateSqlDatabaseHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const SqlResourcesDeleteSqlDatabaseHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesDeleteSqlDatabaseHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const SqlResourcesUpdateSqlDatabaseThroughputHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesUpdateSqlDatabaseThroughputHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const SqlResourcesCreateUpdateClientEncryptionKeyHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesCreateUpdateClientEncryptionKeyHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const SqlResourcesCreateUpdateSqlContainerHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesCreateUpdateSqlContainerHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const SqlResourcesDeleteSqlContainerHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesDeleteSqlContainerHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const SqlResourcesSqlDatabasePartitionMergeHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesSqlDatabasePartitionMergeHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const SqlResourcesListSqlContainerPartitionMergeHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesListSqlContainerPartitionMergeHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, + }; + +export const SqlResourcesUpdateSqlContainerThroughputHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesUpdateSqlContainerThroughputHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GraphAPIComputeRegionalServiceResource", - }, - }, + name: "String", }, }, }, }, }; -export const MaterializedViewsBuilderServiceResourceProperties: coreClient.CompositeMapper = +export const SqlResourcesMigrateSqlContainerToAutoscaleHeaders: coreClient.CompositeMapper = { - serializedName: "MaterializedViewsBuilder", type: { name: "Composite", - className: "MaterializedViewsBuilderServiceResourceProperties", - uberParent: "ServiceResourceProperties", - additionalProperties: { type: { name: "Object" } }, - polymorphicDiscriminator: - ServiceResourceProperties.type.polymorphicDiscriminator, + className: "SqlResourcesMigrateSqlContainerToAutoscaleHeaders", modelProperties: { - ...ServiceResourceProperties.type.modelProperties, - locations: { - serializedName: "locations", - readOnly: true, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MaterializedViewsBuilderRegionalServiceResource", - }, - }, + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", }, }, }, }, }; -export const DataTransferServiceResourceCreateUpdateProperties: coreClient.CompositeMapper = +export const SqlResourcesMigrateSqlContainerToManualThroughputHeaders: coreClient.CompositeMapper = { - serializedName: "DataTransfer", type: { name: "Composite", - className: "DataTransferServiceResourceCreateUpdateProperties", - uberParent: "ServiceResourceCreateUpdateProperties", - polymorphicDiscriminator: - ServiceResourceCreateUpdateProperties.type.polymorphicDiscriminator, + className: "SqlResourcesMigrateSqlContainerToManualThroughputHeaders", modelProperties: { - ...ServiceResourceCreateUpdateProperties.type.modelProperties, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, }, }, }; -export const SqlDedicatedGatewayServiceResourceCreateUpdateProperties: coreClient.CompositeMapper = +export const SqlResourcesSqlDatabaseRetrieveThroughputDistributionHeaders: coreClient.CompositeMapper = { - serializedName: "SqlDedicatedGateway", type: { name: "Composite", - className: "SqlDedicatedGatewayServiceResourceCreateUpdateProperties", - uberParent: "ServiceResourceCreateUpdateProperties", - polymorphicDiscriminator: - ServiceResourceCreateUpdateProperties.type.polymorphicDiscriminator, + className: "SqlResourcesSqlDatabaseRetrieveThroughputDistributionHeaders", modelProperties: { - ...ServiceResourceCreateUpdateProperties.type.modelProperties, - dedicatedGatewayType: { - serializedName: "dedicatedGatewayType", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", type: { name: "String", }, @@ -8701,57 +11535,65 @@ export const SqlDedicatedGatewayServiceResourceCreateUpdateProperties: coreClien }, }; -export const GraphAPIComputeServiceResourceCreateUpdateProperties: coreClient.CompositeMapper = +export const SqlResourcesSqlDatabaseRedistributeThroughputHeaders: coreClient.CompositeMapper = { - serializedName: "GraphAPICompute", type: { name: "Composite", - className: "GraphAPIComputeServiceResourceCreateUpdateProperties", - uberParent: "ServiceResourceCreateUpdateProperties", - polymorphicDiscriminator: - ServiceResourceCreateUpdateProperties.type.polymorphicDiscriminator, + className: "SqlResourcesSqlDatabaseRedistributeThroughputHeaders", modelProperties: { - ...ServiceResourceCreateUpdateProperties.type.modelProperties, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, }, }, }; -export const MaterializedViewsBuilderServiceResourceCreateUpdateProperties: coreClient.CompositeMapper = +export const SqlResourcesSqlContainerRetrieveThroughputDistributionHeaders: coreClient.CompositeMapper = { - serializedName: "MaterializedViewsBuilder", type: { name: "Composite", className: - "MaterializedViewsBuilderServiceResourceCreateUpdateProperties", - uberParent: "ServiceResourceCreateUpdateProperties", - polymorphicDiscriminator: - ServiceResourceCreateUpdateProperties.type.polymorphicDiscriminator, + "SqlResourcesSqlContainerRetrieveThroughputDistributionHeaders", modelProperties: { - ...ServiceResourceCreateUpdateProperties.type.modelProperties, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, }, }, }; -export const DataTransferRegionalServiceResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataTransferRegionalServiceResource", - modelProperties: { - ...RegionalServiceResource.type.modelProperties, - }, - }, -}; - -export const SqlDedicatedGatewayRegionalServiceResource: coreClient.CompositeMapper = +export const SqlResourcesSqlContainerRedistributeThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlDedicatedGatewayRegionalServiceResource", + className: "SqlResourcesSqlContainerRedistributeThroughputHeaders", modelProperties: { - ...RegionalServiceResource.type.modelProperties, - sqlDedicatedGatewayEndpoint: { - serializedName: "sqlDedicatedGatewayEndpoint", - readOnly: true, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", type: { name: "String", }, @@ -8760,16 +11602,20 @@ export const SqlDedicatedGatewayRegionalServiceResource: coreClient.CompositeMap }, }; -export const GraphAPIComputeRegionalServiceResource: coreClient.CompositeMapper = +export const SqlResourcesCreateUpdateSqlStoredProcedureHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GraphAPIComputeRegionalServiceResource", + className: "SqlResourcesCreateUpdateSqlStoredProcedureHeaders", modelProperties: { - ...RegionalServiceResource.type.modelProperties, - graphApiComputeEndpoint: { - serializedName: "graphApiComputeEndpoint", - readOnly: true, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", type: { name: "String", }, @@ -8778,79 +11624,55 @@ export const GraphAPIComputeRegionalServiceResource: coreClient.CompositeMapper }, }; -export const MaterializedViewsBuilderRegionalServiceResource: coreClient.CompositeMapper = +export const SqlResourcesDeleteSqlStoredProcedureHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MaterializedViewsBuilderRegionalServiceResource", + className: "SqlResourcesDeleteSqlStoredProcedureHeaders", modelProperties: { - ...RegionalServiceResource.type.modelProperties, - }, - }, - }; - -export const PrivateEndpointConnection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - modelProperties: { - ...ProxyResource.type.modelProperties, - privateEndpoint: { - serializedName: "properties.privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpointProperty", - }, - }, - privateLinkServiceConnectionState: { - serializedName: "properties.privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionStateProperty", - }, - }, - groupId: { - serializedName: "properties.groupId", - type: { - name: "String", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - type: { - name: "String", + location: { + serializedName: "location", + type: { + name: "String", + }, }, }, }, - }, -}; + }; -export const DatabaseAccountsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DatabaseAccountsDeleteHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", +export const SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, }, - }, - location: { - serializedName: "location", - type: { - name: "String", + location: { + serializedName: "location", + type: { + name: "String", + }, }, }, }, - }, -}; + }; -export const DatabaseAccountsFailoverPriorityChangeHeaders: coreClient.CompositeMapper = +export const SqlResourcesDeleteSqlUserDefinedFunctionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatabaseAccountsFailoverPriorityChangeHeaders", + className: "SqlResourcesDeleteSqlUserDefinedFunctionHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -8868,11 +11690,11 @@ export const DatabaseAccountsFailoverPriorityChangeHeaders: coreClient.Composite }, }; -export const DatabaseAccountsOfflineRegionHeaders: coreClient.CompositeMapper = +export const SqlResourcesCreateUpdateSqlTriggerHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatabaseAccountsOfflineRegionHeaders", + className: "SqlResourcesCreateUpdateSqlTriggerHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -8890,10 +11712,10 @@ export const DatabaseAccountsOfflineRegionHeaders: coreClient.CompositeMapper = }, }; -export const DatabaseAccountsOnlineRegionHeaders: coreClient.CompositeMapper = { +export const SqlResourcesDeleteSqlTriggerHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatabaseAccountsOnlineRegionHeaders", + className: "SqlResourcesDeleteSqlTriggerHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -8911,11 +11733,11 @@ export const DatabaseAccountsOnlineRegionHeaders: coreClient.CompositeMapper = { }, }; -export const DatabaseAccountsRegenerateKeyHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesCreateUpdateMongoDBDatabaseHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "DatabaseAccountsRegenerateKeyHeaders", + className: "MongoDBResourcesCreateUpdateMongoDBDatabaseHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -8933,11 +11755,11 @@ export const DatabaseAccountsRegenerateKeyHeaders: coreClient.CompositeMapper = }, }; -export const SqlResourcesCreateUpdateSqlDatabaseHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesDeleteMongoDBDatabaseHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesCreateUpdateSqlDatabaseHeaders", + className: "MongoDBResourcesDeleteMongoDBDatabaseHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -8955,11 +11777,11 @@ export const SqlResourcesCreateUpdateSqlDatabaseHeaders: coreClient.CompositeMap }, }; -export const SqlResourcesDeleteSqlDatabaseHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesUpdateMongoDBDatabaseThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesDeleteSqlDatabaseHeaders", + className: "MongoDBResourcesUpdateMongoDBDatabaseThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -8977,11 +11799,11 @@ export const SqlResourcesDeleteSqlDatabaseHeaders: coreClient.CompositeMapper = }, }; -export const SqlResourcesUpdateSqlDatabaseThroughputHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesUpdateSqlDatabaseThroughputHeaders", + className: "MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -8999,11 +11821,12 @@ export const SqlResourcesUpdateSqlDatabaseThroughputHeaders: coreClient.Composit }, }; -export const SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders", + className: + "MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9021,11 +11844,12 @@ export const SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders: coreClient.Compos }, }; -export const SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders", + className: + "MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9043,11 +11867,11 @@ export const SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders: coreClient }, }; -export const SqlResourcesCreateUpdateSqlContainerHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesMongoDBDatabaseRedistributeThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesCreateUpdateSqlContainerHeaders", + className: "MongoDBResourcesMongoDBDatabaseRedistributeThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9065,11 +11889,12 @@ export const SqlResourcesCreateUpdateSqlContainerHeaders: coreClient.CompositeMa }, }; -export const SqlResourcesDeleteSqlContainerHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesDeleteSqlContainerHeaders", + className: + "MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9087,11 +11912,12 @@ export const SqlResourcesDeleteSqlContainerHeaders: coreClient.CompositeMapper = }, }; -export const SqlResourcesUpdateSqlContainerThroughputHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesMongoDBContainerRedistributeThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesUpdateSqlContainerThroughputHeaders", + className: + "MongoDBResourcesMongoDBContainerRedistributeThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9109,11 +11935,11 @@ export const SqlResourcesUpdateSqlContainerThroughputHeaders: coreClient.Composi }, }; -export const SqlResourcesMigrateSqlContainerToAutoscaleHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesCreateUpdateMongoDBCollectionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesMigrateSqlContainerToAutoscaleHeaders", + className: "MongoDBResourcesCreateUpdateMongoDBCollectionHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9131,11 +11957,11 @@ export const SqlResourcesMigrateSqlContainerToAutoscaleHeaders: coreClient.Compo }, }; -export const SqlResourcesMigrateSqlContainerToManualThroughputHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesDeleteMongoDBCollectionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesMigrateSqlContainerToManualThroughputHeaders", + className: "MongoDBResourcesDeleteMongoDBCollectionHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9153,11 +11979,11 @@ export const SqlResourcesMigrateSqlContainerToManualThroughputHeaders: coreClien }, }; -export const SqlResourcesCreateUpdateClientEncryptionKeyHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesMongoDBDatabasePartitionMergeHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesCreateUpdateClientEncryptionKeyHeaders", + className: "MongoDBResourcesMongoDBDatabasePartitionMergeHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9175,11 +12001,11 @@ export const SqlResourcesCreateUpdateClientEncryptionKeyHeaders: coreClient.Comp }, }; -export const SqlResourcesCreateUpdateSqlStoredProcedureHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesListMongoDBCollectionPartitionMergeHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesCreateUpdateSqlStoredProcedureHeaders", + className: "MongoDBResourcesListMongoDBCollectionPartitionMergeHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9197,11 +12023,11 @@ export const SqlResourcesCreateUpdateSqlStoredProcedureHeaders: coreClient.Compo }, }; -export const SqlResourcesDeleteSqlStoredProcedureHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesDeleteSqlStoredProcedureHeaders", + className: "MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9219,11 +12045,11 @@ export const SqlResourcesDeleteSqlStoredProcedureHeaders: coreClient.CompositeMa }, }; -export const SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesMigrateMongoDBCollectionToAutoscaleHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders", + className: "MongoDBResourcesMigrateMongoDBCollectionToAutoscaleHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9241,11 +12067,12 @@ export const SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders: coreClient.C }, }; -export const SqlResourcesDeleteSqlUserDefinedFunctionHeaders: coreClient.CompositeMapper = +export const MongoDBResourcesMigrateMongoDBCollectionToManualThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesDeleteSqlUserDefinedFunctionHeaders", + className: + "MongoDBResourcesMigrateMongoDBCollectionToManualThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9263,11 +12090,11 @@ export const SqlResourcesDeleteSqlUserDefinedFunctionHeaders: coreClient.Composi }, }; -export const SqlResourcesCreateUpdateSqlTriggerHeaders: coreClient.CompositeMapper = +export const TableResourcesCreateUpdateTableHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesCreateUpdateSqlTriggerHeaders", + className: "TableResourcesCreateUpdateTableHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9285,10 +12112,10 @@ export const SqlResourcesCreateUpdateSqlTriggerHeaders: coreClient.CompositeMapp }, }; -export const SqlResourcesDeleteSqlTriggerHeaders: coreClient.CompositeMapper = { +export const TableResourcesDeleteTableHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SqlResourcesDeleteSqlTriggerHeaders", + className: "TableResourcesDeleteTableHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9306,11 +12133,11 @@ export const SqlResourcesDeleteSqlTriggerHeaders: coreClient.CompositeMapper = { }, }; -export const MongoDBResourcesCreateUpdateMongoDBDatabaseHeaders: coreClient.CompositeMapper = +export const TableResourcesUpdateTableThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MongoDBResourcesCreateUpdateMongoDBDatabaseHeaders", + className: "TableResourcesUpdateTableThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9328,11 +12155,11 @@ export const MongoDBResourcesCreateUpdateMongoDBDatabaseHeaders: coreClient.Comp }, }; -export const MongoDBResourcesDeleteMongoDBDatabaseHeaders: coreClient.CompositeMapper = +export const TableResourcesMigrateTableToAutoscaleHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MongoDBResourcesDeleteMongoDBDatabaseHeaders", + className: "TableResourcesMigrateTableToAutoscaleHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9350,11 +12177,11 @@ export const MongoDBResourcesDeleteMongoDBDatabaseHeaders: coreClient.CompositeM }, }; -export const MongoDBResourcesUpdateMongoDBDatabaseThroughputHeaders: coreClient.CompositeMapper = +export const TableResourcesMigrateTableToManualThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MongoDBResourcesUpdateMongoDBDatabaseThroughputHeaders", + className: "TableResourcesMigrateTableToManualThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9372,11 +12199,11 @@ export const MongoDBResourcesUpdateMongoDBDatabaseThroughputHeaders: coreClient. }, }; -export const MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleHeaders: coreClient.CompositeMapper = +export const TableResourcesCreateUpdateTableRoleDefinitionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleHeaders", + className: "TableResourcesCreateUpdateTableRoleDefinitionHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9394,12 +12221,11 @@ export const MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleHeaders: coreClien }, }; -export const MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputHeaders: coreClient.CompositeMapper = +export const TableResourcesDeleteTableRoleDefinitionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: - "MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputHeaders", + className: "TableResourcesDeleteTableRoleDefinitionHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9417,11 +12243,11 @@ export const MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputHeaders: co }, }; -export const MongoDBResourcesCreateUpdateMongoDBCollectionHeaders: coreClient.CompositeMapper = +export const TableResourcesCreateUpdateTableRoleAssignmentHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MongoDBResourcesCreateUpdateMongoDBCollectionHeaders", + className: "TableResourcesCreateUpdateTableRoleAssignmentHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9439,11 +12265,11 @@ export const MongoDBResourcesCreateUpdateMongoDBCollectionHeaders: coreClient.Co }, }; -export const MongoDBResourcesDeleteMongoDBCollectionHeaders: coreClient.CompositeMapper = +export const TableResourcesDeleteTableRoleAssignmentHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MongoDBResourcesDeleteMongoDBCollectionHeaders", + className: "TableResourcesDeleteTableRoleAssignmentHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9461,11 +12287,11 @@ export const MongoDBResourcesDeleteMongoDBCollectionHeaders: coreClient.Composit }, }; -export const MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders: coreClient.CompositeMapper = +export const CassandraResourcesCreateUpdateCassandraKeyspaceHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders", + className: "CassandraResourcesCreateUpdateCassandraKeyspaceHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9483,11 +12309,11 @@ export const MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders: coreClien }, }; -export const MongoDBResourcesMigrateMongoDBCollectionToAutoscaleHeaders: coreClient.CompositeMapper = +export const CassandraResourcesDeleteCassandraKeyspaceHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MongoDBResourcesMigrateMongoDBCollectionToAutoscaleHeaders", + className: "CassandraResourcesDeleteCassandraKeyspaceHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9505,12 +12331,11 @@ export const MongoDBResourcesMigrateMongoDBCollectionToAutoscaleHeaders: coreCli }, }; -export const MongoDBResourcesMigrateMongoDBCollectionToManualThroughputHeaders: coreClient.CompositeMapper = +export const CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: - "MongoDBResourcesMigrateMongoDBCollectionToManualThroughputHeaders", + className: "CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9528,11 +12353,11 @@ export const MongoDBResourcesMigrateMongoDBCollectionToManualThroughputHeaders: }, }; -export const TableResourcesCreateUpdateTableHeaders: coreClient.CompositeMapper = +export const CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TableResourcesCreateUpdateTableHeaders", + className: "CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9550,32 +12375,12 @@ export const TableResourcesCreateUpdateTableHeaders: coreClient.CompositeMapper }, }; -export const TableResourcesDeleteTableHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TableResourcesDeleteTableHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const TableResourcesUpdateTableThroughputHeaders: coreClient.CompositeMapper = +export const CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TableResourcesUpdateTableThroughputHeaders", + className: + "CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9593,11 +12398,11 @@ export const TableResourcesUpdateTableThroughputHeaders: coreClient.CompositeMap }, }; -export const TableResourcesMigrateTableToAutoscaleHeaders: coreClient.CompositeMapper = +export const CassandraResourcesCreateUpdateCassandraTableHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TableResourcesMigrateTableToAutoscaleHeaders", + className: "CassandraResourcesCreateUpdateCassandraTableHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9615,11 +12420,11 @@ export const TableResourcesMigrateTableToAutoscaleHeaders: coreClient.CompositeM }, }; -export const TableResourcesMigrateTableToManualThroughputHeaders: coreClient.CompositeMapper = +export const CassandraResourcesDeleteCassandraTableHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TableResourcesMigrateTableToManualThroughputHeaders", + className: "CassandraResourcesDeleteCassandraTableHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9637,11 +12442,11 @@ export const TableResourcesMigrateTableToManualThroughputHeaders: coreClient.Com }, }; -export const CassandraResourcesCreateUpdateCassandraKeyspaceHeaders: coreClient.CompositeMapper = +export const CassandraResourcesUpdateCassandraTableThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CassandraResourcesCreateUpdateCassandraKeyspaceHeaders", + className: "CassandraResourcesUpdateCassandraTableThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9659,11 +12464,11 @@ export const CassandraResourcesCreateUpdateCassandraKeyspaceHeaders: coreClient. }, }; -export const CassandraResourcesDeleteCassandraKeyspaceHeaders: coreClient.CompositeMapper = +export const CassandraResourcesMigrateCassandraTableToAutoscaleHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CassandraResourcesDeleteCassandraKeyspaceHeaders", + className: "CassandraResourcesMigrateCassandraTableToAutoscaleHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9681,11 +12486,12 @@ export const CassandraResourcesDeleteCassandraKeyspaceHeaders: coreClient.Compos }, }; -export const CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders: coreClient.CompositeMapper = +export const CassandraResourcesMigrateCassandraTableToManualThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders", + className: + "CassandraResourcesMigrateCassandraTableToManualThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9703,11 +12509,11 @@ export const CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders: coreCli }, }; -export const CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders: coreClient.CompositeMapper = +export const CassandraResourcesCreateUpdateCassandraViewHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders", + className: "CassandraResourcesCreateUpdateCassandraViewHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9725,12 +12531,11 @@ export const CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders: coreC }, }; -export const CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders: coreClient.CompositeMapper = +export const CassandraResourcesDeleteCassandraViewHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: - "CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders", + className: "CassandraResourcesDeleteCassandraViewHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9748,11 +12553,11 @@ export const CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders }, }; -export const CassandraResourcesCreateUpdateCassandraTableHeaders: coreClient.CompositeMapper = +export const CassandraResourcesUpdateCassandraViewThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CassandraResourcesCreateUpdateCassandraTableHeaders", + className: "CassandraResourcesUpdateCassandraViewThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9770,11 +12575,11 @@ export const CassandraResourcesCreateUpdateCassandraTableHeaders: coreClient.Com }, }; -export const CassandraResourcesDeleteCassandraTableHeaders: coreClient.CompositeMapper = +export const CassandraResourcesMigrateCassandraViewToAutoscaleHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CassandraResourcesDeleteCassandraTableHeaders", + className: "CassandraResourcesMigrateCassandraViewToAutoscaleHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9792,11 +12597,12 @@ export const CassandraResourcesDeleteCassandraTableHeaders: coreClient.Composite }, }; -export const CassandraResourcesUpdateCassandraTableThroughputHeaders: coreClient.CompositeMapper = +export const CassandraResourcesMigrateCassandraViewToManualThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CassandraResourcesUpdateCassandraTableThroughputHeaders", + className: + "CassandraResourcesMigrateCassandraViewToManualThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9814,11 +12620,11 @@ export const CassandraResourcesUpdateCassandraTableThroughputHeaders: coreClient }, }; -export const CassandraResourcesMigrateCassandraTableToAutoscaleHeaders: coreClient.CompositeMapper = +export const GremlinResourcesCreateUpdateGremlinDatabaseHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CassandraResourcesMigrateCassandraTableToAutoscaleHeaders", + className: "GremlinResourcesCreateUpdateGremlinDatabaseHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9836,12 +12642,11 @@ export const CassandraResourcesMigrateCassandraTableToAutoscaleHeaders: coreClie }, }; -export const CassandraResourcesMigrateCassandraTableToManualThroughputHeaders: coreClient.CompositeMapper = +export const GremlinResourcesDeleteGremlinDatabaseHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: - "CassandraResourcesMigrateCassandraTableToManualThroughputHeaders", + className: "GremlinResourcesDeleteGremlinDatabaseHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9859,11 +12664,11 @@ export const CassandraResourcesMigrateCassandraTableToManualThroughputHeaders: c }, }; -export const GremlinResourcesCreateUpdateGremlinDatabaseHeaders: coreClient.CompositeMapper = +export const GremlinResourcesUpdateGremlinDatabaseThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GremlinResourcesCreateUpdateGremlinDatabaseHeaders", + className: "GremlinResourcesUpdateGremlinDatabaseThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9881,11 +12686,11 @@ export const GremlinResourcesCreateUpdateGremlinDatabaseHeaders: coreClient.Comp }, }; -export const GremlinResourcesDeleteGremlinDatabaseHeaders: coreClient.CompositeMapper = +export const GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GremlinResourcesDeleteGremlinDatabaseHeaders", + className: "GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9903,11 +12708,12 @@ export const GremlinResourcesDeleteGremlinDatabaseHeaders: coreClient.CompositeM }, }; -export const GremlinResourcesUpdateGremlinDatabaseThroughputHeaders: coreClient.CompositeMapper = +export const GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GremlinResourcesUpdateGremlinDatabaseThroughputHeaders", + className: + "GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9925,11 +12731,11 @@ export const GremlinResourcesUpdateGremlinDatabaseThroughputHeaders: coreClient. }, }; -export const GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders: coreClient.CompositeMapper = +export const GremlinResourcesCreateUpdateGremlinGraphHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders", + className: "GremlinResourcesCreateUpdateGremlinGraphHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9947,12 +12753,11 @@ export const GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders: coreClien }, }; -export const GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders: coreClient.CompositeMapper = +export const GremlinResourcesDeleteGremlinGraphHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: - "GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders", + className: "GremlinResourcesDeleteGremlinGraphHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9970,11 +12775,11 @@ export const GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders: co }, }; -export const GremlinResourcesCreateUpdateGremlinGraphHeaders: coreClient.CompositeMapper = +export const GremlinResourcesUpdateGremlinGraphThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GremlinResourcesCreateUpdateGremlinGraphHeaders", + className: "GremlinResourcesUpdateGremlinGraphThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -9992,11 +12797,11 @@ export const GremlinResourcesCreateUpdateGremlinGraphHeaders: coreClient.Composi }, }; -export const GremlinResourcesDeleteGremlinGraphHeaders: coreClient.CompositeMapper = +export const GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GremlinResourcesDeleteGremlinGraphHeaders", + className: "GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -10014,11 +12819,11 @@ export const GremlinResourcesDeleteGremlinGraphHeaders: coreClient.CompositeMapp }, }; -export const GremlinResourcesUpdateGremlinGraphThroughputHeaders: coreClient.CompositeMapper = +export const GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GremlinResourcesUpdateGremlinGraphThroughputHeaders", + className: "GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -10036,11 +12841,11 @@ export const GremlinResourcesUpdateGremlinGraphThroughputHeaders: coreClient.Com }, }; -export const GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders: coreClient.CompositeMapper = +export const CassandraClustersInvokeCommandAsyncHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders", + className: "CassandraClustersInvokeCommandAsyncHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -10058,18 +12863,12 @@ export const GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders: coreClient.C }, }; -export const GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders: coreClient.CompositeMapper = +export const NetworkSecurityPerimeterConfigurationsReconcileHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders", + className: "NetworkSecurityPerimeterConfigurationsReconcileHeaders", modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, location: { serializedName: "location", type: { @@ -10080,10 +12879,10 @@ export const GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders: coreC }, }; -export const ServiceCreateHeaders: coreClient.CompositeMapper = { +export const ServiceDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceCreateHeaders", + className: "ServiceDeleteHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -10101,10 +12900,52 @@ export const ServiceCreateHeaders: coreClient.CompositeMapper = { }, }; -export const ServiceDeleteHeaders: coreClient.CompositeMapper = { +export const ThroughputPoolUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ServiceDeleteHeaders", + className: "ThroughputPoolUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ThroughputPoolDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ThroughputPoolDeleteHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ThroughputPoolAccountDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ThroughputPoolAccountDeleteHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", @@ -10124,10 +12965,17 @@ export const ServiceDeleteHeaders: coreClient.CompositeMapper = { export let discriminators = { BackupPolicy: BackupPolicy, + DataTransferDataSourceSink: DataTransferDataSourceSink, ServiceResourceProperties: ServiceResourceProperties, ServiceResourceCreateUpdateProperties: ServiceResourceCreateUpdateProperties, "BackupPolicy.Periodic": PeriodicModeBackupPolicy, "BackupPolicy.Continuous": ContinuousModeBackupPolicy, + "DataTransferDataSourceSink.BaseCosmosDataTransferDataSourceSink": + BaseCosmosDataTransferDataSourceSink, + "DataTransferDataSourceSink.CosmosDBMongoVCore": + CosmosMongoVCoreDataTransferDataSourceSink, + "DataTransferDataSourceSink.AzureBlobStorage": + AzureBlobDataTransferDataSourceSink, "ServiceResourceProperties.DataTransfer": DataTransferServiceResourceProperties, "ServiceResourceProperties.SqlDedicatedGateway": @@ -10144,4 +12992,10 @@ export let discriminators = { GraphAPIComputeServiceResourceCreateUpdateProperties, "ServiceResourceCreateUpdateProperties.MaterializedViewsBuilder": MaterializedViewsBuilderServiceResourceCreateUpdateProperties, + "BaseCosmosDataTransferDataSourceSink.CosmosDBCassandra": + CosmosCassandraDataTransferDataSourceSink, + "BaseCosmosDataTransferDataSourceSink.CosmosDBMongo": + CosmosMongoDataTransferDataSourceSink, + "BaseCosmosDataTransferDataSourceSink.CosmosDBSql": + CosmosSqlDataTransferDataSourceSink, }; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts index 206c48236b51..f82f19b026cf 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts @@ -12,15 +12,20 @@ import { OperationQueryParameter, } from "@azure/core-client"; import { + ChaosFaultResource as ChaosFaultResourceMapper, DatabaseAccountUpdateParameters as DatabaseAccountUpdateParametersMapper, DatabaseAccountCreateUpdateParameters as DatabaseAccountCreateUpdateParametersMapper, FailoverPolicies as FailoverPoliciesMapper, RegionForOnlineOffline as RegionForOnlineOfflineMapper, DatabaseAccountRegenerateKeyParameters as DatabaseAccountRegenerateKeyParametersMapper, + GraphResourceCreateUpdateParameters as GraphResourceCreateUpdateParametersMapper, SqlDatabaseCreateUpdateParameters as SqlDatabaseCreateUpdateParametersMapper, ThroughputSettingsUpdateParameters as ThroughputSettingsUpdateParametersMapper, - SqlContainerCreateUpdateParameters as SqlContainerCreateUpdateParametersMapper, ClientEncryptionKeyCreateUpdateParameters as ClientEncryptionKeyCreateUpdateParametersMapper, + SqlContainerCreateUpdateParameters as SqlContainerCreateUpdateParametersMapper, + MergeParameters as MergeParametersMapper, + RetrieveThroughputParameters as RetrieveThroughputParametersMapper, + RedistributeThroughputParameters as RedistributeThroughputParametersMapper, SqlStoredProcedureCreateUpdateParameters as SqlStoredProcedureCreateUpdateParametersMapper, SqlUserDefinedFunctionCreateUpdateParameters as SqlUserDefinedFunctionCreateUpdateParametersMapper, SqlTriggerCreateUpdateParameters as SqlTriggerCreateUpdateParametersMapper, @@ -32,17 +37,25 @@ import { MongoRoleDefinitionCreateUpdateParameters as MongoRoleDefinitionCreateUpdateParametersMapper, MongoUserDefinitionCreateUpdateParameters as MongoUserDefinitionCreateUpdateParametersMapper, TableCreateUpdateParameters as TableCreateUpdateParametersMapper, + TableRoleDefinitionResource as TableRoleDefinitionResourceMapper, + TableRoleAssignmentResource as TableRoleAssignmentResourceMapper, CassandraKeyspaceCreateUpdateParameters as CassandraKeyspaceCreateUpdateParametersMapper, CassandraTableCreateUpdateParameters as CassandraTableCreateUpdateParametersMapper, + CassandraViewCreateUpdateParameters as CassandraViewCreateUpdateParametersMapper, GremlinDatabaseCreateUpdateParameters as GremlinDatabaseCreateUpdateParametersMapper, GremlinGraphCreateUpdateParameters as GremlinGraphCreateUpdateParametersMapper, + CreateJobRequest as CreateJobRequestMapper, ClusterResource as ClusterResourceMapper, CommandPostBody as CommandPostBodyMapper, + CommandAsyncPostBody as CommandAsyncPostBodyMapper, DataCenterResource as DataCenterResourceMapper, NotebookWorkspaceCreateUpdateParameters as NotebookWorkspaceCreateUpdateParametersMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper, ServiceResourceCreateUpdateParameters as ServiceResourceCreateUpdateParametersMapper, -} from "../models/mappers"; + ThroughputPoolResource as ThroughputPoolResourceMapper, + ThroughputPoolUpdate as ThroughputPoolUpdateMapper, + ThroughputPoolAccountResource as ThroughputPoolAccountResourceMapper, +} from "../models/mappers.js"; export const accept: OperationParameter = { parameterPath: "accept", @@ -71,13 +84,10 @@ export const $host: OperationURLParameter = { export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { - constraints: { - MinLength: 1, - }, serializedName: "subscriptionId", required: true, type: { - name: "String", + name: "Uuid", }, }, }; @@ -97,6 +107,18 @@ export const resourceGroupName: OperationURLParameter = { }, }; +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2024-12-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String", + }, + }, +}; + export const accountName: OperationURLParameter = { parameterPath: "accountName", mapper: { @@ -113,30 +135,46 @@ export const accountName: OperationURLParameter = { }, }; -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], mapper: { - defaultValue: "2024-11-15", + defaultValue: "application/json", isConstant: true, - serializedName: "api-version", + serializedName: "Content-Type", type: { name: "String", }, }, }; -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], +export const chaosFaultRequest: OperationParameter = { + parameterPath: "chaosFaultRequest", + mapper: ChaosFaultResourceMapper, +}; + +export const chaosFault: OperationURLParameter = { + parameterPath: "chaosFault", mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", + serializedName: "chaosFault", + required: true, type: { name: "String", }, }, }; +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + export const updateParameters: OperationParameter = { parameterPath: "updateParameters", mapper: DatabaseAccountUpdateParametersMapper, @@ -188,18 +226,6 @@ export const filter1: OperationQueryParameter = { }, }; -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - export const databaseRid: OperationURLParameter = { parameterPath: "databaseRid", mapper: { @@ -266,6 +292,22 @@ export const partitionKeyRangeId: OperationURLParameter = { }, }; +export const graphName: OperationURLParameter = { + parameterPath: "graphName", + mapper: { + serializedName: "graphName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const createUpdateGraphParameters: OperationParameter = { + parameterPath: "createUpdateGraphParameters", + mapper: GraphResourceCreateUpdateParametersMapper, +}; + export const databaseName: OperationURLParameter = { parameterPath: "databaseName", mapper: { @@ -287,10 +329,10 @@ export const updateThroughputParameters: OperationParameter = { mapper: ThroughputSettingsUpdateParametersMapper, }; -export const containerName: OperationURLParameter = { - parameterPath: "containerName", +export const clientEncryptionKeyName: OperationURLParameter = { + parameterPath: "clientEncryptionKeyName", mapper: { - serializedName: "containerName", + serializedName: "clientEncryptionKeyName", required: true, type: { name: "String", @@ -298,15 +340,15 @@ export const containerName: OperationURLParameter = { }, }; -export const createUpdateSqlContainerParameters: OperationParameter = { - parameterPath: "createUpdateSqlContainerParameters", - mapper: SqlContainerCreateUpdateParametersMapper, +export const createUpdateClientEncryptionKeyParameters: OperationParameter = { + parameterPath: "createUpdateClientEncryptionKeyParameters", + mapper: ClientEncryptionKeyCreateUpdateParametersMapper, }; -export const clientEncryptionKeyName: OperationURLParameter = { - parameterPath: "clientEncryptionKeyName", +export const containerName: OperationURLParameter = { + parameterPath: "containerName", mapper: { - serializedName: "clientEncryptionKeyName", + serializedName: "containerName", required: true, type: { name: "String", @@ -314,9 +356,24 @@ export const clientEncryptionKeyName: OperationURLParameter = { }, }; -export const createUpdateClientEncryptionKeyParameters: OperationParameter = { - parameterPath: "createUpdateClientEncryptionKeyParameters", - mapper: ClientEncryptionKeyCreateUpdateParametersMapper, +export const createUpdateSqlContainerParameters: OperationParameter = { + parameterPath: "createUpdateSqlContainerParameters", + 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 = { @@ -474,6 +531,16 @@ export const createUpdateTableParameters: OperationParameter = { mapper: TableCreateUpdateParametersMapper, }; +export const createUpdateTableRoleDefinitionParameters: OperationParameter = { + parameterPath: "createUpdateTableRoleDefinitionParameters", + mapper: TableRoleDefinitionResourceMapper, +}; + +export const createUpdateTableRoleAssignmentParameters: OperationParameter = { + parameterPath: "createUpdateTableRoleAssignmentParameters", + mapper: TableRoleAssignmentResourceMapper, +}; + export const keyspaceName: OperationURLParameter = { parameterPath: "keyspaceName", mapper: { @@ -495,15 +562,10 @@ export const createUpdateCassandraTableParameters: OperationParameter = { mapper: CassandraTableCreateUpdateParametersMapper, }; -export const createUpdateGremlinDatabaseParameters: OperationParameter = { - parameterPath: "createUpdateGremlinDatabaseParameters", - mapper: GremlinDatabaseCreateUpdateParametersMapper, -}; - -export const graphName: OperationURLParameter = { - parameterPath: "graphName", +export const viewName: OperationURLParameter = { + parameterPath: "viewName", mapper: { - serializedName: "graphName", + serializedName: "viewName", required: true, type: { name: "String", @@ -511,6 +573,16 @@ export const graphName: OperationURLParameter = { }, }; +export const createUpdateCassandraViewParameters: OperationParameter = { + parameterPath: "createUpdateCassandraViewParameters", + mapper: CassandraViewCreateUpdateParametersMapper, +}; + +export const createUpdateGremlinDatabaseParameters: OperationParameter = { + parameterPath: "createUpdateGremlinDatabaseParameters", + mapper: GremlinDatabaseCreateUpdateParametersMapper, +}; + export const createUpdateGremlinGraphParameters: OperationParameter = { parameterPath: "createUpdateGremlinGraphParameters", mapper: GremlinGraphCreateUpdateParametersMapper, @@ -527,6 +599,22 @@ export const location1: OperationURLParameter = { }, }; +export const jobCreateParameters: OperationParameter = { + parameterPath: "jobCreateParameters", + mapper: CreateJobRequestMapper, +}; + +export const jobName: OperationURLParameter = { + parameterPath: "jobName", + mapper: { + serializedName: "jobName", + required: true, + type: { + name: "String", + }, + }, +}; + export const clusterName: OperationURLParameter = { parameterPath: "clusterName", mapper: { @@ -553,6 +641,53 @@ export const body1: OperationParameter = { mapper: CommandPostBodyMapper, }; +export const body2: OperationParameter = { + parameterPath: "body", + mapper: CommandAsyncPostBodyMapper, +}; + +export const commandId: OperationURLParameter = { + parameterPath: "commandId", + mapper: { + constraints: { + Pattern: new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"), + MaxLength: 100, + MinLength: 1, + }, + serializedName: "commandId", + required: true, + type: { + name: "String", + }, + }, +}; + +export const backupId: OperationURLParameter = { + parameterPath: "backupId", + mapper: { + constraints: { + Pattern: new RegExp("^[0-9]+$"), + MaxLength: 15, + MinLength: 1, + }, + serializedName: "backupId", + required: true, + type: { + name: "String", + }, + }, +}; + +export const xMsForceDeallocate: OperationParameter = { + parameterPath: ["options", "xMsForceDeallocate"], + mapper: { + serializedName: "x-ms-force-deallocate", + type: { + name: "String", + }, + }, +}; + export const dataCenterName: OperationURLParameter = { parameterPath: "dataCenterName", mapper: { @@ -569,11 +704,26 @@ export const dataCenterName: OperationURLParameter = { }, }; -export const body2: OperationParameter = { +export const body3: OperationParameter = { parameterPath: "body", mapper: DataCenterResourceMapper, }; +export const networkSecurityPerimeterConfigurationName: OperationURLParameter = + { + parameterPath: "networkSecurityPerimeterConfigurationName", + mapper: { + constraints: { + Pattern: new RegExp("^.*$"), + }, + serializedName: "networkSecurityPerimeterConfigurationName", + required: true, + type: { + name: "String", + }, + }, + }; + export const notebookWorkspaceName: OperationURLParameter = { parameterPath: "notebookWorkspaceName", mapper: { @@ -717,3 +867,50 @@ export const serviceName: OperationURLParameter = { }, }, }; + +export const throughputPoolName: OperationURLParameter = { + parameterPath: "throughputPoolName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-z0-9]+(-[a-z0-9]+)*"), + MaxLength: 50, + MinLength: 3, + }, + serializedName: "throughputPoolName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const body4: OperationParameter = { + parameterPath: "body", + mapper: ThroughputPoolResourceMapper, +}; + +export const body5: OperationParameter = { + parameterPath: ["options", "body"], + mapper: ThroughputPoolUpdateMapper, +}; + +export const throughputPoolAccountName: OperationURLParameter = { + parameterPath: "throughputPoolAccountName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-z0-9]+(-[a-z0-9]+)*"), + MaxLength: 50, + MinLength: 3, + }, + serializedName: "throughputPoolAccountName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const body6: OperationParameter = { + parameterPath: "body", + mapper: ThroughputPoolAccountResourceMapper, +}; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraClusters.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraClusters.ts index 4b3062258ec8..c713dd9c55cb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraClusters.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraClusters.ts @@ -7,23 +7,29 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { CassandraClusters } from "../operationsInterfaces"; +import { CassandraClusters } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { ClusterResource, CassandraClustersListBySubscriptionOptionalParams, CassandraClustersListBySubscriptionResponse, CassandraClustersListByResourceGroupOptionalParams, CassandraClustersListByResourceGroupResponse, + CommandPublicResource, + CassandraClustersListCommandOptionalParams, + CassandraClustersListCommandResponse, + BackupResource, + CassandraClustersListBackupsOptionalParams, + CassandraClustersListBackupsResponse, CassandraClustersGetOptionalParams, CassandraClustersGetResponse, CassandraClustersDeleteOptionalParams, @@ -34,11 +40,18 @@ import { CommandPostBody, CassandraClustersInvokeCommandOptionalParams, CassandraClustersInvokeCommandResponse, + CommandAsyncPostBody, + CassandraClustersInvokeCommandAsyncOptionalParams, + CassandraClustersInvokeCommandAsyncResponse, + CassandraClustersGetCommandAsyncOptionalParams, + CassandraClustersGetCommandAsyncResponse, + CassandraClustersGetBackupOptionalParams, + CassandraClustersGetBackupResponse, CassandraClustersDeallocateOptionalParams, CassandraClustersStartOptionalParams, CassandraClustersStatusOptionalParams, CassandraClustersStatusResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing CassandraClusters operations. */ @@ -146,6 +159,130 @@ export class CassandraClustersImpl implements CassandraClusters { } } + /** + * List all commands currently running on ring info + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param options The options parameters. + */ + public listCommand( + resourceGroupName: string, + clusterName: string, + options?: CassandraClustersListCommandOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listCommandPagingAll( + resourceGroupName, + clusterName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listCommandPagingPage( + resourceGroupName, + clusterName, + options, + settings, + ); + }, + }; + } + + private async *listCommandPagingPage( + resourceGroupName: string, + clusterName: string, + options?: CassandraClustersListCommandOptionalParams, + _settings?: PageSettings, + ): AsyncIterableIterator { + let result: CassandraClustersListCommandResponse; + result = await this._listCommand(resourceGroupName, clusterName, options); + yield result.value || []; + } + + private async *listCommandPagingAll( + resourceGroupName: string, + clusterName: string, + options?: CassandraClustersListCommandOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listCommandPagingPage( + resourceGroupName, + clusterName, + options, + )) { + yield* page; + } + } + + /** + * List the backups of this cluster that are available to restore. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param options The options parameters. + */ + public listBackups( + resourceGroupName: string, + clusterName: string, + options?: CassandraClustersListBackupsOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBackupsPagingAll( + resourceGroupName, + clusterName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBackupsPagingPage( + resourceGroupName, + clusterName, + options, + settings, + ); + }, + }; + } + + private async *listBackupsPagingPage( + resourceGroupName: string, + clusterName: string, + options?: CassandraClustersListBackupsOptionalParams, + _settings?: PageSettings, + ): AsyncIterableIterator { + let result: CassandraClustersListBackupsResponse; + result = await this._listBackups(resourceGroupName, clusterName, options); + yield result.value || []; + } + + private async *listBackupsPagingAll( + resourceGroupName: string, + clusterName: string, + options?: CassandraClustersListBackupsOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBackupsPagingPage( + resourceGroupName, + clusterName, + options, + )) { + yield* page; + } + } + /** * List all managed Cassandra clusters in this subscription. * @param options The options parameters. @@ -556,6 +693,172 @@ export class CassandraClustersImpl implements CassandraClusters { return poller.pollUntilDone(); } + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where + * @param options The options parameters. + */ + async beginInvokeCommandAsync( + resourceGroupName: string, + clusterName: string, + body: CommandAsyncPostBody, + options?: CassandraClustersInvokeCommandAsyncOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CassandraClustersInvokeCommandAsyncResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, body, options }, + spec: invokeCommandAsyncOperationSpec, + }); + const poller = await createHttpPoller< + CassandraClustersInvokeCommandAsyncResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where + * @param options The options parameters. + */ + async beginInvokeCommandAsyncAndWait( + resourceGroupName: string, + clusterName: string, + body: CommandAsyncPostBody, + options?: CassandraClustersInvokeCommandAsyncOptionalParams, + ): Promise { + const poller = await this.beginInvokeCommandAsync( + resourceGroupName, + clusterName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * List all commands currently running on ring info + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param options The options parameters. + */ + private _listCommand( + resourceGroupName: string, + clusterName: string, + options?: CassandraClustersListCommandOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + listCommandOperationSpec, + ); + } + + /** + * Get details about a specified command that was run asynchronously. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @param options The options parameters. + */ + getCommandAsync( + resourceGroupName: string, + clusterName: string, + commandId: string, + options?: CassandraClustersGetCommandAsyncOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, commandId, options }, + getCommandAsyncOperationSpec, + ); + } + + /** + * List the backups of this cluster that are available to restore. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param options The options parameters. + */ + private _listBackups( + resourceGroupName: string, + clusterName: string, + options?: CassandraClustersListBackupsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, options }, + listBackupsOperationSpec, + ); + } + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @param options The options parameters. + */ + getBackup( + resourceGroupName: string, + clusterName: string, + backupId: string, + options?: CassandraClustersGetBackupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, clusterName, backupId, options }, + getBackupOperationSpec, + ); + } + /** * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate * the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an @@ -921,6 +1224,124 @@ const invokeCommandOperationSpec: coreClient.OperationSpec = { mediaType: "json", serializer, }; +const invokeCommandAsyncOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommandAsync", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CommandPublicResource, + }, + 201: { + bodyMapper: Mappers.CommandPublicResource, + }, + 202: { + bodyMapper: Mappers.CommandPublicResource, + }, + 204: { + bodyMapper: Mappers.CommandPublicResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listCommandOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListCommands, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getCommandAsyncOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands/{commandId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CommandPublicResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.commandId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBackupsOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListBackups, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getBackupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BackupResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.backupId, + ], + headerParameters: [Parameters.accept], + serializer, +}; const deallocateOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate", httpMethod: "POST", @@ -940,7 +1361,7 @@ const deallocateOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.clusterName, ], - headerParameters: [Parameters.accept], + headerParameters: [Parameters.accept, Parameters.xMsForceDeallocate], serializer, }; const startOperationSpec: coreClient.OperationSpec = { diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraDataCenters.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraDataCenters.ts index a0dd87df8fe5..182eeae0ae8f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraDataCenters.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraDataCenters.ts @@ -7,17 +7,17 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { CassandraDataCenters } from "../operationsInterfaces"; +import { CassandraDataCenters } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { DataCenterResource, CassandraDataCentersListOptionalParams, @@ -29,7 +29,7 @@ import { CassandraDataCentersCreateUpdateResponse, CassandraDataCentersUpdateOptionalParams, CassandraDataCentersUpdateResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing CassandraDataCenters operations. */ @@ -513,7 +513,7 @@ const createUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.body2, + requestBody: Parameters.body3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -546,7 +546,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.body2, + requestBody: Parameters.body3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraResources.ts index c3cb5c29a452..ef7ab44f6ffc 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/cassandraResources.ts @@ -7,17 +7,17 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { CassandraResources } from "../operationsInterfaces"; +import { CassandraResources } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { CassandraKeyspaceGetResults, CassandraResourcesListCassandraKeyspacesOptionalParams, @@ -25,6 +25,9 @@ import { CassandraTableGetResults, CassandraResourcesListCassandraTablesOptionalParams, CassandraResourcesListCassandraTablesResponse, + CassandraViewGetResults, + CassandraResourcesListCassandraViewsOptionalParams, + CassandraResourcesListCassandraViewsResponse, CassandraResourcesGetCassandraKeyspaceOptionalParams, CassandraResourcesGetCassandraKeyspaceResponse, CassandraKeyspaceCreateUpdateParameters, @@ -56,7 +59,21 @@ import { CassandraResourcesMigrateCassandraTableToAutoscaleResponse, CassandraResourcesMigrateCassandraTableToManualThroughputOptionalParams, CassandraResourcesMigrateCassandraTableToManualThroughputResponse, -} from "../models"; + CassandraResourcesGetCassandraViewOptionalParams, + CassandraResourcesGetCassandraViewResponse, + CassandraViewCreateUpdateParameters, + CassandraResourcesCreateUpdateCassandraViewOptionalParams, + CassandraResourcesCreateUpdateCassandraViewResponse, + CassandraResourcesDeleteCassandraViewOptionalParams, + CassandraResourcesGetCassandraViewThroughputOptionalParams, + CassandraResourcesGetCassandraViewThroughputResponse, + CassandraResourcesUpdateCassandraViewThroughputOptionalParams, + CassandraResourcesUpdateCassandraViewThroughputResponse, + CassandraResourcesMigrateCassandraViewToAutoscaleOptionalParams, + CassandraResourcesMigrateCassandraViewToAutoscaleResponse, + CassandraResourcesMigrateCassandraViewToManualThroughputOptionalParams, + CassandraResourcesMigrateCassandraViewToManualThroughputResponse, +} from "../models/index.js"; /// /** Class containing CassandraResources operations. */ @@ -211,6 +228,80 @@ export class CassandraResourcesImpl implements CassandraResources { } } + /** + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param options The options parameters. + */ + public listCassandraViews( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + options?: CassandraResourcesListCassandraViewsOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listCassandraViewsPagingAll( + resourceGroupName, + accountName, + keyspaceName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listCassandraViewsPagingPage( + resourceGroupName, + accountName, + keyspaceName, + options, + settings, + ); + }, + }; + } + + private async *listCassandraViewsPagingPage( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + options?: CassandraResourcesListCassandraViewsOptionalParams, + _settings?: PageSettings, + ): AsyncIterableIterator { + let result: CassandraResourcesListCassandraViewsResponse; + result = await this._listCassandraViews( + resourceGroupName, + accountName, + keyspaceName, + options, + ); + yield result.value || []; + } + + private async *listCassandraViewsPagingAll( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + options?: CassandraResourcesListCassandraViewsOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listCassandraViewsPagingPage( + resourceGroupName, + accountName, + keyspaceName, + options, + )) { + yield* page; + } + } + /** * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1366,204 +1457,779 @@ export class CassandraResourcesImpl implements CassandraResources { ); return poller.pollUntilDone(); } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listCassandraKeyspacesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CassandraKeyspaceListResult, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getCassandraKeyspaceOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.CassandraKeyspaceGetResults, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.keyspaceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createUpdateCassandraKeyspaceOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.CassandraKeyspaceGetResults, - }, - 201: { - bodyMapper: Mappers.CassandraKeyspaceGetResults, - }, - 202: { - bodyMapper: Mappers.CassandraKeyspaceGetResults, - }, - 204: { - bodyMapper: Mappers.CassandraKeyspaceGetResults, - }, - }, - requestBody: Parameters.createUpdateCassandraKeyspaceParameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.keyspaceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteCassandraKeyspaceOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.CassandraResourcesDeleteCassandraKeyspaceHeaders, - }, - 201: { - headersMapper: Mappers.CassandraResourcesDeleteCassandraKeyspaceHeaders, - }, - 202: { - headersMapper: Mappers.CassandraResourcesDeleteCassandraKeyspaceHeaders, - }, - 204: { - headersMapper: Mappers.CassandraResourcesDeleteCassandraKeyspaceHeaders, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.keyspaceName, - ], - serializer, -}; -const getCassandraKeyspaceThroughputOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.keyspaceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const updateCassandraKeyspaceThroughputOperationSpec: coreClient.OperationSpec = - { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 201: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 202: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 204: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - }, - requestBody: Parameters.updateThroughputParameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.keyspaceName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, - }; -const migrateCassandraKeyspaceToAutoscaleOperationSpec: coreClient.OperationSpec = - { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 201: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 202: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 204: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.keyspaceName, - ], - headerParameters: [Parameters.accept], - serializer, - }; -const migrateCassandraKeyspaceToManualThroughputOperationSpec: coreClient.OperationSpec = - { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 201: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 202: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 204: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - default: { + /** + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param options The options parameters. + */ + private _listCassandraViews( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + options?: CassandraResourcesListCassandraViewsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, keyspaceName, options }, + listCassandraViewsOperationSpec, + ); + } + + /** + * Gets the Cassandra view under an existing Azure Cosmos DB database account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + getCassandraView( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesGetCassandraViewOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, keyspaceName, viewName, options }, + getCassandraViewOperationSpec, + ); + } + + /** + * Create or update an Azure Cosmos DB Cassandra View + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @param options The options parameters. + */ + async beginCreateUpdateCassandraView( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + createUpdateCassandraViewParameters: CassandraViewCreateUpdateParameters, + options?: CassandraResourcesCreateUpdateCassandraViewOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CassandraResourcesCreateUpdateCassandraViewResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + keyspaceName, + viewName, + createUpdateCassandraViewParameters, + options, + }, + spec: createUpdateCassandraViewOperationSpec, + }); + const poller = await createHttpPoller< + CassandraResourcesCreateUpdateCassandraViewResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Create or update an Azure Cosmos DB Cassandra View + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @param options The options parameters. + */ + async beginCreateUpdateCassandraViewAndWait( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + createUpdateCassandraViewParameters: CassandraViewCreateUpdateParameters, + options?: CassandraResourcesCreateUpdateCassandraViewOptionalParams, + ): Promise { + const poller = await this.beginCreateUpdateCassandraView( + resourceGroupName, + accountName, + keyspaceName, + viewName, + createUpdateCassandraViewParameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + async beginDeleteCassandraView( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesDeleteCassandraViewOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, keyspaceName, viewName, options }, + spec: deleteCassandraViewOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + async beginDeleteCassandraViewAndWait( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesDeleteCassandraViewOptionalParams, + ): Promise { + const poller = await this.beginDeleteCassandraView( + resourceGroupName, + accountName, + keyspaceName, + viewName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account + * with the provided name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + getCassandraViewThroughput( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesGetCassandraViewThroughputOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, keyspaceName, viewName, options }, + getCassandraViewThroughputOperationSpec, + ); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current + * Cassandra view. + * @param options The options parameters. + */ + async beginUpdateCassandraViewThroughput( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + updateThroughputParameters: ThroughputSettingsUpdateParameters, + options?: CassandraResourcesUpdateCassandraViewThroughputOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CassandraResourcesUpdateCassandraViewThroughputResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + keyspaceName, + viewName, + updateThroughputParameters, + options, + }, + spec: updateCassandraViewThroughputOperationSpec, + }); + const poller = await createHttpPoller< + CassandraResourcesUpdateCassandraViewThroughputResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current + * Cassandra view. + * @param options The options parameters. + */ + async beginUpdateCassandraViewThroughputAndWait( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + updateThroughputParameters: ThroughputSettingsUpdateParameters, + options?: CassandraResourcesUpdateCassandraViewThroughputOptionalParams, + ): Promise { + const poller = await this.beginUpdateCassandraViewThroughput( + resourceGroupName, + accountName, + keyspaceName, + viewName, + updateThroughputParameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + async beginMigrateCassandraViewToAutoscale( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesMigrateCassandraViewToAutoscaleOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CassandraResourcesMigrateCassandraViewToAutoscaleResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, keyspaceName, viewName, options }, + spec: migrateCassandraViewToAutoscaleOperationSpec, + }); + const poller = await createHttpPoller< + CassandraResourcesMigrateCassandraViewToAutoscaleResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + async beginMigrateCassandraViewToAutoscaleAndWait( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesMigrateCassandraViewToAutoscaleOptionalParams, + ): Promise { + const poller = await this.beginMigrateCassandraViewToAutoscale( + resourceGroupName, + accountName, + keyspaceName, + viewName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + async beginMigrateCassandraViewToManualThroughput( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesMigrateCassandraViewToManualThroughputOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CassandraResourcesMigrateCassandraViewToManualThroughputResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, keyspaceName, viewName, options }, + spec: migrateCassandraViewToManualThroughputOperationSpec, + }); + const poller = await createHttpPoller< + CassandraResourcesMigrateCassandraViewToManualThroughputResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + async beginMigrateCassandraViewToManualThroughputAndWait( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesMigrateCassandraViewToManualThroughputOptionalParams, + ): Promise { + const poller = await this.beginMigrateCassandraViewToManualThroughput( + resourceGroupName, + accountName, + keyspaceName, + viewName, + options, + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listCassandraKeyspacesOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CassandraKeyspaceListResult, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getCassandraKeyspaceOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CassandraKeyspaceGetResults, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createUpdateCassandraKeyspaceOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CassandraKeyspaceGetResults, + }, + 201: { + bodyMapper: Mappers.CassandraKeyspaceGetResults, + }, + 202: { + bodyMapper: Mappers.CassandraKeyspaceGetResults, + }, + 204: { + bodyMapper: Mappers.CassandraKeyspaceGetResults, + }, + }, + requestBody: Parameters.createUpdateCassandraKeyspaceParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteCassandraKeyspaceOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.CassandraResourcesDeleteCassandraKeyspaceHeaders, + }, + 201: { + headersMapper: Mappers.CassandraResourcesDeleteCassandraKeyspaceHeaders, + }, + 202: { + headersMapper: Mappers.CassandraResourcesDeleteCassandraKeyspaceHeaders, + }, + 204: { + headersMapper: Mappers.CassandraResourcesDeleteCassandraKeyspaceHeaders, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + ], + serializer, +}; +const getCassandraKeyspaceThroughputOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const updateCassandraKeyspaceThroughputOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 201: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 202: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 204: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + }, + requestBody: Parameters.updateThroughputParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; +const migrateCassandraKeyspaceToAutoscaleOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 201: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 202: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 204: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + ], + headerParameters: [Parameters.accept], + serializer, + }; +const migrateCassandraKeyspaceToManualThroughputOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 201: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 202: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 204: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + default: { bodyMapper: Mappers.ErrorResponse, }, }, @@ -1793,3 +2459,204 @@ const migrateCassandraTableToManualThroughputOperationSpec: coreClient.Operation headerParameters: [Parameters.accept], serializer, }; +const listCassandraViewsOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CassandraViewListResult, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getCassandraViewOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CassandraViewGetResults, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + Parameters.viewName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createUpdateCassandraViewOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CassandraViewGetResults, + }, + 201: { + bodyMapper: Mappers.CassandraViewGetResults, + }, + 202: { + bodyMapper: Mappers.CassandraViewGetResults, + }, + 204: { + bodyMapper: Mappers.CassandraViewGetResults, + }, + }, + requestBody: Parameters.createUpdateCassandraViewParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + Parameters.viewName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteCassandraViewOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", + httpMethod: "DELETE", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + Parameters.viewName, + ], + serializer, +}; +const getCassandraViewThroughputOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + Parameters.viewName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const updateCassandraViewThroughputOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 201: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 202: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 204: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + }, + requestBody: Parameters.updateThroughputParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + Parameters.viewName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const migrateCassandraViewToAutoscaleOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 201: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 202: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 204: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + Parameters.viewName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const migrateCassandraViewToManualThroughputOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 201: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 202: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 204: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.keyspaceName, + Parameters.viewName, + ], + headerParameters: [Parameters.accept], + serializer, + }; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/chaosFault.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/chaosFault.ts new file mode 100644 index 000000000000..0e2c3a8dfe7b --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/chaosFault.ts @@ -0,0 +1,383 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import { ChaosFault } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import { + ChaosFaultResource, + ChaosFaultListNextOptionalParams, + ChaosFaultListOptionalParams, + ChaosFaultListOperationResponse, + ChaosFaultEnableDisableOptionalParams, + ChaosFaultEnableDisableResponse, + ChaosFaultGetOptionalParams, + ChaosFaultGetResponse, + ChaosFaultListNextResponse, +} from "../models/index.js"; + +/// +/** Class containing ChaosFault operations. */ +export class ChaosFaultImpl implements ChaosFault { + private readonly client: CosmosDBManagementClient; + + /** + * Initialize a new instance of the class ChaosFault class. + * @param client Reference to the service client + */ + constructor(client: CosmosDBManagementClient) { + this.client = client; + } + + /** + * List Chaos Faults for CosmosDB account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + accountName: string, + options?: ChaosFaultListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, accountName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + accountName: string, + options?: ChaosFaultListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: ChaosFaultListOperationResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + accountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + accountName: string, + options?: ChaosFaultListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * List Chaos Faults for CosmosDB account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + accountName: string, + options?: ChaosFaultListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listOperationSpec, + ); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param options The options parameters. + */ + async beginEnableDisable( + resourceGroupName: string, + accountName: string, + chaosFault: string, + chaosFaultRequest: ChaosFaultResource, + options?: ChaosFaultEnableDisableOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ChaosFaultEnableDisableResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + chaosFault, + chaosFaultRequest, + options, + }, + spec: enableDisableOperationSpec, + }); + const poller = await createHttpPoller< + ChaosFaultEnableDisableResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param options The options parameters. + */ + async beginEnableDisableAndWait( + resourceGroupName: string, + accountName: string, + chaosFault: string, + chaosFaultRequest: ChaosFaultResource, + options?: ChaosFaultEnableDisableOptionalParams, + ): Promise { + const poller = await this.beginEnableDisable( + resourceGroupName, + accountName, + chaosFault, + chaosFaultRequest, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + chaosFault: string, + options?: ChaosFaultGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, chaosFault, options }, + getOperationSpec, + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: ChaosFaultListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ChaosFaultListResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const enableDisableOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ChaosFaultResource, + }, + 201: { + bodyMapper: Mappers.ChaosFaultResource, + }, + 202: { + bodyMapper: Mappers.ChaosFaultResource, + }, + 204: { + bodyMapper: Mappers.ChaosFaultResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.chaosFaultRequest, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.chaosFault, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ChaosFaultResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.chaosFault, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ChaosFaultListResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/collection.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/collection.ts index 646b11f5d368..b72ba7b8e1f2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/collection.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/collection.ts @@ -7,11 +7,11 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { Collection } from "../operationsInterfaces"; +import { Collection } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { Metric, CollectionListMetricsOptionalParams, @@ -22,7 +22,7 @@ import { MetricDefinition, CollectionListMetricDefinitionsOptionalParams, CollectionListMetricDefinitionsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing Collection operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionPartition.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionPartition.ts index 544d6aeaf798..e6ed4dd9d0c1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionPartition.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionPartition.ts @@ -7,11 +7,11 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { CollectionPartition } from "../operationsInterfaces"; +import { CollectionPartition } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { PartitionMetric, CollectionPartitionListMetricsOptionalParams, @@ -19,7 +19,7 @@ import { PartitionUsage, CollectionPartitionListUsagesOptionalParams, CollectionPartitionListUsagesResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing CollectionPartition operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionPartitionRegion.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionPartitionRegion.ts index d998b5fddd65..aac35ee7ffde 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionPartitionRegion.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionPartitionRegion.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { CollectionPartitionRegion } from "../operationsInterfaces"; +import { CollectionPartitionRegion } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { PartitionMetric, CollectionPartitionRegionListMetricsOptionalParams, CollectionPartitionRegionListMetricsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing CollectionPartitionRegion operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionRegion.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionRegion.ts index 922009fa47ac..a11599359ab1 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionRegion.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/collectionRegion.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { CollectionRegion } from "../operationsInterfaces"; +import { CollectionRegion } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { Metric, CollectionRegionListMetricsOptionalParams, CollectionRegionListMetricsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing CollectionRegion operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/dataTransferJobs.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/dataTransferJobs.ts new file mode 100644 index 000000000000..9dddb77dc269 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/dataTransferJobs.ts @@ -0,0 +1,464 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import { DataTransferJobs } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; +import { + DataTransferJobGetResults, + DataTransferJobsListByDatabaseAccountNextOptionalParams, + DataTransferJobsListByDatabaseAccountOptionalParams, + DataTransferJobsListByDatabaseAccountResponse, + CreateJobRequest, + DataTransferJobsCreateOptionalParams, + DataTransferJobsCreateResponse, + DataTransferJobsGetOptionalParams, + DataTransferJobsGetResponse, + DataTransferJobsPauseOptionalParams, + DataTransferJobsPauseResponse, + DataTransferJobsResumeOptionalParams, + DataTransferJobsResumeResponse, + DataTransferJobsCancelOptionalParams, + DataTransferJobsCancelResponse, + DataTransferJobsCompleteOptionalParams, + DataTransferJobsCompleteResponse, + DataTransferJobsListByDatabaseAccountNextResponse, +} from "../models/index.js"; + +/// +/** Class containing DataTransferJobs operations. */ +export class DataTransferJobsImpl implements DataTransferJobs { + private readonly client: CosmosDBManagementClient; + + /** + * Initialize a new instance of the class DataTransferJobs class. + * @param client Reference to the service client + */ + constructor(client: CosmosDBManagementClient) { + this.client = client; + } + + /** + * Get a list of Data Transfer jobs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + public listByDatabaseAccount( + resourceGroupName: string, + accountName: string, + options?: DataTransferJobsListByDatabaseAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByDatabaseAccountPagingAll( + resourceGroupName, + accountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByDatabaseAccountPagingPage( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listByDatabaseAccountPagingPage( + resourceGroupName: string, + accountName: string, + options?: DataTransferJobsListByDatabaseAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: DataTransferJobsListByDatabaseAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByDatabaseAccount( + resourceGroupName, + accountName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByDatabaseAccountNext( + resourceGroupName, + accountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByDatabaseAccountPagingAll( + resourceGroupName: string, + accountName: string, + options?: DataTransferJobsListByDatabaseAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByDatabaseAccountPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * Creates 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 jobCreateParameters Parameters to create Data Transfer Job + * @param options The options parameters. + */ + create( + resourceGroupName: string, + accountName: string, + jobName: string, + jobCreateParameters: CreateJobRequest, + options?: DataTransferJobsCreateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, jobName, jobCreateParameters, options }, + createOperationSpec, + ); + } + + /** + * Get 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. + */ + get( + resourceGroupName: string, + accountName: string, + jobName: string, + options?: DataTransferJobsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, jobName, options }, + getOperationSpec, + ); + } + + /** + * 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, + ); + } + + /** + * Completes a Data Transfer Online 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. + */ + complete( + resourceGroupName: string, + accountName: string, + jobName: string, + options?: DataTransferJobsCompleteOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, jobName, options }, + completeOperationSpec, + ); + } + + /** + * Get a list of Data Transfer jobs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + private _listByDatabaseAccount( + resourceGroupName: string, + accountName: string, + options?: DataTransferJobsListByDatabaseAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listByDatabaseAccountOperationSpec, + ); + } + + /** + * ListByDatabaseAccountNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param nextLink The nextLink from the previous successful call to the ListByDatabaseAccount method. + * @param options The options parameters. + */ + private _listByDatabaseAccountNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: DataTransferJobsListByDatabaseAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listByDatabaseAccountNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const createOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.DataTransferJobGetResults, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.jobCreateParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.jobName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataTransferJobGetResults, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.jobName, + ], + 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.ErrorResponse, + }, + }, + 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.ErrorResponse, + }, + }, + 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.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.jobName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const completeOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DataTransferJobGetResults, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + 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", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataTransferJobFeedResults, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByDatabaseAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DataTransferJobFeedResults, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/database.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/database.ts index 4996c2462b08..57fd4610ed12 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/database.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/database.ts @@ -7,11 +7,11 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { Database } from "../operationsInterfaces"; +import { Database } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { Metric, DatabaseListMetricsOptionalParams, @@ -22,7 +22,7 @@ import { MetricDefinition, DatabaseListMetricDefinitionsOptionalParams, DatabaseListMetricDefinitionsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing Database operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccountRegion.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccountRegion.ts index 8b9ba595e626..aece68991e75 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccountRegion.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccountRegion.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { DatabaseAccountRegion } from "../operationsInterfaces"; +import { DatabaseAccountRegion } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { Metric, DatabaseAccountRegionListMetricsOptionalParams, DatabaseAccountRegionListMetricsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing DatabaseAccountRegion operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccounts.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccounts.ts index 7e73c2a3e68f..baa6491cdf36 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccounts.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/databaseAccounts.ts @@ -7,17 +7,17 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { DatabaseAccounts } from "../operationsInterfaces"; +import { DatabaseAccounts } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { DatabaseAccountGetResults, DatabaseAccountsListOptionalParams, @@ -61,7 +61,7 @@ import { DatabaseAccountsRegenerateKeyOptionalParams, DatabaseAccountsCheckNameExistsOptionalParams, DatabaseAccountsCheckNameExistsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing DatabaseAccounts operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/graphResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/graphResources.ts new file mode 100644 index 000000000000..8990a2ff42d9 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/graphResources.ts @@ -0,0 +1,418 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { GraphResources } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import { + GraphResourceGetResults, + GraphResourcesListGraphsOptionalParams, + GraphResourcesListGraphsResponse, + GraphResourcesGetGraphOptionalParams, + GraphResourcesGetGraphResponse, + GraphResourceCreateUpdateParameters, + GraphResourcesCreateUpdateGraphOptionalParams, + GraphResourcesCreateUpdateGraphResponse, + GraphResourcesDeleteGraphResourceOptionalParams, +} from "../models/index.js"; + +/// +/** Class containing GraphResources operations. */ +export class GraphResourcesImpl implements GraphResources { + private readonly client: CosmosDBManagementClient; + + /** + * Initialize a new instance of the class GraphResources class. + * @param client Reference to the service client + */ + constructor(client: CosmosDBManagementClient) { + this.client = client; + } + + /** + * Lists the graphs under an existing Azure Cosmos DB database account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + public listGraphs( + resourceGroupName: string, + accountName: string, + options?: GraphResourcesListGraphsOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listGraphsPagingAll( + resourceGroupName, + accountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listGraphsPagingPage( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listGraphsPagingPage( + resourceGroupName: string, + accountName: string, + options?: GraphResourcesListGraphsOptionalParams, + _settings?: PageSettings, + ): AsyncIterableIterator { + let result: GraphResourcesListGraphsResponse; + result = await this._listGraphs(resourceGroupName, accountName, options); + yield result.value || []; + } + + private async *listGraphsPagingAll( + resourceGroupName: string, + accountName: string, + options?: GraphResourcesListGraphsOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listGraphsPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * Lists the graphs under an existing Azure Cosmos DB database account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + private _listGraphs( + resourceGroupName: string, + accountName: string, + options?: GraphResourcesListGraphsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listGraphsOperationSpec, + ); + } + + /** + * Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param options The options parameters. + */ + getGraph( + resourceGroupName: string, + accountName: string, + graphName: string, + options?: GraphResourcesGetGraphOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, graphName, options }, + getGraphOperationSpec, + ); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @param options The options parameters. + */ + async beginCreateUpdateGraph( + resourceGroupName: string, + accountName: string, + graphName: string, + createUpdateGraphParameters: GraphResourceCreateUpdateParameters, + options?: GraphResourcesCreateUpdateGraphOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GraphResourcesCreateUpdateGraphResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + graphName, + createUpdateGraphParameters, + options, + }, + spec: createUpdateGraphOperationSpec, + }); + const poller = await createHttpPoller< + GraphResourcesCreateUpdateGraphResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Create or update an Azure Cosmos DB Graph. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @param options The options parameters. + */ + async beginCreateUpdateGraphAndWait( + resourceGroupName: string, + accountName: string, + graphName: string, + createUpdateGraphParameters: GraphResourceCreateUpdateParameters, + options?: GraphResourcesCreateUpdateGraphOptionalParams, + ): Promise { + const poller = await this.beginCreateUpdateGraph( + resourceGroupName, + accountName, + graphName, + createUpdateGraphParameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param options The options parameters. + */ + async beginDeleteGraphResource( + resourceGroupName: string, + accountName: string, + graphName: string, + options?: GraphResourcesDeleteGraphResourceOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, graphName, options }, + spec: deleteGraphResourceOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param options The options parameters. + */ + async beginDeleteGraphResourceAndWait( + resourceGroupName: string, + accountName: string, + graphName: string, + options?: GraphResourcesDeleteGraphResourceOptionalParams, + ): Promise { + const poller = await this.beginDeleteGraphResource( + resourceGroupName, + accountName, + graphName, + options, + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listGraphsOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GraphResourcesListResult, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getGraphOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GraphResourceGetResults, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.graphName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createUpdateGraphOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.GraphResourceGetResults, + }, + 201: { + bodyMapper: Mappers.GraphResourceGetResults, + }, + 202: { + bodyMapper: Mappers.GraphResourceGetResults, + }, + 204: { + bodyMapper: Mappers.GraphResourceGetResults, + }, + }, + requestBody: Parameters.createUpdateGraphParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.graphName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteGraphResourceOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", + httpMethod: "DELETE", + responses: { 200: {}, 201: {}, 202: {}, 204: {} }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.graphName, + ], + serializer, +}; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/gremlinResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/gremlinResources.ts index 9b77aec8a3ca..a390f09ac9ca 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/gremlinResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/gremlinResources.ts @@ -7,17 +7,17 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { GremlinResources } from "../operationsInterfaces"; +import { GremlinResources } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { GremlinDatabaseGetResults, GremlinResourcesListGremlinDatabasesOptionalParams, @@ -59,7 +59,7 @@ import { ContinuousBackupRestoreLocation, GremlinResourcesRetrieveContinuousBackupInformationOptionalParams, GremlinResourcesRetrieveContinuousBackupInformationResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing GremlinResources operations. */ @@ -1723,8 +1723,8 @@ const getGremlinGraphOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, - Parameters.databaseName, Parameters.graphName, + Parameters.databaseName, ], headerParameters: [Parameters.accept], serializer, @@ -1753,8 +1753,8 @@ const createUpdateGremlinGraphOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, - Parameters.databaseName, Parameters.graphName, + Parameters.databaseName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -1783,8 +1783,8 @@ const deleteGremlinGraphOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, - Parameters.databaseName, Parameters.graphName, + Parameters.databaseName, ], serializer, }; @@ -1802,8 +1802,8 @@ const getGremlinGraphThroughputOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, - Parameters.databaseName, Parameters.graphName, + Parameters.databaseName, ], headerParameters: [Parameters.accept], serializer, @@ -1832,8 +1832,8 @@ const updateGremlinGraphThroughputOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, - Parameters.databaseName, Parameters.graphName, + Parameters.databaseName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -1865,8 +1865,8 @@ const migrateGremlinGraphToAutoscaleOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, - Parameters.databaseName, Parameters.graphName, + Parameters.databaseName, ], headerParameters: [Parameters.accept], serializer, @@ -1898,8 +1898,8 @@ const migrateGremlinGraphToManualThroughputOperationSpec: coreClient.OperationSp Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, - Parameters.databaseName, Parameters.graphName, + Parameters.databaseName, ], headerParameters: [Parameters.accept], serializer, @@ -1932,8 +1932,8 @@ const retrieveContinuousBackupInformationOperationSpec: coreClient.OperationSpec Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, - Parameters.databaseName, Parameters.graphName, + Parameters.databaseName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/index.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/index.ts index 96531b8c1b96..1aa7da1805c7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/index.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/index.ts @@ -6,40 +6,48 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./databaseAccounts"; -export * from "./operations"; -export * from "./database"; -export * from "./collection"; -export * from "./collectionRegion"; -export * from "./databaseAccountRegion"; -export * from "./percentileSourceTarget"; -export * from "./percentileTarget"; -export * from "./percentile"; -export * from "./collectionPartitionRegion"; -export * from "./collectionPartition"; -export * from "./partitionKeyRangeId"; -export * from "./partitionKeyRangeIdRegion"; -export * from "./sqlResources"; -export * from "./mongoDBResources"; -export * from "./tableResources"; -export * from "./cassandraResources"; -export * from "./gremlinResources"; -export * from "./locations"; -export * from "./cassandraClusters"; -export * from "./cassandraDataCenters"; -export * from "./notebookWorkspaces"; -export * from "./privateEndpointConnections"; -export * from "./privateLinkResources"; -export * from "./restorableDatabaseAccounts"; -export * from "./restorableSqlDatabases"; -export * from "./restorableSqlContainers"; -export * from "./restorableSqlResources"; -export * from "./restorableMongodbDatabases"; -export * from "./restorableMongodbCollections"; -export * from "./restorableMongodbResources"; -export * from "./restorableGremlinDatabases"; -export * from "./restorableGremlinGraphs"; -export * from "./restorableGremlinResources"; -export * from "./restorableTables"; -export * from "./restorableTableResources"; -export * from "./service"; +export * from "./chaosFault.js"; +export * from "./databaseAccounts.js"; +export * from "./operations.js"; +export * from "./database.js"; +export * from "./collection.js"; +export * from "./collectionRegion.js"; +export * from "./databaseAccountRegion.js"; +export * from "./percentileSourceTarget.js"; +export * from "./percentileTarget.js"; +export * from "./percentile.js"; +export * from "./collectionPartitionRegion.js"; +export * from "./collectionPartition.js"; +export * from "./partitionKeyRangeId.js"; +export * from "./partitionKeyRangeIdRegion.js"; +export * from "./graphResources.js"; +export * from "./sqlResources.js"; +export * from "./mongoDBResources.js"; +export * from "./tableResources.js"; +export * from "./cassandraResources.js"; +export * from "./gremlinResources.js"; +export * from "./locations.js"; +export * from "./dataTransferJobs.js"; +export * from "./cassandraClusters.js"; +export * from "./cassandraDataCenters.js"; +export * from "./networkSecurityPerimeterConfigurations.js"; +export * from "./notebookWorkspaces.js"; +export * from "./privateEndpointConnections.js"; +export * from "./privateLinkResources.js"; +export * from "./restorableDatabaseAccounts.js"; +export * from "./restorableSqlDatabases.js"; +export * from "./restorableSqlContainers.js"; +export * from "./restorableSqlResources.js"; +export * from "./restorableMongodbDatabases.js"; +export * from "./restorableMongodbCollections.js"; +export * from "./restorableMongodbResources.js"; +export * from "./restorableGremlinDatabases.js"; +export * from "./restorableGremlinGraphs.js"; +export * from "./restorableGremlinResources.js"; +export * from "./restorableTables.js"; +export * from "./restorableTableResources.js"; +export * from "./service.js"; +export * from "./throughputPools.js"; +export * from "./throughputPool.js"; +export * from "./throughputPoolAccounts.js"; +export * from "./throughputPoolAccount.js"; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/locations.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/locations.ts index 8862acdaa757..8f062c99597e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/locations.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/locations.ts @@ -7,18 +7,18 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { Locations } from "../operationsInterfaces"; +import { Locations } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { LocationGetResult, LocationsListOptionalParams, LocationsListResponse, LocationsGetOptionalParams, LocationsGetResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing Locations operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/mongoDBResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/mongoDBResources.ts index c300057bce97..6b3151e84d2a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/mongoDBResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/mongoDBResources.ts @@ -7,17 +7,17 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { MongoDBResources } from "../operationsInterfaces"; +import { MongoDBResources } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { MongoDBDatabaseGetResults, MongoDBResourcesListMongoDBDatabasesOptionalParams, @@ -47,6 +47,16 @@ import { MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleResponse, MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptionalParams, MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputResponse, + RetrieveThroughputParameters, + MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionOptionalParams, + MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionResponse, + RedistributeThroughputParameters, + MongoDBResourcesMongoDBDatabaseRedistributeThroughputOptionalParams, + MongoDBResourcesMongoDBDatabaseRedistributeThroughputResponse, + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams, + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse, + MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams, + MongoDBResourcesMongoDBContainerRedistributeThroughputResponse, MongoDBResourcesGetMongoDBCollectionOptionalParams, MongoDBResourcesGetMongoDBCollectionResponse, MongoDBCollectionCreateUpdateParameters, @@ -54,6 +64,11 @@ import { MongoDBResourcesCreateUpdateMongoDBCollectionResponse, MongoDBResourcesDeleteMongoDBCollectionOptionalParams, MongoDBResourcesDeleteMongoDBCollectionResponse, + MergeParameters, + MongoDBResourcesMongoDBDatabasePartitionMergeOptionalParams, + MongoDBResourcesMongoDBDatabasePartitionMergeResponse, + MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams, + MongoDBResourcesListMongoDBCollectionPartitionMergeResponse, MongoDBResourcesGetMongoDBCollectionThroughputOptionalParams, MongoDBResourcesGetMongoDBCollectionThroughputResponse, MongoDBResourcesUpdateMongoDBCollectionThroughputOptionalParams, @@ -77,7 +92,7 @@ import { ContinuousBackupRestoreLocation, MongoDBResourcesRetrieveContinuousBackupInformationOptionalParams, MongoDBResourcesRetrieveContinuousBackupInformationResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing MongoDBResources operations. */ @@ -917,6 +932,452 @@ export class MongoDBResourcesImpl implements MongoDBResources { return poller.pollUntilDone(); } + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database + * @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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current MongoDB database. + * @param options The options parameters. + */ + async beginMongoDBDatabaseRetrieveThroughputDistribution( + resourceGroupName: string, + accountName: string, + databaseName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + databaseName, + retrieveThroughputParameters, + options, + }, + spec: mongoDBDatabaseRetrieveThroughputDistributionOperationSpec, + }); + const poller = await createHttpPoller< + MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database + * @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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current MongoDB database. + * @param options The options parameters. + */ + async beginMongoDBDatabaseRetrieveThroughputDistributionAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionOptionalParams, + ): Promise { + const poller = + await this.beginMongoDBDatabaseRetrieveThroughputDistribution( + resourceGroupName, + accountName, + databaseName, + retrieveThroughputParameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database + * @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 redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current MongoDB database. + * @param options The options parameters. + */ + async beginMongoDBDatabaseRedistributeThroughput( + resourceGroupName: string, + accountName: string, + databaseName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: MongoDBResourcesMongoDBDatabaseRedistributeThroughputOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + MongoDBResourcesMongoDBDatabaseRedistributeThroughputResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + databaseName, + redistributeThroughputParameters, + options, + }, + spec: mongoDBDatabaseRedistributeThroughputOperationSpec, + }); + const poller = await createHttpPoller< + MongoDBResourcesMongoDBDatabaseRedistributeThroughputResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database + * @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 redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current MongoDB database. + * @param options The options parameters. + */ + async beginMongoDBDatabaseRedistributeThroughputAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: MongoDBResourcesMongoDBDatabaseRedistributeThroughputOptionalParams, + ): Promise { + const poller = await this.beginMongoDBDatabaseRedistributeThroughput( + resourceGroupName, + accountName, + databaseName, + redistributeThroughputParameters, + options, + ); + 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< + SimplePollerLike< + OperationState, + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + databaseName, + collectionName, + retrieveThroughputParameters, + options, + }, + spec: mongoDBContainerRetrieveThroughputDistributionOperationSpec, + }); + const poller = await createHttpPoller< + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "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 { + 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< + SimplePollerLike< + OperationState, + MongoDBResourcesMongoDBContainerRedistributeThroughputResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + databaseName, + collectionName, + redistributeThroughputParameters, + options, + }, + spec: mongoDBContainerRedistributeThroughputOperationSpec, + }); + const poller = await createHttpPoller< + MongoDBResourcesMongoDBContainerRedistributeThroughputResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "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. @@ -937,53 +1398,268 @@ export class MongoDBResourcesImpl implements MongoDBResources { } /** - * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * 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. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param options The options parameters. + */ + getMongoDBCollection( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + options?: MongoDBResourcesGetMongoDBCollectionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, databaseName, collectionName, options }, + getMongoDBCollectionOperationSpec, + ); + } + + /** + * Create or update an Azure Cosmos DB 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 createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB + * Collection. + * @param options The options parameters. + */ + async beginCreateUpdateMongoDBCollection( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + createUpdateMongoDBCollectionParameters: MongoDBCollectionCreateUpdateParameters, + options?: MongoDBResourcesCreateUpdateMongoDBCollectionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + MongoDBResourcesCreateUpdateMongoDBCollectionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + databaseName, + collectionName, + createUpdateMongoDBCollectionParameters, + options, + }, + spec: createUpdateMongoDBCollectionOperationSpec, + }); + const poller = await createHttpPoller< + MongoDBResourcesCreateUpdateMongoDBCollectionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Create or update an Azure Cosmos DB 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 createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB + * Collection. + * @param options The options parameters. + */ + async beginCreateUpdateMongoDBCollectionAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + createUpdateMongoDBCollectionParameters: MongoDBCollectionCreateUpdateParameters, + options?: MongoDBResourcesCreateUpdateMongoDBCollectionOptionalParams, + ): Promise { + const poller = await this.beginCreateUpdateMongoDBCollection( + resourceGroupName, + accountName, + databaseName, + collectionName, + createUpdateMongoDBCollectionParameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an existing Azure Cosmos DB 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 options The options parameters. + */ + async beginDeleteMongoDBCollection( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + options?: MongoDBResourcesDeleteMongoDBCollectionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + MongoDBResourcesDeleteMongoDBCollectionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + databaseName, + collectionName, + options, + }, + spec: deleteMongoDBCollectionOperationSpec, + }); + const poller = await createHttpPoller< + MongoDBResourcesDeleteMongoDBCollectionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Deletes an existing Azure Cosmos DB 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 options The options parameters. */ - getMongoDBCollection( + async beginDeleteMongoDBCollectionAndWait( resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, - options?: MongoDBResourcesGetMongoDBCollectionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, databaseName, collectionName, options }, - getMongoDBCollectionOperationSpec, + options?: MongoDBResourcesDeleteMongoDBCollectionOptionalParams, + ): Promise { + const poller = await this.beginDeleteMongoDBCollection( + resourceGroupName, + accountName, + databaseName, + collectionName, + options, ); + return poller.pollUntilDone(); } /** - * Create or update an Azure Cosmos DB MongoDB Collection + * Merges the partitions of a MongoDB database * @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 createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB - * Collection. + * @param mergeParameters The parameters for the merge operation. * @param options The options parameters. */ - async beginCreateUpdateMongoDBCollection( + async beginMongoDBDatabasePartitionMerge( resourceGroupName: string, accountName: string, databaseName: string, - collectionName: string, - createUpdateMongoDBCollectionParameters: MongoDBCollectionCreateUpdateParameters, - options?: MongoDBResourcesCreateUpdateMongoDBCollectionOptionalParams, + mergeParameters: MergeParameters, + options?: MongoDBResourcesMongoDBDatabasePartitionMergeOptionalParams, ): Promise< SimplePollerLike< - OperationState, - MongoDBResourcesCreateUpdateMongoDBCollectionResponse + OperationState, + MongoDBResourcesMongoDBDatabasePartitionMergeResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( @@ -1024,76 +1700,74 @@ export class MongoDBResourcesImpl implements MongoDBResources { resourceGroupName, accountName, databaseName, - collectionName, - createUpdateMongoDBCollectionParameters, + mergeParameters, options, }, - spec: createUpdateMongoDBCollectionOperationSpec, + spec: mongoDBDatabasePartitionMergeOperationSpec, }); const poller = await createHttpPoller< - MongoDBResourcesCreateUpdateMongoDBCollectionResponse, - OperationState + MongoDBResourcesMongoDBDatabasePartitionMergeResponse, + OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * Create or update an Azure Cosmos DB MongoDB Collection + * Merges the partitions of a MongoDB database * @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 createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB - * Collection. + * @param mergeParameters The parameters for the merge operation. * @param options The options parameters. */ - async beginCreateUpdateMongoDBCollectionAndWait( + async beginMongoDBDatabasePartitionMergeAndWait( resourceGroupName: string, accountName: string, databaseName: string, - collectionName: string, - createUpdateMongoDBCollectionParameters: MongoDBCollectionCreateUpdateParameters, - options?: MongoDBResourcesCreateUpdateMongoDBCollectionOptionalParams, - ): Promise { - const poller = await this.beginCreateUpdateMongoDBCollection( + mergeParameters: MergeParameters, + options?: MongoDBResourcesMongoDBDatabasePartitionMergeOptionalParams, + ): Promise { + const poller = await this.beginMongoDBDatabasePartitionMerge( resourceGroupName, accountName, databaseName, - collectionName, - createUpdateMongoDBCollectionParameters, + mergeParameters, options, ); return poller.pollUntilDone(); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * 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 beginDeleteMongoDBCollection( + async beginListMongoDBCollectionPartitionMerge( resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, - options?: MongoDBResourcesDeleteMongoDBCollectionOptionalParams, + mergeParameters: MergeParameters, + options?: MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams, ): Promise< SimplePollerLike< - OperationState, - MongoDBResourcesDeleteMongoDBCollectionResponse + OperationState, + MongoDBResourcesListMongoDBCollectionPartitionMergeResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( @@ -1135,41 +1809,46 @@ export class MongoDBResourcesImpl implements MongoDBResources { accountName, databaseName, collectionName, + mergeParameters, options, }, - spec: deleteMongoDBCollectionOperationSpec, + spec: listMongoDBCollectionPartitionMergeOperationSpec, }); const poller = await createHttpPoller< - MongoDBResourcesDeleteMongoDBCollectionResponse, - OperationState + MongoDBResourcesListMongoDBCollectionPartitionMergeResponse, + OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * 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 beginDeleteMongoDBCollectionAndWait( + async beginListMongoDBCollectionPartitionMergeAndWait( resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, - options?: MongoDBResourcesDeleteMongoDBCollectionOptionalParams, - ): Promise { - const poller = await this.beginDeleteMongoDBCollection( + mergeParameters: MergeParameters, + options?: MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams, + ): Promise { + const poller = await this.beginListMongoDBCollectionPartitionMerge( resourceGroupName, accountName, databaseName, collectionName, + mergeParameters, options, ); return poller.pollUntilDone(); @@ -2303,6 +2982,144 @@ const migrateMongoDBDatabaseToManualThroughputOperationSpec: coreClient.Operatio headerParameters: [Parameters.accept], serializer, }; +const mongoDBDatabaseRetrieveThroughputDistributionOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/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.ErrorResponse, + }, + }, + requestBody: Parameters.retrieveThroughputParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; +const mongoDBDatabaseRedistributeThroughputOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/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.ErrorResponse, + }, + }, + requestBody: Parameters.redistributeThroughputParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + 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.ErrorResponse, + }, + }, + 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.ErrorResponse, + }, + }, + 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", httpMethod: "GET", @@ -2401,6 +3218,74 @@ const deleteMongoDBCollectionOperationSpec: coreClient.OperationSpec = { ], serializer, }; +const mongoDBDatabasePartitionMergeOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection, + }, + 201: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection, + }, + 202: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection, + }, + 204: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.mergeParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + 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.ErrorResponse, + }, + }, + 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", httpMethod: "GET", diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/networkSecurityPerimeterConfigurations.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/networkSecurityPerimeterConfigurations.ts new file mode 100644 index 000000000000..106ce77d679c --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/networkSecurityPerimeterConfigurations.ts @@ -0,0 +1,389 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import { NetworkSecurityPerimeterConfigurations } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import { + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationsListNextOptionalParams, + NetworkSecurityPerimeterConfigurationsListOptionalParams, + NetworkSecurityPerimeterConfigurationsListResponse, + NetworkSecurityPerimeterConfigurationsGetOptionalParams, + NetworkSecurityPerimeterConfigurationsGetResponse, + NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + NetworkSecurityPerimeterConfigurationsReconcileResponse, + NetworkSecurityPerimeterConfigurationsListNextResponse, +} from "../models/index.js"; + +/// +/** Class containing NetworkSecurityPerimeterConfigurations operations. */ +export class NetworkSecurityPerimeterConfigurationsImpl + implements NetworkSecurityPerimeterConfigurations +{ + private readonly client: CosmosDBManagementClient; + + /** + * Initialize a new instance of the class NetworkSecurityPerimeterConfigurations class. + * @param client Reference to the service client + */ + constructor(client: CosmosDBManagementClient) { + this.client = client; + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, accountName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: NetworkSecurityPerimeterConfigurationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + accountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listOperationSpec, + ); + } + + /** + * Gets effective Network Security Perimeter Configuration for association + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter + * configuration + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + options, + }, + getOperationSpec, + ); + } + + /** + * Refreshes any information about the association. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter + * configuration + * @param options The options parameters. + */ + async beginReconcile( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + NetworkSecurityPerimeterConfigurationsReconcileResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + options, + }, + spec: reconcileOperationSpec, + }); + const poller = await createHttpPoller< + NetworkSecurityPerimeterConfigurationsReconcileResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Refreshes any information about the association. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter + * configuration + * @param options The options parameters. + */ + async beginReconcileAndWait( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise { + const poller = await this.beginReconcile( + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: NetworkSecurityPerimeterConfigurationsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfigurationListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfiguration, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.networkSecurityPerimeterConfigurationName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const reconcileOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile", + httpMethod: "POST", + responses: { + 200: { + headersMapper: + Mappers.NetworkSecurityPerimeterConfigurationsReconcileHeaders, + }, + 201: { + headersMapper: + Mappers.NetworkSecurityPerimeterConfigurationsReconcileHeaders, + }, + 202: { + headersMapper: + Mappers.NetworkSecurityPerimeterConfigurationsReconcileHeaders, + }, + 204: { + headersMapper: + Mappers.NetworkSecurityPerimeterConfigurationsReconcileHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.networkSecurityPerimeterConfigurationName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.NetworkSecurityPerimeterConfigurationListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/notebookWorkspaces.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/notebookWorkspaces.ts index 5958792308a6..ffd2d6c1db54 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/notebookWorkspaces.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/notebookWorkspaces.ts @@ -7,17 +7,17 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { NotebookWorkspaces } from "../operationsInterfaces"; +import { NotebookWorkspaces } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { NotebookWorkspace, NotebookWorkspacesListByDatabaseAccountOptionalParams, @@ -33,7 +33,7 @@ import { NotebookWorkspacesListConnectionInfoResponse, NotebookWorkspacesRegenerateAuthTokenOptionalParams, NotebookWorkspacesStartOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Class containing NotebookWorkspaces operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/operations.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/operations.ts index 7fc96a8c3844..3f041859ab68 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/operations.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/operations.ts @@ -7,19 +7,19 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { Operations } from "../operationsInterfaces"; +import { setContinuationToken } from "../pagingHelper.js"; +import { Operations } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { Operation, OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, OperationsListNextResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing Operations operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/partitionKeyRangeId.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/partitionKeyRangeId.ts index 33850a65c078..3b95dea053c0 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/partitionKeyRangeId.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/partitionKeyRangeId.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { PartitionKeyRangeId } from "../operationsInterfaces"; +import { PartitionKeyRangeId } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { PartitionMetric, PartitionKeyRangeIdListMetricsOptionalParams, PartitionKeyRangeIdListMetricsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing PartitionKeyRangeId operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/partitionKeyRangeIdRegion.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/partitionKeyRangeIdRegion.ts index a73f1bb8999f..f9ffe1a9320f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/partitionKeyRangeIdRegion.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/partitionKeyRangeIdRegion.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { PartitionKeyRangeIdRegion } from "../operationsInterfaces"; +import { PartitionKeyRangeIdRegion } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { PartitionMetric, PartitionKeyRangeIdRegionListMetricsOptionalParams, PartitionKeyRangeIdRegionListMetricsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing PartitionKeyRangeIdRegion operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/percentile.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/percentile.ts index 5bc80391ddd9..c8c3d7b219ad 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/percentile.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/percentile.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { Percentile } from "../operationsInterfaces"; +import { Percentile } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { PercentileMetric, PercentileListMetricsOptionalParams, PercentileListMetricsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing Percentile operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/percentileSourceTarget.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/percentileSourceTarget.ts index 7cae76929a24..73837a319950 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/percentileSourceTarget.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/percentileSourceTarget.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { PercentileSourceTarget } from "../operationsInterfaces"; +import { PercentileSourceTarget } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { PercentileMetric, PercentileSourceTargetListMetricsOptionalParams, PercentileSourceTargetListMetricsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing PercentileSourceTarget operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/percentileTarget.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/percentileTarget.ts index 26b515a1aa20..055759598b53 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/percentileTarget.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/percentileTarget.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { PercentileTarget } from "../operationsInterfaces"; +import { PercentileTarget } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { PercentileMetric, PercentileTargetListMetricsOptionalParams, PercentileTargetListMetricsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing PercentileTarget operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/privateEndpointConnections.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/privateEndpointConnections.ts index 181a58c003e3..a74096ea0b3f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/privateEndpointConnections.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/privateEndpointConnections.ts @@ -7,17 +7,17 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { PrivateEndpointConnections } from "../operationsInterfaces"; +import { PrivateEndpointConnections } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { PrivateEndpointConnection, PrivateEndpointConnectionsListByDatabaseAccountOptionalParams, @@ -27,7 +27,7 @@ import { PrivateEndpointConnectionsCreateOrUpdateOptionalParams, PrivateEndpointConnectionsCreateOrUpdateResponse, PrivateEndpointConnectionsDeleteOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Class containing PrivateEndpointConnections operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/privateLinkResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/privateLinkResources.ts index b547cb9473bd..eb6870439d73 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/privateLinkResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/privateLinkResources.ts @@ -7,18 +7,18 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { PrivateLinkResources } from "../operationsInterfaces"; +import { PrivateLinkResources } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { PrivateLinkResource, PrivateLinkResourcesListByDatabaseAccountOptionalParams, PrivateLinkResourcesListByDatabaseAccountResponse, PrivateLinkResourcesGetOptionalParams, PrivateLinkResourcesGetResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing PrivateLinkResources operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableDatabaseAccounts.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableDatabaseAccounts.ts index 242010d63096..fee0e173b070 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableDatabaseAccounts.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableDatabaseAccounts.ts @@ -7,11 +7,11 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableDatabaseAccounts } from "../operationsInterfaces"; +import { RestorableDatabaseAccounts } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableDatabaseAccountGetResult, RestorableDatabaseAccountsListByLocationOptionalParams, @@ -20,7 +20,7 @@ import { RestorableDatabaseAccountsListResponse, RestorableDatabaseAccountsGetByLocationOptionalParams, RestorableDatabaseAccountsGetByLocationResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableDatabaseAccounts operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinDatabases.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinDatabases.ts index c024a18ae97b..116cad705e73 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinDatabases.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinDatabases.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableGremlinDatabases } from "../operationsInterfaces"; +import { RestorableGremlinDatabases } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableGremlinDatabaseGetResult, RestorableGremlinDatabasesListOptionalParams, RestorableGremlinDatabasesListResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableGremlinDatabases operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinGraphs.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinGraphs.ts index 4117ada1d84e..5b9cda792836 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinGraphs.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinGraphs.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableGremlinGraphs } from "../operationsInterfaces"; +import { RestorableGremlinGraphs } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableGremlinGraphGetResult, RestorableGremlinGraphsListOptionalParams, RestorableGremlinGraphsListResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableGremlinGraphs operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinResources.ts index 1ba63556b391..ed1325ee67e3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinResources.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableGremlinResources } from "../operationsInterfaces"; +import { RestorableGremlinResources } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableGremlinResourcesGetResult, RestorableGremlinResourcesListOptionalParams, RestorableGremlinResourcesListResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableGremlinResources operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbCollections.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbCollections.ts index 6ceb9521c6b3..3c3e84b7dd0d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbCollections.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbCollections.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableMongodbCollections } from "../operationsInterfaces"; +import { RestorableMongodbCollections } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableMongodbCollectionGetResult, RestorableMongodbCollectionsListOptionalParams, RestorableMongodbCollectionsListResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableMongodbCollections operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbDatabases.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbDatabases.ts index 5a5f8334c7f1..192e5fe916a5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbDatabases.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbDatabases.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableMongodbDatabases } from "../operationsInterfaces"; +import { RestorableMongodbDatabases } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableMongodbDatabaseGetResult, RestorableMongodbDatabasesListOptionalParams, RestorableMongodbDatabasesListResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableMongodbDatabases operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbResources.ts index 074e5fbaa01d..b3f1a902d968 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbResources.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableMongodbResources } from "../operationsInterfaces"; +import { RestorableMongodbResources } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableMongodbResourcesGetResult, RestorableMongodbResourcesListOptionalParams, RestorableMongodbResourcesListResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableMongodbResources operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlContainers.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlContainers.ts index 170c9ab3514e..2de88b147ad9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlContainers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlContainers.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableSqlContainers } from "../operationsInterfaces"; +import { RestorableSqlContainers } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableSqlContainerGetResult, RestorableSqlContainersListOptionalParams, RestorableSqlContainersListResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableSqlContainers operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlDatabases.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlDatabases.ts index 950816ebbc68..853f6c98f1f8 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlDatabases.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlDatabases.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableSqlDatabases } from "../operationsInterfaces"; +import { RestorableSqlDatabases } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableSqlDatabaseGetResult, RestorableSqlDatabasesListOptionalParams, RestorableSqlDatabasesListResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableSqlDatabases operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlResources.ts index bd7e4bd02bae..440938d80724 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlResources.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableSqlResources } from "../operationsInterfaces"; +import { RestorableSqlResources } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableSqlResourcesGetResult, RestorableSqlResourcesListOptionalParams, RestorableSqlResourcesListResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableSqlResources operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTableResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTableResources.ts index 665da79b4ef6..e7908bf65f99 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTableResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTableResources.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableTableResources } from "../operationsInterfaces"; +import { RestorableTableResources } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableTableResourcesGetResult, RestorableTableResourcesListOptionalParams, RestorableTableResourcesListResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableTableResources operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTables.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTables.ts index f1091686d3aa..e43182540102 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTables.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTables.ts @@ -7,16 +7,16 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { RestorableTables } from "../operationsInterfaces"; +import { RestorableTables } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { RestorableTableGetResult, RestorableTablesListOptionalParams, RestorableTablesListResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing RestorableTables operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/service.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/service.ts index 33db45e5a8a7..447edf69b0b2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/service.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/service.ts @@ -7,17 +7,17 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { Service } from "../operationsInterfaces"; +import { Service } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { ServiceResource, ServiceListOptionalParams, @@ -28,7 +28,7 @@ import { ServiceGetOptionalParams, ServiceGetResponse, ServiceDeleteOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Class containing Service operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/sqlResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/sqlResources.ts index 014f07fa1589..5c2d123528b4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/sqlResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/sqlResources.ts @@ -7,27 +7,27 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { SqlResources } from "../operationsInterfaces"; +import { SqlResources } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { SqlDatabaseGetResults, SqlResourcesListSqlDatabasesOptionalParams, SqlResourcesListSqlDatabasesResponse, - SqlContainerGetResults, - SqlResourcesListSqlContainersOptionalParams, - SqlResourcesListSqlContainersResponse, ClientEncryptionKeyGetResults, SqlResourcesListClientEncryptionKeysOptionalParams, SqlResourcesListClientEncryptionKeysResponse, + SqlContainerGetResults, + SqlResourcesListSqlContainersOptionalParams, + SqlResourcesListSqlContainersResponse, SqlStoredProcedureGetResults, SqlResourcesListSqlStoredProceduresOptionalParams, SqlResourcesListSqlStoredProceduresResponse, @@ -59,6 +59,11 @@ import { SqlResourcesMigrateSqlDatabaseToAutoscaleResponse, SqlResourcesMigrateSqlDatabaseToManualThroughputOptionalParams, SqlResourcesMigrateSqlDatabaseToManualThroughputResponse, + SqlResourcesGetClientEncryptionKeyOptionalParams, + SqlResourcesGetClientEncryptionKeyResponse, + ClientEncryptionKeyCreateUpdateParameters, + SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, + SqlResourcesCreateUpdateClientEncryptionKeyResponse, SqlResourcesGetSqlContainerOptionalParams, SqlResourcesGetSqlContainerResponse, SqlContainerCreateUpdateParameters, @@ -66,6 +71,11 @@ import { SqlResourcesCreateUpdateSqlContainerResponse, SqlResourcesDeleteSqlContainerOptionalParams, SqlResourcesDeleteSqlContainerResponse, + MergeParameters, + SqlResourcesSqlDatabasePartitionMergeOptionalParams, + SqlResourcesSqlDatabasePartitionMergeResponse, + SqlResourcesListSqlContainerPartitionMergeOptionalParams, + SqlResourcesListSqlContainerPartitionMergeResponse, SqlResourcesGetSqlContainerThroughputOptionalParams, SqlResourcesGetSqlContainerThroughputResponse, SqlResourcesUpdateSqlContainerThroughputOptionalParams, @@ -74,11 +84,16 @@ import { SqlResourcesMigrateSqlContainerToAutoscaleResponse, SqlResourcesMigrateSqlContainerToManualThroughputOptionalParams, SqlResourcesMigrateSqlContainerToManualThroughputResponse, - SqlResourcesGetClientEncryptionKeyOptionalParams, - SqlResourcesGetClientEncryptionKeyResponse, - ClientEncryptionKeyCreateUpdateParameters, - SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, - SqlResourcesCreateUpdateClientEncryptionKeyResponse, + RetrieveThroughputParameters, + SqlResourcesSqlDatabaseRetrieveThroughputDistributionOptionalParams, + SqlResourcesSqlDatabaseRetrieveThroughputDistributionResponse, + RedistributeThroughputParameters, + SqlResourcesSqlDatabaseRedistributeThroughputOptionalParams, + SqlResourcesSqlDatabaseRedistributeThroughputResponse, + SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams, + SqlResourcesSqlContainerRetrieveThroughputDistributionResponse, + SqlResourcesSqlContainerRedistributeThroughputOptionalParams, + SqlResourcesSqlContainerRedistributeThroughputResponse, SqlResourcesGetSqlStoredProcedureOptionalParams, SqlResourcesGetSqlStoredProcedureResponse, SqlStoredProcedureCreateUpdateParameters, @@ -115,7 +130,7 @@ import { ContinuousBackupRestoreLocation, SqlResourcesRetrieveContinuousBackupInformationOptionalParams, SqlResourcesRetrieveContinuousBackupInformationResponse, -} from "../models"; +} from "../models/index.js"; /// /** Class containing SqlResources operations. */ @@ -197,19 +212,19 @@ export class SqlResourcesImpl implements SqlResources { } /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. * @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 options The options parameters. */ - public listSqlContainers( + public listClientEncryptionKeys( resourceGroupName: string, accountName: string, databaseName: string, - options?: SqlResourcesListSqlContainersOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listSqlContainersPagingAll( + options?: SqlResourcesListClientEncryptionKeysOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listClientEncryptionKeysPagingAll( resourceGroupName, accountName, databaseName, @@ -226,7 +241,7 @@ export class SqlResourcesImpl implements SqlResources { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listSqlContainersPagingPage( + return this.listClientEncryptionKeysPagingPage( resourceGroupName, accountName, databaseName, @@ -237,15 +252,15 @@ export class SqlResourcesImpl implements SqlResources { }; } - private async *listSqlContainersPagingPage( + private async *listClientEncryptionKeysPagingPage( resourceGroupName: string, accountName: string, databaseName: string, - options?: SqlResourcesListSqlContainersOptionalParams, + options?: SqlResourcesListClientEncryptionKeysOptionalParams, _settings?: PageSettings, - ): AsyncIterableIterator { - let result: SqlResourcesListSqlContainersResponse; - result = await this._listSqlContainers( + ): AsyncIterableIterator { + let result: SqlResourcesListClientEncryptionKeysResponse; + result = await this._listClientEncryptionKeys( resourceGroupName, accountName, databaseName, @@ -254,13 +269,13 @@ export class SqlResourcesImpl implements SqlResources { yield result.value || []; } - private async *listSqlContainersPagingAll( + private async *listClientEncryptionKeysPagingAll( resourceGroupName: string, accountName: string, databaseName: string, - options?: SqlResourcesListSqlContainersOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listSqlContainersPagingPage( + options?: SqlResourcesListClientEncryptionKeysOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listClientEncryptionKeysPagingPage( resourceGroupName, accountName, databaseName, @@ -271,19 +286,19 @@ export class SqlResourcesImpl implements SqlResources { } /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * Lists the SQL container under an existing Azure Cosmos DB database account. * @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 options The options parameters. */ - public listClientEncryptionKeys( + public listSqlContainers( resourceGroupName: string, accountName: string, databaseName: string, - options?: SqlResourcesListClientEncryptionKeysOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listClientEncryptionKeysPagingAll( + options?: SqlResourcesListSqlContainersOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listSqlContainersPagingAll( resourceGroupName, accountName, databaseName, @@ -300,7 +315,7 @@ export class SqlResourcesImpl implements SqlResources { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listClientEncryptionKeysPagingPage( + return this.listSqlContainersPagingPage( resourceGroupName, accountName, databaseName, @@ -311,15 +326,15 @@ export class SqlResourcesImpl implements SqlResources { }; } - private async *listClientEncryptionKeysPagingPage( + private async *listSqlContainersPagingPage( resourceGroupName: string, accountName: string, databaseName: string, - options?: SqlResourcesListClientEncryptionKeysOptionalParams, + options?: SqlResourcesListSqlContainersOptionalParams, _settings?: PageSettings, - ): AsyncIterableIterator { - let result: SqlResourcesListClientEncryptionKeysResponse; - result = await this._listClientEncryptionKeys( + ): AsyncIterableIterator { + let result: SqlResourcesListSqlContainersResponse; + result = await this._listSqlContainers( resourceGroupName, accountName, databaseName, @@ -328,13 +343,13 @@ export class SqlResourcesImpl implements SqlResources { yield result.value || []; } - private async *listClientEncryptionKeysPagingAll( + private async *listSqlContainersPagingAll( resourceGroupName: string, accountName: string, databaseName: string, - options?: SqlResourcesListClientEncryptionKeysOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listClientEncryptionKeysPagingPage( + options?: SqlResourcesListSqlContainersOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listSqlContainersPagingPage( resourceGroupName, accountName, databaseName, @@ -1272,6 +1287,167 @@ export class SqlResourcesImpl implements SqlResources { return poller.pollUntilDone(); } + /** + * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * @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 options The options parameters. + */ + private _listClientEncryptionKeys( + resourceGroupName: string, + accountName: string, + databaseName: string, + options?: SqlResourcesListClientEncryptionKeysOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, databaseName, options }, + listClientEncryptionKeysOperationSpec, + ); + } + + /** + * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param options The options parameters. + */ + getClientEncryptionKey( + resourceGroupName: string, + accountName: string, + databaseName: string, + clientEncryptionKeyName: string, + options?: SqlResourcesGetClientEncryptionKeyOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + databaseName, + clientEncryptionKeyName, + options, + }, + getClientEncryptionKeyOperationSpec, + ); + } + + /** + * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure + * Powershell (instead of directly). + * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption + * key. + * @param options The options parameters. + */ + async beginCreateUpdateClientEncryptionKey( + resourceGroupName: string, + accountName: string, + databaseName: string, + clientEncryptionKeyName: string, + createUpdateClientEncryptionKeyParameters: ClientEncryptionKeyCreateUpdateParameters, + options?: SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SqlResourcesCreateUpdateClientEncryptionKeyResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + databaseName, + clientEncryptionKeyName, + createUpdateClientEncryptionKeyParameters, + options, + }, + spec: createUpdateClientEncryptionKeyOperationSpec, + }); + const poller = await createHttpPoller< + SqlResourcesCreateUpdateClientEncryptionKeyResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure + * Powershell (instead of directly). + * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption + * key. + * @param options The options parameters. + */ + async beginCreateUpdateClientEncryptionKeyAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + clientEncryptionKeyName: string, + createUpdateClientEncryptionKeyParameters: ClientEncryptionKeyCreateUpdateParameters, + options?: SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, + ): Promise { + const poller = await this.beginCreateUpdateClientEncryptionKey( + resourceGroupName, + accountName, + databaseName, + clientEncryptionKeyName, + createUpdateClientEncryptionKeyParameters, + options, + ); + return poller.pollUntilDone(); + } + /** * Lists the SQL container under an existing Azure Cosmos DB database account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1529,33 +1705,251 @@ export class SqlResourcesImpl implements SqlResources { } /** - * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * Merges the partitions of a SQL database * @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. */ - getSqlContainerThroughput( + async beginSqlDatabasePartitionMerge( resourceGroupName: string, accountName: string, databaseName: string, - containerName: string, - options?: SqlResourcesGetSqlContainerThroughputOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, databaseName, containerName, options }, - getSqlContainerThroughputOperationSpec, - ); - } - - /** - * Update RUs per second of 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 updateThroughputParameters The parameters to provide for the RUs per second of the current + mergeParameters: MergeParameters, + options?: SqlResourcesSqlDatabasePartitionMergeOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SqlResourcesSqlDatabasePartitionMergeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + databaseName, + mergeParameters, + options, + }, + spec: sqlDatabasePartitionMergeOperationSpec, + }); + const poller = await createHttpPoller< + SqlResourcesSqlDatabasePartitionMergeResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Merges the partitions of a SQL database + * @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 mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + async beginSqlDatabasePartitionMergeAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + mergeParameters: MergeParameters, + options?: SqlResourcesSqlDatabasePartitionMergeOptionalParams, + ): Promise { + const poller = await this.beginSqlDatabasePartitionMerge( + resourceGroupName, + accountName, + databaseName, + mergeParameters, + options, + ); + 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< + SimplePollerLike< + OperationState, + SqlResourcesListSqlContainerPartitionMergeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + databaseName, + containerName, + mergeParameters, + options, + }, + spec: listSqlContainerPartitionMergeOperationSpec, + }); + const poller = await createHttpPoller< + SqlResourcesListSqlContainerPartitionMergeResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "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. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param options The options parameters. + */ + getSqlContainerThroughput( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + options?: SqlResourcesGetSqlContainerThroughputOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, databaseName, containerName, options }, + getSqlContainerThroughputOperationSpec, + ); + } + + /** + * Update RUs per second of 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 updateThroughputParameters The parameters to provide for the RUs per second of the current * SQL container. * @param options The options parameters. */ @@ -1873,79 +2267,30 @@ export class SqlResourcesImpl implements SqlResources { } /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. - * @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 options The options parameters. - */ - private _listClientEncryptionKeys( - resourceGroupName: string, - accountName: string, - databaseName: string, - options?: SqlResourcesListClientEncryptionKeysOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, databaseName, options }, - listClientEncryptionKeysOperationSpec, - ); - } - - /** - * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. - * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param options The options parameters. - */ - getClientEncryptionKey( - resourceGroupName: string, - accountName: string, - databaseName: string, - clientEncryptionKeyName: string, - options?: SqlResourcesGetClientEncryptionKeyOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - accountName, - databaseName, - clientEncryptionKeyName, - options, - }, - getClientEncryptionKeyOperationSpec, - ); - } - - /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure - * Powershell (instead of directly). + * Retrieve throughput distribution for an Azure Cosmos DB SQL database * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption - * key. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current SQL database. * @param options The options parameters. */ - async beginCreateUpdateClientEncryptionKey( + async beginSqlDatabaseRetrieveThroughputDistribution( resourceGroupName: string, accountName: string, databaseName: string, - clientEncryptionKeyName: string, - createUpdateClientEncryptionKeyParameters: ClientEncryptionKeyCreateUpdateParameters, - options?: SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: SqlResourcesSqlDatabaseRetrieveThroughputDistributionOptionalParams, ): Promise< SimplePollerLike< - OperationState, - SqlResourcesCreateUpdateClientEncryptionKeyResponse + OperationState, + SqlResourcesSqlDatabaseRetrieveThroughputDistributionResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( @@ -1986,133 +2331,184 @@ export class SqlResourcesImpl implements SqlResources { resourceGroupName, accountName, databaseName, - clientEncryptionKeyName, - createUpdateClientEncryptionKeyParameters, + retrieveThroughputParameters, options, }, - spec: createUpdateClientEncryptionKeyOperationSpec, + spec: sqlDatabaseRetrieveThroughputDistributionOperationSpec, }); const poller = await createHttpPoller< - SqlResourcesCreateUpdateClientEncryptionKeyResponse, - OperationState + SqlResourcesSqlDatabaseRetrieveThroughputDistributionResponse, + OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure - * Powershell (instead of directly). + * Retrieve throughput distribution for an Azure Cosmos DB SQL database * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption - * key. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current SQL database. * @param options The options parameters. */ - async beginCreateUpdateClientEncryptionKeyAndWait( + async beginSqlDatabaseRetrieveThroughputDistributionAndWait( resourceGroupName: string, accountName: string, databaseName: string, - clientEncryptionKeyName: string, - createUpdateClientEncryptionKeyParameters: ClientEncryptionKeyCreateUpdateParameters, - options?: SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, - ): Promise { - const poller = await this.beginCreateUpdateClientEncryptionKey( + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: SqlResourcesSqlDatabaseRetrieveThroughputDistributionOptionalParams, + ): Promise { + const poller = await this.beginSqlDatabaseRetrieveThroughputDistribution( resourceGroupName, accountName, databaseName, - clientEncryptionKeyName, - createUpdateClientEncryptionKeyParameters, + retrieveThroughputParameters, options, ); return poller.pollUntilDone(); } /** - * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. + * Redistribute throughput for an Azure Cosmos DB SQL database * @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 database. * @param options The options parameters. */ - private _listSqlStoredProcedures( + async beginSqlDatabaseRedistributeThroughput( resourceGroupName: string, accountName: string, databaseName: string, - containerName: string, - options?: SqlResourcesListSqlStoredProceduresOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, databaseName, containerName, options }, - listSqlStoredProceduresOperationSpec, - ); + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: SqlResourcesSqlDatabaseRedistributeThroughputOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SqlResourcesSqlDatabaseRedistributeThroughputResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + databaseName, + redistributeThroughputParameters, + options, + }, + spec: sqlDatabaseRedistributeThroughputOperationSpec, + }); + const poller = await createHttpPoller< + SqlResourcesSqlDatabaseRedistributeThroughputResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; } /** - * Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. + * Redistribute throughput for an Azure Cosmos DB SQL database * @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 storedProcedureName Cosmos DB storedProcedure name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current SQL database. * @param options The options parameters. */ - getSqlStoredProcedure( + async beginSqlDatabaseRedistributeThroughputAndWait( resourceGroupName: string, accountName: string, databaseName: string, - containerName: string, - storedProcedureName: string, - options?: SqlResourcesGetSqlStoredProcedureOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - accountName, - databaseName, - containerName, - storedProcedureName, - options, - }, - getSqlStoredProcedureOperationSpec, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: SqlResourcesSqlDatabaseRedistributeThroughputOptionalParams, + ): Promise { + const poller = await this.beginSqlDatabaseRedistributeThroughput( + resourceGroupName, + accountName, + databaseName, + redistributeThroughputParameters, + options, ); + return poller.pollUntilDone(); } /** - * Create or update an Azure Cosmos DB SQL storedProcedure + * 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 storedProcedureName Cosmos DB storedProcedure name. - * @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL - * storedProcedure. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current SQL container. * @param options The options parameters. */ - async beginCreateUpdateSqlStoredProcedure( + async beginSqlContainerRetrieveThroughputDistribution( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - storedProcedureName: string, - createUpdateSqlStoredProcedureParameters: SqlStoredProcedureCreateUpdateParameters, - options?: SqlResourcesCreateUpdateSqlStoredProcedureOptionalParams, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams, ): Promise< SimplePollerLike< - OperationState, - SqlResourcesCreateUpdateSqlStoredProcedureResponse + OperationState, + SqlResourcesSqlContainerRetrieveThroughputDistributionResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( @@ -2154,81 +2550,79 @@ export class SqlResourcesImpl implements SqlResources { accountName, databaseName, containerName, - storedProcedureName, - createUpdateSqlStoredProcedureParameters, + retrieveThroughputParameters, options, }, - spec: createUpdateSqlStoredProcedureOperationSpec, + spec: sqlContainerRetrieveThroughputDistributionOperationSpec, }); const poller = await createHttpPoller< - SqlResourcesCreateUpdateSqlStoredProcedureResponse, - OperationState + SqlResourcesSqlContainerRetrieveThroughputDistributionResponse, + OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * Create or update an Azure Cosmos DB SQL storedProcedure + * 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 storedProcedureName Cosmos DB storedProcedure name. - * @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL - * storedProcedure. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current SQL container. * @param options The options parameters. */ - async beginCreateUpdateSqlStoredProcedureAndWait( + async beginSqlContainerRetrieveThroughputDistributionAndWait( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - storedProcedureName: string, - createUpdateSqlStoredProcedureParameters: SqlStoredProcedureCreateUpdateParameters, - options?: SqlResourcesCreateUpdateSqlStoredProcedureOptionalParams, - ): Promise { - const poller = await this.beginCreateUpdateSqlStoredProcedure( + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams, + ): Promise { + const poller = await this.beginSqlContainerRetrieveThroughputDistribution( resourceGroupName, accountName, databaseName, containerName, - storedProcedureName, - createUpdateSqlStoredProcedureParameters, + retrieveThroughputParameters, options, ); return poller.pollUntilDone(); } /** - * Deletes an existing Azure Cosmos DB SQL storedProcedure. + * 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 storedProcedureName Cosmos DB storedProcedure name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current SQL container. * @param options The options parameters. */ - async beginDeleteSqlStoredProcedure( + async beginSqlContainerRedistributeThroughput( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - storedProcedureName: string, - options?: SqlResourcesDeleteSqlStoredProcedureOptionalParams, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: SqlResourcesSqlContainerRedistributeThroughputOptionalParams, ): Promise< SimplePollerLike< - OperationState, - SqlResourcesDeleteSqlStoredProcedureResponse + OperationState, + SqlResourcesSqlContainerRedistributeThroughputResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( @@ -2270,130 +2664,132 @@ export class SqlResourcesImpl implements SqlResources { accountName, databaseName, containerName, - storedProcedureName, + redistributeThroughputParameters, options, }, - spec: deleteSqlStoredProcedureOperationSpec, + spec: sqlContainerRedistributeThroughputOperationSpec, }); const poller = await createHttpPoller< - SqlResourcesDeleteSqlStoredProcedureResponse, - OperationState + SqlResourcesSqlContainerRedistributeThroughputResponse, + OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", }); await poller.poll(); return poller; } /** - * Deletes an existing Azure Cosmos DB SQL storedProcedure. + * 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 storedProcedureName Cosmos DB storedProcedure name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current SQL container. * @param options The options parameters. */ - async beginDeleteSqlStoredProcedureAndWait( + async beginSqlContainerRedistributeThroughputAndWait( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - storedProcedureName: string, - options?: SqlResourcesDeleteSqlStoredProcedureOptionalParams, - ): Promise { - const poller = await this.beginDeleteSqlStoredProcedure( + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: SqlResourcesSqlContainerRedistributeThroughputOptionalParams, + ): Promise { + const poller = await this.beginSqlContainerRedistributeThroughput( resourceGroupName, accountName, databaseName, containerName, - storedProcedureName, + redistributeThroughputParameters, options, ); return poller.pollUntilDone(); } /** - * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. + * 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. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. * @param options The options parameters. */ - private _listSqlUserDefinedFunctions( + private _listSqlStoredProcedures( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - options?: SqlResourcesListSqlUserDefinedFunctionsOptionalParams, - ): Promise { + options?: SqlResourcesListSqlStoredProceduresOptionalParams, + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, databaseName, containerName, options }, - listSqlUserDefinedFunctionsOperationSpec, + listSqlStoredProceduresOperationSpec, ); } /** - * Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. + * 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. * @param accountName Cosmos DB database account name. * @param databaseName Cosmos DB database name. * @param containerName Cosmos DB container name. - * @param userDefinedFunctionName Cosmos DB userDefinedFunction name. + * @param storedProcedureName Cosmos DB storedProcedure name. * @param options The options parameters. */ - getSqlUserDefinedFunction( + getSqlStoredProcedure( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - userDefinedFunctionName: string, - options?: SqlResourcesGetSqlUserDefinedFunctionOptionalParams, - ): Promise { + storedProcedureName: string, + options?: SqlResourcesGetSqlStoredProcedureOptionalParams, + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, databaseName, containerName, - userDefinedFunctionName, + storedProcedureName, options, }, - getSqlUserDefinedFunctionOperationSpec, + getSqlStoredProcedureOperationSpec, ); } /** - * Create or update an Azure Cosmos DB SQL userDefinedFunction + * Create or update an Azure Cosmos DB SQL storedProcedure * @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 userDefinedFunctionName Cosmos DB userDefinedFunction name. - * @param createUpdateSqlUserDefinedFunctionParameters The parameters to provide for the current SQL - * userDefinedFunction. + * @param storedProcedureName Cosmos DB storedProcedure name. + * @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL + * storedProcedure. * @param options The options parameters. */ - async beginCreateUpdateSqlUserDefinedFunction( + async beginCreateUpdateSqlStoredProcedure( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - userDefinedFunctionName: string, - createUpdateSqlUserDefinedFunctionParameters: SqlUserDefinedFunctionCreateUpdateParameters, - options?: SqlResourcesCreateUpdateSqlUserDefinedFunctionOptionalParams, + storedProcedureName: string, + createUpdateSqlStoredProcedureParameters: SqlStoredProcedureCreateUpdateParameters, + options?: SqlResourcesCreateUpdateSqlStoredProcedureOptionalParams, ): Promise< SimplePollerLike< - OperationState, - SqlResourcesCreateUpdateSqlUserDefinedFunctionResponse + OperationState, + SqlResourcesCreateUpdateSqlStoredProcedureResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( @@ -2435,15 +2831,15 @@ export class SqlResourcesImpl implements SqlResources { accountName, databaseName, containerName, - userDefinedFunctionName, - createUpdateSqlUserDefinedFunctionParameters, + storedProcedureName, + createUpdateSqlStoredProcedureParameters, options, }, - spec: createUpdateSqlUserDefinedFunctionOperationSpec, + spec: createUpdateSqlStoredProcedureOperationSpec, }); const poller = await createHttpPoller< - SqlResourcesCreateUpdateSqlUserDefinedFunctionResponse, - OperationState + SqlResourcesCreateUpdateSqlStoredProcedureResponse, + OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, @@ -2453,63 +2849,63 @@ export class SqlResourcesImpl implements SqlResources { } /** - * Create or update an Azure Cosmos DB SQL userDefinedFunction + * Create or update an Azure Cosmos DB SQL storedProcedure * @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 userDefinedFunctionName Cosmos DB userDefinedFunction name. - * @param createUpdateSqlUserDefinedFunctionParameters The parameters to provide for the current SQL - * userDefinedFunction. + * @param storedProcedureName Cosmos DB storedProcedure name. + * @param createUpdateSqlStoredProcedureParameters The parameters to provide for the current SQL + * storedProcedure. * @param options The options parameters. */ - async beginCreateUpdateSqlUserDefinedFunctionAndWait( + async beginCreateUpdateSqlStoredProcedureAndWait( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - userDefinedFunctionName: string, - createUpdateSqlUserDefinedFunctionParameters: SqlUserDefinedFunctionCreateUpdateParameters, - options?: SqlResourcesCreateUpdateSqlUserDefinedFunctionOptionalParams, - ): Promise { - const poller = await this.beginCreateUpdateSqlUserDefinedFunction( + storedProcedureName: string, + createUpdateSqlStoredProcedureParameters: SqlStoredProcedureCreateUpdateParameters, + options?: SqlResourcesCreateUpdateSqlStoredProcedureOptionalParams, + ): Promise { + const poller = await this.beginCreateUpdateSqlStoredProcedure( resourceGroupName, accountName, databaseName, containerName, - userDefinedFunctionName, - createUpdateSqlUserDefinedFunctionParameters, + storedProcedureName, + createUpdateSqlStoredProcedureParameters, options, ); return poller.pollUntilDone(); } /** - * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + * Deletes an existing Azure Cosmos DB SQL storedProcedure. * @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 userDefinedFunctionName Cosmos DB userDefinedFunction name. + * @param storedProcedureName Cosmos DB storedProcedure name. * @param options The options parameters. */ - async beginDeleteSqlUserDefinedFunction( + async beginDeleteSqlStoredProcedure( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - userDefinedFunctionName: string, - options?: SqlResourcesDeleteSqlUserDefinedFunctionOptionalParams, + storedProcedureName: string, + options?: SqlResourcesDeleteSqlStoredProcedureOptionalParams, ): Promise< SimplePollerLike< - OperationState, - SqlResourcesDeleteSqlUserDefinedFunctionResponse + OperationState, + SqlResourcesDeleteSqlStoredProcedureResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( @@ -2551,14 +2947,14 @@ export class SqlResourcesImpl implements SqlResources { accountName, databaseName, containerName, - userDefinedFunctionName, + storedProcedureName, options, }, - spec: deleteSqlUserDefinedFunctionOperationSpec, + spec: deleteSqlStoredProcedureOperationSpec, }); const poller = await createHttpPoller< - SqlResourcesDeleteSqlUserDefinedFunctionResponse, - OperationState + SqlResourcesDeleteSqlStoredProcedureResponse, + OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, @@ -2568,112 +2964,113 @@ export class SqlResourcesImpl implements SqlResources { } /** - * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + * Deletes an existing Azure Cosmos DB SQL storedProcedure. * @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 userDefinedFunctionName Cosmos DB userDefinedFunction name. + * @param storedProcedureName Cosmos DB storedProcedure name. * @param options The options parameters. */ - async beginDeleteSqlUserDefinedFunctionAndWait( + async beginDeleteSqlStoredProcedureAndWait( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - userDefinedFunctionName: string, - options?: SqlResourcesDeleteSqlUserDefinedFunctionOptionalParams, - ): Promise { - const poller = await this.beginDeleteSqlUserDefinedFunction( + storedProcedureName: string, + options?: SqlResourcesDeleteSqlStoredProcedureOptionalParams, + ): Promise { + const poller = await this.beginDeleteSqlStoredProcedure( resourceGroupName, accountName, databaseName, containerName, - userDefinedFunctionName, + storedProcedureName, options, ); return poller.pollUntilDone(); } /** - * Lists the SQL trigger under an existing Azure Cosmos DB database account. + * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * @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 options The options parameters. */ - private _listSqlTriggers( + private _listSqlUserDefinedFunctions( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - options?: SqlResourcesListSqlTriggersOptionalParams, - ): Promise { + options?: SqlResourcesListSqlUserDefinedFunctionsOptionalParams, + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, databaseName, containerName, options }, - listSqlTriggersOperationSpec, + listSqlUserDefinedFunctionsOperationSpec, ); } /** - * Gets the SQL trigger under an existing Azure Cosmos DB database account. + * Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. * @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 triggerName Cosmos DB trigger name. + * @param userDefinedFunctionName Cosmos DB userDefinedFunction name. * @param options The options parameters. */ - getSqlTrigger( + getSqlUserDefinedFunction( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - triggerName: string, - options?: SqlResourcesGetSqlTriggerOptionalParams, - ): Promise { + userDefinedFunctionName: string, + options?: SqlResourcesGetSqlUserDefinedFunctionOptionalParams, + ): Promise { return this.client.sendOperationRequest( { resourceGroupName, accountName, databaseName, containerName, - triggerName, + userDefinedFunctionName, options, }, - getSqlTriggerOperationSpec, + getSqlUserDefinedFunctionOperationSpec, ); } /** - * Create or update an Azure Cosmos DB SQL trigger + * Create or update an Azure Cosmos DB SQL userDefinedFunction * @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 triggerName Cosmos DB trigger name. - * @param createUpdateSqlTriggerParameters The parameters to provide for the current SQL trigger. + * @param userDefinedFunctionName Cosmos DB userDefinedFunction name. + * @param createUpdateSqlUserDefinedFunctionParameters The parameters to provide for the current SQL + * userDefinedFunction. * @param options The options parameters. */ - async beginCreateUpdateSqlTrigger( + async beginCreateUpdateSqlUserDefinedFunction( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - triggerName: string, - createUpdateSqlTriggerParameters: SqlTriggerCreateUpdateParameters, - options?: SqlResourcesCreateUpdateSqlTriggerOptionalParams, + userDefinedFunctionName: string, + createUpdateSqlUserDefinedFunctionParameters: SqlUserDefinedFunctionCreateUpdateParameters, + options?: SqlResourcesCreateUpdateSqlUserDefinedFunctionOptionalParams, ): Promise< SimplePollerLike< - OperationState, - SqlResourcesCreateUpdateSqlTriggerResponse + OperationState, + SqlResourcesCreateUpdateSqlUserDefinedFunctionResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( @@ -2715,15 +3112,15 @@ export class SqlResourcesImpl implements SqlResources { accountName, databaseName, containerName, - triggerName, - createUpdateSqlTriggerParameters, + userDefinedFunctionName, + createUpdateSqlUserDefinedFunctionParameters, options, }, - spec: createUpdateSqlTriggerOperationSpec, + spec: createUpdateSqlUserDefinedFunctionOperationSpec, }); const poller = await createHttpPoller< - SqlResourcesCreateUpdateSqlTriggerResponse, - OperationState + SqlResourcesCreateUpdateSqlUserDefinedFunctionResponse, + OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, @@ -2733,62 +3130,63 @@ export class SqlResourcesImpl implements SqlResources { } /** - * Create or update an Azure Cosmos DB SQL trigger + * Create or update an Azure Cosmos DB SQL userDefinedFunction * @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 triggerName Cosmos DB trigger name. - * @param createUpdateSqlTriggerParameters The parameters to provide for the current SQL trigger. + * @param userDefinedFunctionName Cosmos DB userDefinedFunction name. + * @param createUpdateSqlUserDefinedFunctionParameters The parameters to provide for the current SQL + * userDefinedFunction. * @param options The options parameters. */ - async beginCreateUpdateSqlTriggerAndWait( + async beginCreateUpdateSqlUserDefinedFunctionAndWait( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - triggerName: string, - createUpdateSqlTriggerParameters: SqlTriggerCreateUpdateParameters, - options?: SqlResourcesCreateUpdateSqlTriggerOptionalParams, - ): Promise { - const poller = await this.beginCreateUpdateSqlTrigger( + userDefinedFunctionName: string, + createUpdateSqlUserDefinedFunctionParameters: SqlUserDefinedFunctionCreateUpdateParameters, + options?: SqlResourcesCreateUpdateSqlUserDefinedFunctionOptionalParams, + ): Promise { + const poller = await this.beginCreateUpdateSqlUserDefinedFunction( resourceGroupName, accountName, databaseName, containerName, - triggerName, - createUpdateSqlTriggerParameters, + userDefinedFunctionName, + createUpdateSqlUserDefinedFunctionParameters, options, ); return poller.pollUntilDone(); } /** - * Deletes an existing Azure Cosmos DB SQL trigger. + * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * @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 triggerName Cosmos DB trigger name. + * @param userDefinedFunctionName Cosmos DB userDefinedFunction name. * @param options The options parameters. */ - async beginDeleteSqlTrigger( + async beginDeleteSqlUserDefinedFunction( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - triggerName: string, - options?: SqlResourcesDeleteSqlTriggerOptionalParams, + userDefinedFunctionName: string, + options?: SqlResourcesDeleteSqlUserDefinedFunctionOptionalParams, ): Promise< SimplePollerLike< - OperationState, - SqlResourcesDeleteSqlTriggerResponse + OperationState, + SqlResourcesDeleteSqlUserDefinedFunctionResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( @@ -2830,14 +3228,14 @@ export class SqlResourcesImpl implements SqlResources { accountName, databaseName, containerName, - triggerName, + userDefinedFunctionName, options, }, - spec: deleteSqlTriggerOperationSpec, + spec: deleteSqlUserDefinedFunctionOperationSpec, }); const poller = await createHttpPoller< - SqlResourcesDeleteSqlTriggerResponse, - OperationState + SqlResourcesDeleteSqlUserDefinedFunctionResponse, + OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, @@ -2847,77 +3245,112 @@ export class SqlResourcesImpl implements SqlResources { } /** - * Deletes an existing Azure Cosmos DB SQL trigger. + * Deletes an existing Azure Cosmos DB SQL userDefinedFunction. * @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 triggerName Cosmos DB trigger name. + * @param userDefinedFunctionName Cosmos DB userDefinedFunction name. * @param options The options parameters. */ - async beginDeleteSqlTriggerAndWait( + async beginDeleteSqlUserDefinedFunctionAndWait( resourceGroupName: string, accountName: string, databaseName: string, containerName: string, - triggerName: string, - options?: SqlResourcesDeleteSqlTriggerOptionalParams, - ): Promise { - const poller = await this.beginDeleteSqlTrigger( + userDefinedFunctionName: string, + options?: SqlResourcesDeleteSqlUserDefinedFunctionOptionalParams, + ): Promise { + const poller = await this.beginDeleteSqlUserDefinedFunction( resourceGroupName, accountName, databaseName, containerName, - triggerName, + userDefinedFunctionName, options, ); return poller.pollUntilDone(); } /** - * Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. - * @param roleDefinitionId The GUID for the Role Definition. + * Lists the SQL trigger under an existing Azure Cosmos DB database account. * @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 options The options parameters. */ - getSqlRoleDefinition( - roleDefinitionId: string, + private _listSqlTriggers( resourceGroupName: string, accountName: string, - options?: SqlResourcesGetSqlRoleDefinitionOptionalParams, - ): Promise { + databaseName: string, + containerName: string, + options?: SqlResourcesListSqlTriggersOptionalParams, + ): Promise { return this.client.sendOperationRequest( - { roleDefinitionId, resourceGroupName, accountName, options }, - getSqlRoleDefinitionOperationSpec, + { resourceGroupName, accountName, databaseName, containerName, options }, + listSqlTriggersOperationSpec, ); } /** - * Creates or updates an Azure Cosmos DB SQL Role Definition. - * @param roleDefinitionId The GUID for the Role Definition. + * Gets the SQL trigger under an existing Azure Cosmos DB database account. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role - * Definition. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param triggerName Cosmos DB trigger name. * @param options The options parameters. */ - async beginCreateUpdateSqlRoleDefinition( - roleDefinitionId: string, + getSqlTrigger( resourceGroupName: string, accountName: string, - createUpdateSqlRoleDefinitionParameters: SqlRoleDefinitionCreateUpdateParameters, - options?: SqlResourcesCreateUpdateSqlRoleDefinitionOptionalParams, + databaseName: string, + containerName: string, + triggerName: string, + options?: SqlResourcesGetSqlTriggerOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + databaseName, + containerName, + triggerName, + options, + }, + getSqlTriggerOperationSpec, + ); + } + + /** + * Create or update an Azure Cosmos DB SQL trigger + * @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 triggerName Cosmos DB trigger name. + * @param createUpdateSqlTriggerParameters The parameters to provide for the current SQL trigger. + * @param options The options parameters. + */ + async beginCreateUpdateSqlTrigger( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + triggerName: string, + createUpdateSqlTriggerParameters: SqlTriggerCreateUpdateParameters, + options?: SqlResourcesCreateUpdateSqlTriggerOptionalParams, ): Promise< SimplePollerLike< - OperationState, - SqlResourcesCreateUpdateSqlRoleDefinitionResponse + OperationState, + SqlResourcesCreateUpdateSqlTriggerResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( @@ -2955,17 +3388,19 @@ export class SqlResourcesImpl implements SqlResources { const lro = createLroSpec({ sendOperationFn, args: { - roleDefinitionId, resourceGroupName, accountName, - createUpdateSqlRoleDefinitionParameters, + databaseName, + containerName, + triggerName, + createUpdateSqlTriggerParameters, options, }, - spec: createUpdateSqlRoleDefinitionOperationSpec, + spec: createUpdateSqlTriggerOperationSpec, }); const poller = await createHttpPoller< - SqlResourcesCreateUpdateSqlRoleDefinitionResponse, - OperationState + SqlResourcesCreateUpdateSqlTriggerResponse, + OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, @@ -2975,27 +3410,269 @@ export class SqlResourcesImpl implements SqlResources { } /** - * Creates or updates an Azure Cosmos DB SQL Role Definition. - * @param roleDefinitionId The GUID for the Role Definition. + * Create or update an Azure Cosmos DB SQL trigger * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role - * Definition. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param triggerName Cosmos DB trigger name. + * @param createUpdateSqlTriggerParameters The parameters to provide for the current SQL trigger. * @param options The options parameters. */ - async beginCreateUpdateSqlRoleDefinitionAndWait( - roleDefinitionId: string, + async beginCreateUpdateSqlTriggerAndWait( resourceGroupName: string, accountName: string, - createUpdateSqlRoleDefinitionParameters: SqlRoleDefinitionCreateUpdateParameters, - options?: SqlResourcesCreateUpdateSqlRoleDefinitionOptionalParams, - ): Promise { - const poller = await this.beginCreateUpdateSqlRoleDefinition( - roleDefinitionId, + databaseName: string, + containerName: string, + triggerName: string, + createUpdateSqlTriggerParameters: SqlTriggerCreateUpdateParameters, + options?: SqlResourcesCreateUpdateSqlTriggerOptionalParams, + ): Promise { + const poller = await this.beginCreateUpdateSqlTrigger( resourceGroupName, accountName, - createUpdateSqlRoleDefinitionParameters, - options, + databaseName, + containerName, + triggerName, + createUpdateSqlTriggerParameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL trigger. + * @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 triggerName Cosmos DB trigger name. + * @param options The options parameters. + */ + async beginDeleteSqlTrigger( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + triggerName: string, + options?: SqlResourcesDeleteSqlTriggerOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SqlResourcesDeleteSqlTriggerResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + databaseName, + containerName, + triggerName, + options, + }, + spec: deleteSqlTriggerOperationSpec, + }); + const poller = await createHttpPoller< + SqlResourcesDeleteSqlTriggerResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Deletes an existing Azure Cosmos DB SQL trigger. + * @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 triggerName Cosmos DB trigger name. + * @param options The options parameters. + */ + async beginDeleteSqlTriggerAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + triggerName: string, + options?: SqlResourcesDeleteSqlTriggerOptionalParams, + ): Promise { + const poller = await this.beginDeleteSqlTrigger( + resourceGroupName, + accountName, + databaseName, + containerName, + triggerName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + getSqlRoleDefinition( + roleDefinitionId: string, + resourceGroupName: string, + accountName: string, + options?: SqlResourcesGetSqlRoleDefinitionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { roleDefinitionId, resourceGroupName, accountName, options }, + getSqlRoleDefinitionOperationSpec, + ); + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Definition. + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @param options The options parameters. + */ + async beginCreateUpdateSqlRoleDefinition( + roleDefinitionId: string, + resourceGroupName: string, + accountName: string, + createUpdateSqlRoleDefinitionParameters: SqlRoleDefinitionCreateUpdateParameters, + options?: SqlResourcesCreateUpdateSqlRoleDefinitionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SqlResourcesCreateUpdateSqlRoleDefinitionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + roleDefinitionId, + resourceGroupName, + accountName, + createUpdateSqlRoleDefinitionParameters, + options, + }, + spec: createUpdateSqlRoleDefinitionOperationSpec, + }); + const poller = await createHttpPoller< + SqlResourcesCreateUpdateSqlRoleDefinitionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates an Azure Cosmos DB SQL Role Definition. + * @param roleDefinitionId The GUID for the Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateSqlRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @param options The options parameters. + */ + async beginCreateUpdateSqlRoleDefinitionAndWait( + roleDefinitionId: string, + resourceGroupName: string, + accountName: string, + createUpdateSqlRoleDefinitionParameters: SqlRoleDefinitionCreateUpdateParameters, + options?: SqlResourcesCreateUpdateSqlRoleDefinitionOptionalParams, + ): Promise { + const poller = await this.beginCreateUpdateSqlRoleDefinition( + roleDefinitionId, + resourceGroupName, + accountName, + createUpdateSqlRoleDefinitionParameters, + options, ); return poller.pollUntilDone(); } @@ -3653,12 +4330,12 @@ const migrateSqlDatabaseToManualThroughputOperationSpec: coreClient.OperationSpe headerParameters: [Parameters.accept], serializer, }; -const listSqlContainersOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers", +const listClientEncryptionKeysOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SqlContainerListResult, + bodyMapper: Mappers.ClientEncryptionKeysListResult, }, }, queryParameters: [Parameters.apiVersion], @@ -3672,12 +4349,12 @@ const listSqlContainersOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer, }; -const getSqlContainerOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", +const getClientEncryptionKeyOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.SqlContainerGetResults, + bodyMapper: Mappers.ClientEncryptionKeyGetResults, }, }, queryParameters: [Parameters.apiVersion], @@ -3687,7 +4364,77 @@ const getSqlContainerOperationSpec: coreClient.OperationSpec = { Parameters.resourceGroupName, Parameters.accountName, Parameters.databaseName, - Parameters.containerName, + Parameters.clientEncryptionKeyName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createUpdateClientEncryptionKeyOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ClientEncryptionKeyGetResults, + }, + 201: { + bodyMapper: Mappers.ClientEncryptionKeyGetResults, + }, + 202: { + bodyMapper: Mappers.ClientEncryptionKeyGetResults, + }, + 204: { + bodyMapper: Mappers.ClientEncryptionKeyGetResults, + }, + }, + requestBody: Parameters.createUpdateClientEncryptionKeyParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.clientEncryptionKeyName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listSqlContainersOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlContainerListResult, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getSqlContainerOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.SqlContainerGetResults, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.containerName, ], headerParameters: [Parameters.accept], serializer, @@ -3751,6 +4498,73 @@ const deleteSqlContainerOperationSpec: coreClient.OperationSpec = { ], serializer, }; +const sqlDatabasePartitionMergeOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection, + }, + 201: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection, + }, + 202: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection, + }, + 204: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.mergeParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + 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.ErrorResponse, + }, + }, + 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", httpMethod: "GET", @@ -3867,76 +4681,144 @@ const migrateSqlContainerToManualThroughputOperationSpec: coreClient.OperationSp headerParameters: [Parameters.accept], serializer, }; -const listClientEncryptionKeysOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ClientEncryptionKeysListResult, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.databaseName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getClientEncryptionKeyOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ClientEncryptionKeyGetResults, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.databaseName, - Parameters.clientEncryptionKeyName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createUpdateClientEncryptionKeyOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ClientEncryptionKeyGetResults, +const sqlDatabaseRetrieveThroughputDistributionOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/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.ErrorResponse, + }, }, - 201: { - bodyMapper: Mappers.ClientEncryptionKeyGetResults, + requestBody: Parameters.retrieveThroughputParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, + }; +const sqlDatabaseRedistributeThroughputOperationSpec: coreClient.OperationSpec = + { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/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.ErrorResponse, + }, }, - 202: { - bodyMapper: Mappers.ClientEncryptionKeyGetResults, + requestBody: Parameters.redistributeThroughputParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + 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.ErrorResponse, + }, }, - 204: { - bodyMapper: Mappers.ClientEncryptionKeyGetResults, + 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.ErrorResponse, + }, }, - }, - requestBody: Parameters.createUpdateClientEncryptionKeyParameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.databaseName, - Parameters.clientEncryptionKeyName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; + 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", httpMethod: "GET", diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/tableResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/tableResources.ts index 5b17b76a2f61..dcf0ea61a392 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/tableResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/tableResources.ts @@ -7,21 +7,27 @@ */ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { TableResources } from "../operationsInterfaces"; +import { TableResources } from "../operationsInterfaces/index.js"; import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; import { SimplePollerLike, OperationState, createHttpPoller, } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; +import { createLroSpec } from "../lroImpl.js"; import { TableGetResults, TableResourcesListTablesOptionalParams, TableResourcesListTablesResponse, + TableRoleDefinitionResource, + TableResourcesListTableRoleDefinitionsOptionalParams, + TableResourcesListTableRoleDefinitionsResponse, + TableRoleAssignmentResource, + TableResourcesListTableRoleAssignmentsOptionalParams, + TableResourcesListTableRoleAssignmentsResponse, TableResourcesGetTableOptionalParams, TableResourcesGetTableResponse, TableCreateUpdateParameters, @@ -41,7 +47,17 @@ import { ContinuousBackupRestoreLocation, TableResourcesRetrieveContinuousBackupInformationOptionalParams, TableResourcesRetrieveContinuousBackupInformationResponse, -} from "../models"; + TableResourcesGetTableRoleDefinitionOptionalParams, + TableResourcesGetTableRoleDefinitionResponse, + TableResourcesCreateUpdateTableRoleDefinitionOptionalParams, + TableResourcesCreateUpdateTableRoleDefinitionResponse, + TableResourcesDeleteTableRoleDefinitionOptionalParams, + TableResourcesGetTableRoleAssignmentOptionalParams, + TableResourcesGetTableRoleAssignmentResponse, + TableResourcesCreateUpdateTableRoleAssignmentOptionalParams, + TableResourcesCreateUpdateTableRoleAssignmentResponse, + TableResourcesDeleteTableRoleAssignmentOptionalParams, +} from "../models/index.js"; /// /** Class containing TableResources operations. */ @@ -118,6 +134,138 @@ export class TableResourcesImpl implements TableResources { } } + /** + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + public listTableRoleDefinitions( + resourceGroupName: string, + accountName: string, + options?: TableResourcesListTableRoleDefinitionsOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listTableRoleDefinitionsPagingAll( + resourceGroupName, + accountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listTableRoleDefinitionsPagingPage( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listTableRoleDefinitionsPagingPage( + resourceGroupName: string, + accountName: string, + options?: TableResourcesListTableRoleDefinitionsOptionalParams, + _settings?: PageSettings, + ): AsyncIterableIterator { + let result: TableResourcesListTableRoleDefinitionsResponse; + result = await this._listTableRoleDefinitions( + resourceGroupName, + accountName, + options, + ); + yield result.value || []; + } + + private async *listTableRoleDefinitionsPagingAll( + resourceGroupName: string, + accountName: string, + options?: TableResourcesListTableRoleDefinitionsOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listTableRoleDefinitionsPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + public listTableRoleAssignments( + resourceGroupName: string, + accountName: string, + options?: TableResourcesListTableRoleAssignmentsOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listTableRoleAssignmentsPagingAll( + resourceGroupName, + accountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listTableRoleAssignmentsPagingPage( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listTableRoleAssignmentsPagingPage( + resourceGroupName: string, + accountName: string, + options?: TableResourcesListTableRoleAssignmentsOptionalParams, + _settings?: PageSettings, + ): AsyncIterableIterator { + let result: TableResourcesListTableRoleAssignmentsResponse; + result = await this._listTableRoleAssignments( + resourceGroupName, + accountName, + options, + ); + yield result.value || []; + } + + private async *listTableRoleAssignmentsPagingAll( + resourceGroupName: string, + accountName: string, + options?: TableResourcesListTableRoleAssignmentsOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listTableRoleAssignmentsPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + /** * Lists the Tables under an existing Azure Cosmos DB database account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -767,161 +915,619 @@ export class TableResourcesImpl implements TableResources { ); return poller.pollUntilDone(); } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const listTablesOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.TableListResult, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getTableOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.TableGetResults, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.tableName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createUpdateTableOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.TableGetResults, - }, - 201: { - bodyMapper: Mappers.TableGetResults, - }, - 202: { - bodyMapper: Mappers.TableGetResults, - }, - 204: { - bodyMapper: Mappers.TableGetResults, - }, - }, - requestBody: Parameters.createUpdateTableParameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.tableName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteTableOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.TableResourcesDeleteTableHeaders, - }, - 201: { - headersMapper: Mappers.TableResourcesDeleteTableHeaders, - }, - 202: { - headersMapper: Mappers.TableResourcesDeleteTableHeaders, - }, - 204: { - headersMapper: Mappers.TableResourcesDeleteTableHeaders, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.tableName, - ], - serializer, -}; -const getTableThroughputOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.tableName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const updateTableThroughputOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 201: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 202: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 204: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - }, - requestBody: Parameters.updateThroughputParameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.tableName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const migrateTableToAutoscaleOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ThroughputSettingsGetResults, - }, - 201: { + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param options The options parameters. + */ + getTableRoleDefinition( + resourceGroupName: string, + accountName: string, + roleDefinitionId: string, + options?: TableResourcesGetTableRoleDefinitionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, roleDefinitionId, options }, + getTableRoleDefinitionOperationSpec, + ); + } + + /** + * Creates or updates an Azure Cosmos DB Table Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @param options The options parameters. + */ + async beginCreateUpdateTableRoleDefinition( + resourceGroupName: string, + accountName: string, + roleDefinitionId: string, + createUpdateTableRoleDefinitionParameters: TableRoleDefinitionResource, + options?: TableResourcesCreateUpdateTableRoleDefinitionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TableResourcesCreateUpdateTableRoleDefinitionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + roleDefinitionId, + createUpdateTableRoleDefinitionParameters, + options, + }, + spec: createUpdateTableRoleDefinitionOperationSpec, + }); + const poller = await createHttpPoller< + TableResourcesCreateUpdateTableRoleDefinitionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates an Azure Cosmos DB Table Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @param options The options parameters. + */ + async beginCreateUpdateTableRoleDefinitionAndWait( + resourceGroupName: string, + accountName: string, + roleDefinitionId: string, + createUpdateTableRoleDefinitionParameters: TableRoleDefinitionResource, + options?: TableResourcesCreateUpdateTableRoleDefinitionOptionalParams, + ): Promise { + const poller = await this.beginCreateUpdateTableRoleDefinition( + resourceGroupName, + accountName, + roleDefinitionId, + createUpdateTableRoleDefinitionParameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an existing Azure Cosmos DB Table Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param options The options parameters. + */ + async beginDeleteTableRoleDefinition( + resourceGroupName: string, + accountName: string, + roleDefinitionId: string, + options?: TableResourcesDeleteTableRoleDefinitionOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, roleDefinitionId, options }, + spec: deleteTableRoleDefinitionOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Deletes an existing Azure Cosmos DB Table Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param options The options parameters. + */ + async beginDeleteTableRoleDefinitionAndWait( + resourceGroupName: string, + accountName: string, + roleDefinitionId: string, + options?: TableResourcesDeleteTableRoleDefinitionOptionalParams, + ): Promise { + const poller = await this.beginDeleteTableRoleDefinition( + resourceGroupName, + accountName, + roleDefinitionId, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + private _listTableRoleDefinitions( + resourceGroupName: string, + accountName: string, + options?: TableResourcesListTableRoleDefinitionsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listTableRoleDefinitionsOperationSpec, + ); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param options The options parameters. + */ + getTableRoleAssignment( + resourceGroupName: string, + accountName: string, + roleAssignmentId: string, + options?: TableResourcesGetTableRoleAssignmentOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, roleAssignmentId, options }, + getTableRoleAssignmentOperationSpec, + ); + } + + /** + * Creates or updates an Azure Cosmos DB Table Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @param options The options parameters. + */ + async beginCreateUpdateTableRoleAssignment( + resourceGroupName: string, + accountName: string, + roleAssignmentId: string, + createUpdateTableRoleAssignmentParameters: TableRoleAssignmentResource, + options?: TableResourcesCreateUpdateTableRoleAssignmentOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TableResourcesCreateUpdateTableRoleAssignmentResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + accountName, + roleAssignmentId, + createUpdateTableRoleAssignmentParameters, + options, + }, + spec: createUpdateTableRoleAssignmentOperationSpec, + }); + const poller = await createHttpPoller< + TableResourcesCreateUpdateTableRoleAssignmentResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates an Azure Cosmos DB Table Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @param options The options parameters. + */ + async beginCreateUpdateTableRoleAssignmentAndWait( + resourceGroupName: string, + accountName: string, + roleAssignmentId: string, + createUpdateTableRoleAssignmentParameters: TableRoleAssignmentResource, + options?: TableResourcesCreateUpdateTableRoleAssignmentOptionalParams, + ): Promise { + const poller = await this.beginCreateUpdateTableRoleAssignment( + resourceGroupName, + accountName, + roleAssignmentId, + createUpdateTableRoleAssignmentParameters, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an existing Azure Cosmos DB Table Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param options The options parameters. + */ + async beginDeleteTableRoleAssignment( + resourceGroupName: string, + accountName: string, + roleAssignmentId: string, + options?: TableResourcesDeleteTableRoleAssignmentOptionalParams, + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, roleAssignmentId, options }, + spec: deleteTableRoleAssignmentOperationSpec, + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Deletes an existing Azure Cosmos DB Table Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param options The options parameters. + */ + async beginDeleteTableRoleAssignmentAndWait( + resourceGroupName: string, + accountName: string, + roleAssignmentId: string, + options?: TableResourcesDeleteTableRoleAssignmentOptionalParams, + ): Promise { + const poller = await this.beginDeleteTableRoleAssignment( + resourceGroupName, + accountName, + roleAssignmentId, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + private _listTableRoleAssignments( + resourceGroupName: string, + accountName: string, + options?: TableResourcesListTableRoleAssignmentsOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listTableRoleAssignmentsOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listTablesOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TableListResult, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getTableOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TableGetResults, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.tableName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createUpdateTableOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.TableGetResults, + }, + 201: { + bodyMapper: Mappers.TableGetResults, + }, + 202: { + bodyMapper: Mappers.TableGetResults, + }, + 204: { + bodyMapper: Mappers.TableGetResults, + }, + }, + requestBody: Parameters.createUpdateTableParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.tableName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteTableOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.TableResourcesDeleteTableHeaders, + }, + 201: { + headersMapper: Mappers.TableResourcesDeleteTableHeaders, + }, + 202: { + headersMapper: Mappers.TableResourcesDeleteTableHeaders, + }, + 204: { + headersMapper: Mappers.TableResourcesDeleteTableHeaders, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.tableName, + ], + serializer, +}; +const getTableThroughputOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.tableName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const updateTableThroughputOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 201: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 202: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 204: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + }, + requestBody: Parameters.updateThroughputParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.tableName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const migrateTableToAutoscaleOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ThroughputSettingsGetResults, + }, + 201: { bodyMapper: Mappers.ThroughputSettingsGetResults, }, 202: { @@ -1010,3 +1616,201 @@ const retrieveContinuousBackupInformationOperationSpec: coreClient.OperationSpec mediaType: "json", serializer, }; +const getTableRoleDefinitionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TableRoleDefinitionResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.roleDefinitionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createUpdateTableRoleDefinitionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.TableRoleDefinitionResource, + }, + 201: { + bodyMapper: Mappers.TableRoleDefinitionResource, + }, + 202: { + bodyMapper: Mappers.TableRoleDefinitionResource, + }, + 204: { + bodyMapper: Mappers.TableRoleDefinitionResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.createUpdateTableRoleDefinitionParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.roleDefinitionId, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteTableRoleDefinitionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.roleDefinitionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listTableRoleDefinitionsOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TableRoleDefinitionListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getTableRoleAssignmentOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TableRoleAssignmentResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.roleAssignmentId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createUpdateTableRoleAssignmentOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.TableRoleAssignmentResource, + }, + 201: { + bodyMapper: Mappers.TableRoleAssignmentResource, + }, + 202: { + bodyMapper: Mappers.TableRoleAssignmentResource, + }, + 204: { + bodyMapper: Mappers.TableRoleAssignmentResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.createUpdateTableRoleAssignmentParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.roleAssignmentId, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteTableRoleAssignmentOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.roleAssignmentId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listTableRoleAssignmentsOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.TableRoleAssignmentListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPool.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPool.ts new file mode 100644 index 000000000000..07814530ccf8 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPool.ts @@ -0,0 +1,454 @@ +/* + * 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 { ThroughputPool } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import { + ThroughputPoolGetOptionalParams, + ThroughputPoolGetResponse, + ThroughputPoolResource, + ThroughputPoolCreateOrUpdateOptionalParams, + ThroughputPoolCreateOrUpdateResponse, + ThroughputPoolUpdateOptionalParams, + ThroughputPoolUpdateResponse, + ThroughputPoolDeleteOptionalParams, + ThroughputPoolDeleteResponse, +} from "../models/index.js"; + +/** Class containing ThroughputPool operations. */ +export class ThroughputPoolImpl implements ThroughputPool { + private readonly client: CosmosDBManagementClient; + + /** + * Initialize a new instance of the class ThroughputPool class. + * @param client Reference to the service client + */ + constructor(client: CosmosDBManagementClient) { + this.client = client; + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, throughputPoolName, options }, + getOperationSpec, + ); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when + * performing updates on an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + throughputPoolName: string, + body: ThroughputPoolResource, + options?: ThroughputPoolCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ThroughputPoolCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, throughputPoolName, body, options }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + ThroughputPoolCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when + * performing updates on an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + throughputPoolName: string, + body: ThroughputPoolResource, + options?: ThroughputPoolCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + throughputPoolName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ThroughputPoolUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, throughputPoolName, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + ThroughputPoolUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + throughputPoolName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ThroughputPoolDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, throughputPoolName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + ThroughputPoolDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + throughputPoolName, + options, + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ThroughputPoolResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.throughputPoolName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ThroughputPoolResource, + }, + 201: { + bodyMapper: Mappers.ThroughputPoolResource, + }, + 202: { + bodyMapper: Mappers.ThroughputPoolResource, + }, + 204: { + bodyMapper: Mappers.ThroughputPoolResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.throughputPoolName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ThroughputPoolResource, + }, + 201: { + bodyMapper: Mappers.ThroughputPoolResource, + }, + 202: { + bodyMapper: Mappers.ThroughputPoolResource, + }, + 204: { + bodyMapper: Mappers.ThroughputPoolResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.throughputPoolName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.ThroughputPoolDeleteHeaders, + }, + 201: { + headersMapper: Mappers.ThroughputPoolDeleteHeaders, + }, + 202: { + headersMapper: Mappers.ThroughputPoolDeleteHeaders, + }, + 204: { + headersMapper: Mappers.ThroughputPoolDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.throughputPoolName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPoolAccount.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPoolAccount.ts new file mode 100644 index 000000000000..b85a8eca6434 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPoolAccount.ts @@ -0,0 +1,361 @@ +/* + * 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 { ThroughputPoolAccount } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl.js"; +import { + ThroughputPoolAccountGetOptionalParams, + ThroughputPoolAccountGetResponse, + ThroughputPoolAccountResource, + ThroughputPoolAccountCreateOptionalParams, + ThroughputPoolAccountCreateResponse, + ThroughputPoolAccountDeleteOptionalParams, + ThroughputPoolAccountDeleteResponse, +} from "../models/index.js"; + +/** Class containing ThroughputPoolAccount operations. */ +export class ThroughputPoolAccountImpl implements ThroughputPoolAccount { + private readonly client: CosmosDBManagementClient; + + /** + * Initialize a new instance of the class ThroughputPoolAccount class. + * @param client Reference to the service client + */ + constructor(client: CosmosDBManagementClient) { + this.client = client; + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool + * @param options The options parameters. + */ + get( + resourceGroupName: string, + throughputPoolName: string, + throughputPoolAccountName: string, + options?: ThroughputPoolAccountGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + options, + }, + getOperationSpec, + ); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when + * performing updates on an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + throughputPoolName: string, + throughputPoolAccountName: string, + body: ThroughputPoolAccountResource, + options?: ThroughputPoolAccountCreateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ThroughputPoolAccountCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + body, + options, + }, + spec: createOperationSpec, + }); + const poller = await createHttpPoller< + ThroughputPoolAccountCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when + * performing updates on an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + throughputPoolName: string, + throughputPoolAccountName: string, + body: ThroughputPoolAccountResource, + options?: ThroughputPoolAccountCreateOptionalParams, + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + body, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + throughputPoolName: string, + throughputPoolAccountName: string, + options?: ThroughputPoolAccountDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ThroughputPoolAccountDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + options, + }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + ThroughputPoolAccountDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + }); + await poller.poll(); + return poller; + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + throughputPoolName: string, + throughputPoolAccountName: string, + options?: ThroughputPoolAccountDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + throughputPoolName, + throughputPoolAccountName, + options, + ); + return poller.pollUntilDone(); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ThroughputPoolAccountResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.throughputPoolName, + Parameters.throughputPoolAccountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ThroughputPoolAccountResource, + }, + 201: { + bodyMapper: Mappers.ThroughputPoolAccountResource, + }, + 202: { + bodyMapper: Mappers.ThroughputPoolAccountResource, + }, + 204: { + bodyMapper: Mappers.ThroughputPoolAccountResource, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.throughputPoolName, + Parameters.throughputPoolAccountName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.ThroughputPoolAccountDeleteHeaders, + }, + 201: { + headersMapper: Mappers.ThroughputPoolAccountDeleteHeaders, + }, + 202: { + headersMapper: Mappers.ThroughputPoolAccountDeleteHeaders, + }, + 204: { + headersMapper: Mappers.ThroughputPoolAccountDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.throughputPoolName, + Parameters.throughputPoolAccountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPoolAccounts.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPoolAccounts.ts new file mode 100644 index 000000000000..50f48cf5604e --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPoolAccounts.ts @@ -0,0 +1,197 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import { ThroughputPoolAccounts } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; +import { + ThroughputPoolAccountResource, + ThroughputPoolAccountsListNextOptionalParams, + ThroughputPoolAccountsListOptionalParams, + ThroughputPoolAccountsListResponse, + ThroughputPoolAccountsListNextResponse, +} from "../models/index.js"; + +/// +/** Class containing ThroughputPoolAccounts operations. */ +export class ThroughputPoolAccountsImpl implements ThroughputPoolAccounts { + private readonly client: CosmosDBManagementClient; + + /** + * Initialize a new instance of the class ThroughputPoolAccounts class. + * @param client Reference to the service client + */ + constructor(client: CosmosDBManagementClient) { + this.client = client; + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolAccountsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + resourceGroupName, + throughputPoolName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + throughputPoolName, + options, + settings, + ); + }, + }; + } + + private async *listPagingPage( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolAccountsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: ThroughputPoolAccountsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, throughputPoolName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + throughputPoolName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolAccountsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + throughputPoolName, + options, + )) { + yield* page; + } + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolAccountsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, throughputPoolName, options }, + listOperationSpec, + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + throughputPoolName: string, + nextLink: string, + options?: ThroughputPoolAccountsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, throughputPoolName, nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ThroughputPoolAccountsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.throughputPoolName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ThroughputPoolAccountsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.throughputPoolName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPools.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPools.ts new file mode 100644 index 000000000000..2e4ba1d240f1 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/throughputPools.ts @@ -0,0 +1,298 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper.js"; +import { ThroughputPools } from "../operationsInterfaces/index.js"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers.js"; +import * as Parameters from "../models/parameters.js"; +import { CosmosDBManagementClient } from "../cosmosDBManagementClient.js"; +import { + ThroughputPoolResource, + ThroughputPoolsListNextOptionalParams, + ThroughputPoolsListOptionalParams, + ThroughputPoolsListResponse, + ThroughputPoolsListByResourceGroupNextOptionalParams, + ThroughputPoolsListByResourceGroupOptionalParams, + ThroughputPoolsListByResourceGroupResponse, + ThroughputPoolsListNextResponse, + ThroughputPoolsListByResourceGroupNextResponse, +} from "../models/index.js"; + +/// +/** Class containing ThroughputPools operations. */ +export class ThroughputPoolsImpl implements ThroughputPools { + private readonly client: CosmosDBManagementClient; + + /** + * Initialize a new instance of the class ThroughputPools class. + * @param client Reference to the service client + */ + constructor(client: CosmosDBManagementClient) { + this.client = client; + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * @param options The options parameters. + */ + public list( + options?: ThroughputPoolsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: ThroughputPoolsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: ThroughputPoolsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: ThroughputPoolsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List all the ThroughputPools in a given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: ThroughputPoolsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ThroughputPoolsListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: ThroughputPoolsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ThroughputPoolsListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options, + )) { + yield* page; + } + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * @param options The options parameters. + */ + private _list( + options?: ThroughputPoolsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * List all the ThroughputPools in a given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ThroughputPoolsListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: ThroughputPoolsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ThroughputPoolsListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ThroughputPoolsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ThroughputPoolsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ThroughputPoolsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ThroughputPoolsListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraClusters.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraClusters.ts index ee04087b70ce..ef5892b03e67 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraClusters.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraClusters.ts @@ -12,6 +12,10 @@ import { ClusterResource, CassandraClustersListBySubscriptionOptionalParams, CassandraClustersListByResourceGroupOptionalParams, + CommandPublicResource, + CassandraClustersListCommandOptionalParams, + BackupResource, + CassandraClustersListBackupsOptionalParams, CassandraClustersGetOptionalParams, CassandraClustersGetResponse, CassandraClustersDeleteOptionalParams, @@ -22,11 +26,18 @@ import { CommandPostBody, CassandraClustersInvokeCommandOptionalParams, CassandraClustersInvokeCommandResponse, + CommandAsyncPostBody, + CassandraClustersInvokeCommandAsyncOptionalParams, + CassandraClustersInvokeCommandAsyncResponse, + CassandraClustersGetCommandAsyncOptionalParams, + CassandraClustersGetCommandAsyncResponse, + CassandraClustersGetBackupOptionalParams, + CassandraClustersGetBackupResponse, CassandraClustersDeallocateOptionalParams, CassandraClustersStartOptionalParams, CassandraClustersStatusOptionalParams, CassandraClustersStatusResponse, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a CassandraClusters. */ @@ -47,6 +58,28 @@ export interface CassandraClusters { resourceGroupName: string, options?: CassandraClustersListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; + /** + * List all commands currently running on ring info + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param options The options parameters. + */ + listCommand( + resourceGroupName: string, + clusterName: string, + options?: CassandraClustersListCommandOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List the backups of this cluster that are available to restore. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param options The options parameters. + */ + listBackups( + resourceGroupName: string, + clusterName: string, + options?: CassandraClustersListBackupsOptionalParams, + ): PagedAsyncIterableIterator; /** * Get the properties of a managed Cassandra cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -175,6 +208,63 @@ export interface CassandraClusters { body: CommandPostBody, options?: CassandraClustersInvokeCommandOptionalParams, ): Promise; + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where + * @param options The options parameters. + */ + beginInvokeCommandAsync( + resourceGroupName: string, + clusterName: string, + body: CommandAsyncPostBody, + options?: CassandraClustersInvokeCommandAsyncOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CassandraClustersInvokeCommandAsyncResponse + > + >; + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where + * @param options The options parameters. + */ + beginInvokeCommandAsyncAndWait( + resourceGroupName: string, + clusterName: string, + body: CommandAsyncPostBody, + options?: CassandraClustersInvokeCommandAsyncOptionalParams, + ): Promise; + /** + * Get details about a specified command that was run asynchronously. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @param options The options parameters. + */ + getCommandAsync( + resourceGroupName: string, + clusterName: string, + commandId: string, + options?: CassandraClustersGetCommandAsyncOptionalParams, + ): Promise; + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @param options The options parameters. + */ + getBackup( + resourceGroupName: string, + clusterName: string, + backupId: string, + options?: CassandraClustersGetBackupOptionalParams, + ): Promise; /** * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate * the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraDataCenters.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraDataCenters.ts index c929b878db6f..8f703f6c188e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraDataCenters.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraDataCenters.ts @@ -18,7 +18,7 @@ import { CassandraDataCentersCreateUpdateResponse, CassandraDataCentersUpdateOptionalParams, CassandraDataCentersUpdateResponse, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a CassandraDataCenters. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraResources.ts index 6b9eeca3a70d..334515a1e0b7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/cassandraResources.ts @@ -13,6 +13,8 @@ import { CassandraResourcesListCassandraKeyspacesOptionalParams, CassandraTableGetResults, CassandraResourcesListCassandraTablesOptionalParams, + CassandraViewGetResults, + CassandraResourcesListCassandraViewsOptionalParams, CassandraResourcesGetCassandraKeyspaceOptionalParams, CassandraResourcesGetCassandraKeyspaceResponse, CassandraKeyspaceCreateUpdateParameters, @@ -44,7 +46,21 @@ import { CassandraResourcesMigrateCassandraTableToAutoscaleResponse, CassandraResourcesMigrateCassandraTableToManualThroughputOptionalParams, CassandraResourcesMigrateCassandraTableToManualThroughputResponse, -} from "../models"; + CassandraResourcesGetCassandraViewOptionalParams, + CassandraResourcesGetCassandraViewResponse, + CassandraViewCreateUpdateParameters, + CassandraResourcesCreateUpdateCassandraViewOptionalParams, + CassandraResourcesCreateUpdateCassandraViewResponse, + CassandraResourcesDeleteCassandraViewOptionalParams, + CassandraResourcesGetCassandraViewThroughputOptionalParams, + CassandraResourcesGetCassandraViewThroughputResponse, + CassandraResourcesUpdateCassandraViewThroughputOptionalParams, + CassandraResourcesUpdateCassandraViewThroughputResponse, + CassandraResourcesMigrateCassandraViewToAutoscaleOptionalParams, + CassandraResourcesMigrateCassandraViewToAutoscaleResponse, + CassandraResourcesMigrateCassandraViewToManualThroughputOptionalParams, + CassandraResourcesMigrateCassandraViewToManualThroughputResponse, +} from "../models/index.js"; /// /** Interface representing a CassandraResources. */ @@ -73,6 +89,19 @@ export interface CassandraResources { keyspaceName: string, options?: CassandraResourcesListCassandraTablesOptionalParams, ): PagedAsyncIterableIterator; + /** + * Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param options The options parameters. + */ + listCassandraViews( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + options?: CassandraResourcesListCassandraViewsOptionalParams, + ): PagedAsyncIterableIterator; /** * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided * name. @@ -486,4 +515,215 @@ export interface CassandraResources { tableName: string, options?: CassandraResourcesMigrateCassandraTableToManualThroughputOptionalParams, ): Promise; + /** + * Gets the Cassandra view under an existing Azure Cosmos DB database account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + getCassandraView( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesGetCassandraViewOptionalParams, + ): Promise; + /** + * Create or update an Azure Cosmos DB Cassandra View + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @param options The options parameters. + */ + beginCreateUpdateCassandraView( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + createUpdateCassandraViewParameters: CassandraViewCreateUpdateParameters, + options?: CassandraResourcesCreateUpdateCassandraViewOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CassandraResourcesCreateUpdateCassandraViewResponse + > + >; + /** + * Create or update an Azure Cosmos DB Cassandra View + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @param options The options parameters. + */ + beginCreateUpdateCassandraViewAndWait( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + createUpdateCassandraViewParameters: CassandraViewCreateUpdateParameters, + options?: CassandraResourcesCreateUpdateCassandraViewOptionalParams, + ): Promise; + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + beginDeleteCassandraView( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesDeleteCassandraViewOptionalParams, + ): Promise, void>>; + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + beginDeleteCassandraViewAndWait( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesDeleteCassandraViewOptionalParams, + ): Promise; + /** + * Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account + * with the provided name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + getCassandraViewThroughput( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesGetCassandraViewThroughputOptionalParams, + ): Promise; + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current + * Cassandra view. + * @param options The options parameters. + */ + beginUpdateCassandraViewThroughput( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + updateThroughputParameters: ThroughputSettingsUpdateParameters, + options?: CassandraResourcesUpdateCassandraViewThroughputOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CassandraResourcesUpdateCassandraViewThroughputResponse + > + >; + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current + * Cassandra view. + * @param options The options parameters. + */ + beginUpdateCassandraViewThroughputAndWait( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + updateThroughputParameters: ThroughputSettingsUpdateParameters, + options?: CassandraResourcesUpdateCassandraViewThroughputOptionalParams, + ): Promise; + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + beginMigrateCassandraViewToAutoscale( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesMigrateCassandraViewToAutoscaleOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CassandraResourcesMigrateCassandraViewToAutoscaleResponse + > + >; + /** + * Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + beginMigrateCassandraViewToAutoscaleAndWait( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesMigrateCassandraViewToAutoscaleOptionalParams, + ): Promise; + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + beginMigrateCassandraViewToManualThroughput( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesMigrateCassandraViewToManualThroughputOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CassandraResourcesMigrateCassandraViewToManualThroughputResponse + > + >; + /** + * Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param options The options parameters. + */ + beginMigrateCassandraViewToManualThroughputAndWait( + resourceGroupName: string, + accountName: string, + keyspaceName: string, + viewName: string, + options?: CassandraResourcesMigrateCassandraViewToManualThroughputOptionalParams, + ): Promise; } diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/chaosFault.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/chaosFault.ts new file mode 100644 index 000000000000..6aae84ad8a85 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/chaosFault.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + ChaosFaultResource, + ChaosFaultListOptionalParams, + ChaosFaultEnableDisableOptionalParams, + ChaosFaultEnableDisableResponse, + ChaosFaultGetOptionalParams, + ChaosFaultGetResponse, +} from "../models/index.js"; + +/// +/** Interface representing a ChaosFault. */ +export interface ChaosFault { + /** + * List Chaos Faults for CosmosDB account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + accountName: string, + options?: ChaosFaultListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param options The options parameters. + */ + beginEnableDisable( + resourceGroupName: string, + accountName: string, + chaosFault: string, + chaosFaultRequest: ChaosFaultResource, + options?: ChaosFaultEnableDisableOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ChaosFaultEnableDisableResponse + > + >; + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param options The options parameters. + */ + beginEnableDisableAndWait( + resourceGroupName: string, + accountName: string, + chaosFault: string, + chaosFaultRequest: ChaosFaultResource, + options?: ChaosFaultEnableDisableOptionalParams, + ): Promise; + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + chaosFault: string, + options?: ChaosFaultGetOptionalParams, + ): Promise; +} diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collection.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collection.ts index 3a96611aeab1..bf4269cc3f17 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collection.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collection.ts @@ -14,7 +14,7 @@ import { CollectionListUsagesOptionalParams, MetricDefinition, CollectionListMetricDefinitionsOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a Collection. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionPartition.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionPartition.ts index af7c4203cef8..4c6358d6b652 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionPartition.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionPartition.ts @@ -12,7 +12,7 @@ import { CollectionPartitionListMetricsOptionalParams, PartitionUsage, CollectionPartitionListUsagesOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a CollectionPartition. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionPartitionRegion.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionPartitionRegion.ts index 54236e4084f7..eefda134c5ac 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionPartitionRegion.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionPartitionRegion.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { PartitionMetric, CollectionPartitionRegionListMetricsOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a CollectionPartitionRegion. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionRegion.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionRegion.ts index a36e1d297b66..db7c567f1248 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionRegion.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/collectionRegion.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { Metric, CollectionRegionListMetricsOptionalParams } from "../models"; +import { Metric, CollectionRegionListMetricsOptionalParams } from "../models/index.js"; /// /** Interface representing a CollectionRegion. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/dataTransferJobs.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/dataTransferJobs.ts new file mode 100644 index 000000000000..b8f3107289ab --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/dataTransferJobs.ts @@ -0,0 +1,122 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + DataTransferJobGetResults, + DataTransferJobsListByDatabaseAccountOptionalParams, + CreateJobRequest, + DataTransferJobsCreateOptionalParams, + DataTransferJobsCreateResponse, + DataTransferJobsGetOptionalParams, + DataTransferJobsGetResponse, + DataTransferJobsPauseOptionalParams, + DataTransferJobsPauseResponse, + DataTransferJobsResumeOptionalParams, + DataTransferJobsResumeResponse, + DataTransferJobsCancelOptionalParams, + DataTransferJobsCancelResponse, + DataTransferJobsCompleteOptionalParams, + DataTransferJobsCompleteResponse, +} from "../models/index.js"; + +/// +/** Interface representing a DataTransferJobs. */ +export interface DataTransferJobs { + /** + * Get a list of Data Transfer jobs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + listByDatabaseAccount( + resourceGroupName: string, + accountName: string, + options?: DataTransferJobsListByDatabaseAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Creates 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 jobCreateParameters Parameters to create Data Transfer Job + * @param options The options parameters. + */ + create( + resourceGroupName: string, + accountName: string, + jobName: string, + jobCreateParameters: CreateJobRequest, + options?: DataTransferJobsCreateOptionalParams, + ): Promise; + /** + * Get 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. + */ + get( + resourceGroupName: string, + accountName: string, + 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; + /** + * Completes a Data Transfer Online 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. + */ + complete( + resourceGroupName: string, + accountName: string, + jobName: string, + options?: DataTransferJobsCompleteOptionalParams, + ): Promise; +} diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/database.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/database.ts index 77bf37090799..c3c4e3fe5027 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/database.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/database.ts @@ -14,7 +14,7 @@ import { DatabaseListUsagesOptionalParams, MetricDefinition, DatabaseListMetricDefinitionsOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a Database. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/databaseAccountRegion.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/databaseAccountRegion.ts index dd2daa4e9cb2..5354e94d1520 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/databaseAccountRegion.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/databaseAccountRegion.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { Metric, DatabaseAccountRegionListMetricsOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a DatabaseAccountRegion. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/databaseAccounts.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/databaseAccounts.ts index 8b15b7f1faf8..a8df42bdaf9f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/databaseAccounts.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/databaseAccounts.ts @@ -46,7 +46,7 @@ import { DatabaseAccountsRegenerateKeyOptionalParams, DatabaseAccountsCheckNameExistsOptionalParams, DatabaseAccountsCheckNameExistsResponse, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a DatabaseAccounts. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/graphResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/graphResources.ts new file mode 100644 index 000000000000..7adeeb5f8c0a --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/graphResources.ts @@ -0,0 +1,110 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + GraphResourceGetResults, + GraphResourcesListGraphsOptionalParams, + GraphResourcesGetGraphOptionalParams, + GraphResourcesGetGraphResponse, + GraphResourceCreateUpdateParameters, + GraphResourcesCreateUpdateGraphOptionalParams, + GraphResourcesCreateUpdateGraphResponse, + GraphResourcesDeleteGraphResourceOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a GraphResources. */ +export interface GraphResources { + /** + * Lists the graphs under an existing Azure Cosmos DB database account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + listGraphs( + resourceGroupName: string, + accountName: string, + options?: GraphResourcesListGraphsOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param options The options parameters. + */ + getGraph( + resourceGroupName: string, + accountName: string, + graphName: string, + options?: GraphResourcesGetGraphOptionalParams, + ): Promise; + /** + * Create or update an Azure Cosmos DB Graph. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @param options The options parameters. + */ + beginCreateUpdateGraph( + resourceGroupName: string, + accountName: string, + graphName: string, + createUpdateGraphParameters: GraphResourceCreateUpdateParameters, + options?: GraphResourcesCreateUpdateGraphOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + GraphResourcesCreateUpdateGraphResponse + > + >; + /** + * Create or update an Azure Cosmos DB Graph. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @param options The options parameters. + */ + beginCreateUpdateGraphAndWait( + resourceGroupName: string, + accountName: string, + graphName: string, + createUpdateGraphParameters: GraphResourceCreateUpdateParameters, + options?: GraphResourcesCreateUpdateGraphOptionalParams, + ): Promise; + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param options The options parameters. + */ + beginDeleteGraphResource( + resourceGroupName: string, + accountName: string, + graphName: string, + options?: GraphResourcesDeleteGraphResourceOptionalParams, + ): Promise, void>>; + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param options The options parameters. + */ + beginDeleteGraphResourceAndWait( + resourceGroupName: string, + accountName: string, + graphName: string, + options?: GraphResourcesDeleteGraphResourceOptionalParams, + ): Promise; +} diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/gremlinResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/gremlinResources.ts index ed1fac2bbdef..fc58d9e65549 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/gremlinResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/gremlinResources.ts @@ -47,7 +47,7 @@ import { ContinuousBackupRestoreLocation, GremlinResourcesRetrieveContinuousBackupInformationOptionalParams, GremlinResourcesRetrieveContinuousBackupInformationResponse, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a GremlinResources. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/index.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/index.ts index 96531b8c1b96..1aa7da1805c7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/index.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/index.ts @@ -6,40 +6,48 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -export * from "./databaseAccounts"; -export * from "./operations"; -export * from "./database"; -export * from "./collection"; -export * from "./collectionRegion"; -export * from "./databaseAccountRegion"; -export * from "./percentileSourceTarget"; -export * from "./percentileTarget"; -export * from "./percentile"; -export * from "./collectionPartitionRegion"; -export * from "./collectionPartition"; -export * from "./partitionKeyRangeId"; -export * from "./partitionKeyRangeIdRegion"; -export * from "./sqlResources"; -export * from "./mongoDBResources"; -export * from "./tableResources"; -export * from "./cassandraResources"; -export * from "./gremlinResources"; -export * from "./locations"; -export * from "./cassandraClusters"; -export * from "./cassandraDataCenters"; -export * from "./notebookWorkspaces"; -export * from "./privateEndpointConnections"; -export * from "./privateLinkResources"; -export * from "./restorableDatabaseAccounts"; -export * from "./restorableSqlDatabases"; -export * from "./restorableSqlContainers"; -export * from "./restorableSqlResources"; -export * from "./restorableMongodbDatabases"; -export * from "./restorableMongodbCollections"; -export * from "./restorableMongodbResources"; -export * from "./restorableGremlinDatabases"; -export * from "./restorableGremlinGraphs"; -export * from "./restorableGremlinResources"; -export * from "./restorableTables"; -export * from "./restorableTableResources"; -export * from "./service"; +export * from "./chaosFault.js"; +export * from "./databaseAccounts.js"; +export * from "./operations.js"; +export * from "./database.js"; +export * from "./collection.js"; +export * from "./collectionRegion.js"; +export * from "./databaseAccountRegion.js"; +export * from "./percentileSourceTarget.js"; +export * from "./percentileTarget.js"; +export * from "./percentile.js"; +export * from "./collectionPartitionRegion.js"; +export * from "./collectionPartition.js"; +export * from "./partitionKeyRangeId.js"; +export * from "./partitionKeyRangeIdRegion.js"; +export * from "./graphResources.js"; +export * from "./sqlResources.js"; +export * from "./mongoDBResources.js"; +export * from "./tableResources.js"; +export * from "./cassandraResources.js"; +export * from "./gremlinResources.js"; +export * from "./locations.js"; +export * from "./dataTransferJobs.js"; +export * from "./cassandraClusters.js"; +export * from "./cassandraDataCenters.js"; +export * from "./networkSecurityPerimeterConfigurations.js"; +export * from "./notebookWorkspaces.js"; +export * from "./privateEndpointConnections.js"; +export * from "./privateLinkResources.js"; +export * from "./restorableDatabaseAccounts.js"; +export * from "./restorableSqlDatabases.js"; +export * from "./restorableSqlContainers.js"; +export * from "./restorableSqlResources.js"; +export * from "./restorableMongodbDatabases.js"; +export * from "./restorableMongodbCollections.js"; +export * from "./restorableMongodbResources.js"; +export * from "./restorableGremlinDatabases.js"; +export * from "./restorableGremlinGraphs.js"; +export * from "./restorableGremlinResources.js"; +export * from "./restorableTables.js"; +export * from "./restorableTableResources.js"; +export * from "./service.js"; +export * from "./throughputPools.js"; +export * from "./throughputPool.js"; +export * from "./throughputPoolAccounts.js"; +export * from "./throughputPoolAccount.js"; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/locations.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/locations.ts index 7c3ccc19615e..b4b9b466be6d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/locations.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/locations.ts @@ -12,7 +12,7 @@ import { LocationsListOptionalParams, LocationsGetOptionalParams, LocationsGetResponse, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a Locations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/mongoDBResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/mongoDBResources.ts index 4c31b6974452..292286281111 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/mongoDBResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/mongoDBResources.ts @@ -33,6 +33,16 @@ import { MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleResponse, MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptionalParams, MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputResponse, + RetrieveThroughputParameters, + MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionOptionalParams, + MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionResponse, + RedistributeThroughputParameters, + MongoDBResourcesMongoDBDatabaseRedistributeThroughputOptionalParams, + MongoDBResourcesMongoDBDatabaseRedistributeThroughputResponse, + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams, + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse, + MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams, + MongoDBResourcesMongoDBContainerRedistributeThroughputResponse, MongoDBResourcesGetMongoDBCollectionOptionalParams, MongoDBResourcesGetMongoDBCollectionResponse, MongoDBCollectionCreateUpdateParameters, @@ -40,6 +50,11 @@ import { MongoDBResourcesCreateUpdateMongoDBCollectionResponse, MongoDBResourcesDeleteMongoDBCollectionOptionalParams, MongoDBResourcesDeleteMongoDBCollectionResponse, + MergeParameters, + MongoDBResourcesMongoDBDatabasePartitionMergeOptionalParams, + MongoDBResourcesMongoDBDatabasePartitionMergeResponse, + MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams, + MongoDBResourcesListMongoDBCollectionPartitionMergeResponse, MongoDBResourcesGetMongoDBCollectionThroughputOptionalParams, MongoDBResourcesGetMongoDBCollectionThroughputResponse, MongoDBResourcesUpdateMongoDBCollectionThroughputOptionalParams, @@ -63,7 +78,7 @@ import { ContinuousBackupRestoreLocation, MongoDBResourcesRetrieveContinuousBackupInformationOptionalParams, MongoDBResourcesRetrieveContinuousBackupInformationResponse, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a MongoDBResources. */ @@ -309,6 +324,162 @@ export interface MongoDBResources { databaseName: string, options?: MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptionalParams, ): Promise; + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database + * @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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current MongoDB database. + * @param options The options parameters. + */ + beginMongoDBDatabaseRetrieveThroughputDistribution( + resourceGroupName: string, + accountName: string, + databaseName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionResponse + > + >; + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB database + * @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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current MongoDB database. + * @param options The options parameters. + */ + beginMongoDBDatabaseRetrieveThroughputDistributionAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: MongoDBResourcesMongoDBDatabaseRetrieveThroughputDistributionOptionalParams, + ): Promise; + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database + * @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 redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current MongoDB database. + * @param options The options parameters. + */ + beginMongoDBDatabaseRedistributeThroughput( + resourceGroupName: string, + accountName: string, + databaseName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: MongoDBResourcesMongoDBDatabaseRedistributeThroughputOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + MongoDBResourcesMongoDBDatabaseRedistributeThroughputResponse + > + >; + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB database + * @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 redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current MongoDB database. + * @param options The options parameters. + */ + beginMongoDBDatabaseRedistributeThroughputAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: MongoDBResourcesMongoDBDatabaseRedistributeThroughputOptionalParams, + ): 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< + SimplePollerLike< + OperationState, + 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; + /** + * 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< + SimplePollerLike< + OperationState, + 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. @@ -400,6 +571,80 @@ export interface MongoDBResources { collectionName: string, options?: MongoDBResourcesDeleteMongoDBCollectionOptionalParams, ): Promise; + /** + * Merges the partitions of a MongoDB database + * @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 mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + beginMongoDBDatabasePartitionMerge( + resourceGroupName: string, + accountName: string, + databaseName: string, + mergeParameters: MergeParameters, + options?: MongoDBResourcesMongoDBDatabasePartitionMergeOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + MongoDBResourcesMongoDBDatabasePartitionMergeResponse + > + >; + /** + * Merges the partitions of a MongoDB database + * @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 mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + beginMongoDBDatabasePartitionMergeAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + mergeParameters: MergeParameters, + options?: MongoDBResourcesMongoDBDatabasePartitionMergeOptionalParams, + ): 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< + SimplePollerLike< + OperationState, + 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/networkSecurityPerimeterConfigurations.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/networkSecurityPerimeterConfigurations.ts new file mode 100644 index 000000000000..fb7222345482 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/networkSecurityPerimeterConfigurations.ts @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationsListOptionalParams, + NetworkSecurityPerimeterConfigurationsGetOptionalParams, + NetworkSecurityPerimeterConfigurationsGetResponse, + NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + NetworkSecurityPerimeterConfigurationsReconcileResponse, +} from "../models/index.js"; + +/// +/** Interface representing a NetworkSecurityPerimeterConfigurations. */ +export interface NetworkSecurityPerimeterConfigurations { + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db account + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterConfigurationsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Gets effective Network Security Perimeter Configuration for association + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter + * configuration + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsGetOptionalParams, + ): Promise; + /** + * Refreshes any information about the association. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter + * configuration + * @param options The options parameters. + */ + beginReconcile( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + NetworkSecurityPerimeterConfigurationsReconcileResponse + > + >; + /** + * Refreshes any information about the association. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter + * configuration + * @param options The options parameters. + */ + beginReconcileAndWait( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterConfigurationsReconcileOptionalParams, + ): Promise; +} diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/notebookWorkspaces.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/notebookWorkspaces.ts index ae886fb25b3f..9320dd34074d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/notebookWorkspaces.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/notebookWorkspaces.ts @@ -22,7 +22,7 @@ import { NotebookWorkspacesListConnectionInfoResponse, NotebookWorkspacesRegenerateAuthTokenOptionalParams, NotebookWorkspacesStartOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a NotebookWorkspaces. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/operations.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/operations.ts index c4dd742bf954..598d80324483 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/operations.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/operations.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { Operation, OperationsListOptionalParams } from "../models"; +import { Operation, OperationsListOptionalParams } from "../models/index.js"; /// /** Interface representing a Operations. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/partitionKeyRangeId.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/partitionKeyRangeId.ts index 15162462d1b4..97bf1c3b380a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/partitionKeyRangeId.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/partitionKeyRangeId.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { PartitionMetric, PartitionKeyRangeIdListMetricsOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a PartitionKeyRangeId. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/partitionKeyRangeIdRegion.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/partitionKeyRangeIdRegion.ts index a0087fc7a71f..8e8f76e1fe05 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/partitionKeyRangeIdRegion.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/partitionKeyRangeIdRegion.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { PartitionMetric, PartitionKeyRangeIdRegionListMetricsOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a PartitionKeyRangeIdRegion. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentile.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentile.ts index 31a07df9951e..5944c27c113d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentile.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentile.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { PercentileMetric, PercentileListMetricsOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a Percentile. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentileSourceTarget.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentileSourceTarget.ts index 8af6fcf22a55..731d4d980d90 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentileSourceTarget.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentileSourceTarget.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { PercentileMetric, PercentileSourceTargetListMetricsOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a PercentileSourceTarget. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentileTarget.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentileTarget.ts index 393868aba642..61390716e298 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentileTarget.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/percentileTarget.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { PercentileMetric, PercentileTargetListMetricsOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a PercentileTarget. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/privateEndpointConnections.ts index 4e1715ece2ad..c5dfe0719bb6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/privateEndpointConnections.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/privateEndpointConnections.ts @@ -16,7 +16,7 @@ import { PrivateEndpointConnectionsCreateOrUpdateOptionalParams, PrivateEndpointConnectionsCreateOrUpdateResponse, PrivateEndpointConnectionsDeleteOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a PrivateEndpointConnections. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/privateLinkResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/privateLinkResources.ts index 232ba7cdca0f..1f916ffa5196 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/privateLinkResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/privateLinkResources.ts @@ -12,7 +12,7 @@ import { PrivateLinkResourcesListByDatabaseAccountOptionalParams, PrivateLinkResourcesGetOptionalParams, PrivateLinkResourcesGetResponse, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a PrivateLinkResources. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableDatabaseAccounts.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableDatabaseAccounts.ts index 8b96fe9a2703..2c67fabc6b3b 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableDatabaseAccounts.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableDatabaseAccounts.ts @@ -13,7 +13,7 @@ import { RestorableDatabaseAccountsListOptionalParams, RestorableDatabaseAccountsGetByLocationOptionalParams, RestorableDatabaseAccountsGetByLocationResponse, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableDatabaseAccounts. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinDatabases.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinDatabases.ts index a12218e78ad3..ac529a06a288 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinDatabases.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinDatabases.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RestorableGremlinDatabaseGetResult, RestorableGremlinDatabasesListOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableGremlinDatabases. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinGraphs.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinGraphs.ts index 7498e2850609..2b58879cc322 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinGraphs.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinGraphs.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RestorableGremlinGraphGetResult, RestorableGremlinGraphsListOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableGremlinGraphs. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinResources.ts index ec9031d6d7e8..5e951d172982 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinResources.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RestorableGremlinResourcesGetResult, RestorableGremlinResourcesListOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableGremlinResources. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbCollections.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbCollections.ts index 188f8c8f8508..4f92693267ed 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbCollections.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbCollections.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RestorableMongodbCollectionGetResult, RestorableMongodbCollectionsListOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableMongodbCollections. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbDatabases.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbDatabases.ts index f066af4e6ad0..1d76dd032716 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbDatabases.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbDatabases.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RestorableMongodbDatabaseGetResult, RestorableMongodbDatabasesListOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableMongodbDatabases. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbResources.ts index 1b9ecab9db4c..6d00a7cab0b3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbResources.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RestorableMongodbResourcesGetResult, RestorableMongodbResourcesListOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableMongodbResources. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlContainers.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlContainers.ts index 7608e770c85a..6b10b870c071 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlContainers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlContainers.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RestorableSqlContainerGetResult, RestorableSqlContainersListOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableSqlContainers. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlDatabases.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlDatabases.ts index 6ab3c433d61c..35ae6733a6c5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlDatabases.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlDatabases.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RestorableSqlDatabaseGetResult, RestorableSqlDatabasesListOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableSqlDatabases. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlResources.ts index e147f4ecab9f..0dac18eb174a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlResources.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RestorableSqlResourcesGetResult, RestorableSqlResourcesListOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableSqlResources. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTableResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTableResources.ts index f82dd0498677..57f7168c25da 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTableResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTableResources.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RestorableTableResourcesGetResult, RestorableTableResourcesListOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableTableResources. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTables.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTables.ts index 124a063682c5..8e22bf641efa 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTables.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTables.ts @@ -10,7 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { RestorableTableGetResult, RestorableTablesListOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a RestorableTables. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/service.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/service.ts index 4827aae7ff76..fc16ab1569fd 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/service.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/service.ts @@ -17,7 +17,7 @@ import { ServiceGetOptionalParams, ServiceGetResponse, ServiceDeleteOptionalParams, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a Service. */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/sqlResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/sqlResources.ts index e2a536558478..9519671bdd23 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/sqlResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/sqlResources.ts @@ -11,10 +11,10 @@ import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { SqlDatabaseGetResults, SqlResourcesListSqlDatabasesOptionalParams, - SqlContainerGetResults, - SqlResourcesListSqlContainersOptionalParams, ClientEncryptionKeyGetResults, SqlResourcesListClientEncryptionKeysOptionalParams, + SqlContainerGetResults, + SqlResourcesListSqlContainersOptionalParams, SqlStoredProcedureGetResults, SqlResourcesListSqlStoredProceduresOptionalParams, SqlUserDefinedFunctionGetResults, @@ -41,6 +41,11 @@ import { SqlResourcesMigrateSqlDatabaseToAutoscaleResponse, SqlResourcesMigrateSqlDatabaseToManualThroughputOptionalParams, SqlResourcesMigrateSqlDatabaseToManualThroughputResponse, + SqlResourcesGetClientEncryptionKeyOptionalParams, + SqlResourcesGetClientEncryptionKeyResponse, + ClientEncryptionKeyCreateUpdateParameters, + SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, + SqlResourcesCreateUpdateClientEncryptionKeyResponse, SqlResourcesGetSqlContainerOptionalParams, SqlResourcesGetSqlContainerResponse, SqlContainerCreateUpdateParameters, @@ -48,6 +53,11 @@ import { SqlResourcesCreateUpdateSqlContainerResponse, SqlResourcesDeleteSqlContainerOptionalParams, SqlResourcesDeleteSqlContainerResponse, + MergeParameters, + SqlResourcesSqlDatabasePartitionMergeOptionalParams, + SqlResourcesSqlDatabasePartitionMergeResponse, + SqlResourcesListSqlContainerPartitionMergeOptionalParams, + SqlResourcesListSqlContainerPartitionMergeResponse, SqlResourcesGetSqlContainerThroughputOptionalParams, SqlResourcesGetSqlContainerThroughputResponse, SqlResourcesUpdateSqlContainerThroughputOptionalParams, @@ -56,11 +66,16 @@ import { SqlResourcesMigrateSqlContainerToAutoscaleResponse, SqlResourcesMigrateSqlContainerToManualThroughputOptionalParams, SqlResourcesMigrateSqlContainerToManualThroughputResponse, - SqlResourcesGetClientEncryptionKeyOptionalParams, - SqlResourcesGetClientEncryptionKeyResponse, - ClientEncryptionKeyCreateUpdateParameters, - SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, - SqlResourcesCreateUpdateClientEncryptionKeyResponse, + RetrieveThroughputParameters, + SqlResourcesSqlDatabaseRetrieveThroughputDistributionOptionalParams, + SqlResourcesSqlDatabaseRetrieveThroughputDistributionResponse, + RedistributeThroughputParameters, + SqlResourcesSqlDatabaseRedistributeThroughputOptionalParams, + SqlResourcesSqlDatabaseRedistributeThroughputResponse, + SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams, + SqlResourcesSqlContainerRetrieveThroughputDistributionResponse, + SqlResourcesSqlContainerRedistributeThroughputOptionalParams, + SqlResourcesSqlContainerRedistributeThroughputResponse, SqlResourcesGetSqlStoredProcedureOptionalParams, SqlResourcesGetSqlStoredProcedureResponse, SqlStoredProcedureCreateUpdateParameters, @@ -97,7 +112,7 @@ import { ContinuousBackupRestoreLocation, SqlResourcesRetrieveContinuousBackupInformationOptionalParams, SqlResourcesRetrieveContinuousBackupInformationResponse, -} from "../models"; +} from "../models/index.js"; /// /** Interface representing a SqlResources. */ @@ -114,31 +129,31 @@ export interface SqlResources { options?: SqlResourcesListSqlDatabasesOptionalParams, ): PagedAsyncIterableIterator; /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. * @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 options The options parameters. */ - listSqlContainers( + listClientEncryptionKeys( resourceGroupName: string, accountName: string, databaseName: string, - options?: SqlResourcesListSqlContainersOptionalParams, - ): PagedAsyncIterableIterator; + options?: SqlResourcesListClientEncryptionKeysOptionalParams, + ): PagedAsyncIterableIterator; /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * Lists the SQL container under an existing Azure Cosmos DB database account. * @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 options The options parameters. */ - listClientEncryptionKeys( + listSqlContainers( resourceGroupName: string, accountName: string, databaseName: string, - options?: SqlResourcesListClientEncryptionKeysOptionalParams, - ): PagedAsyncIterableIterator; + options?: SqlResourcesListSqlContainersOptionalParams, + ): PagedAsyncIterableIterator; /** * 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. @@ -398,6 +413,64 @@ export interface SqlResources { databaseName: string, options?: SqlResourcesMigrateSqlDatabaseToManualThroughputOptionalParams, ): Promise; + /** + * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param options The options parameters. + */ + getClientEncryptionKey( + resourceGroupName: string, + accountName: string, + databaseName: string, + clientEncryptionKeyName: string, + options?: SqlResourcesGetClientEncryptionKeyOptionalParams, + ): Promise; + /** + * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure + * Powershell (instead of directly). + * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption + * key. + * @param options The options parameters. + */ + beginCreateUpdateClientEncryptionKey( + resourceGroupName: string, + accountName: string, + databaseName: string, + clientEncryptionKeyName: string, + createUpdateClientEncryptionKeyParameters: ClientEncryptionKeyCreateUpdateParameters, + options?: SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SqlResourcesCreateUpdateClientEncryptionKeyResponse + > + >; + /** + * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure + * Powershell (instead of directly). + * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption + * key. + * @param options The options parameters. + */ + beginCreateUpdateClientEncryptionKeyAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + clientEncryptionKeyName: string, + createUpdateClientEncryptionKeyParameters: ClientEncryptionKeyCreateUpdateParameters, + options?: SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, + ): Promise; /** * Gets the SQL container under an existing Azure Cosmos DB database account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -487,6 +560,80 @@ export interface SqlResources { containerName: string, options?: SqlResourcesDeleteSqlContainerOptionalParams, ): Promise; + /** + * Merges the partitions of a SQL database + * @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 mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + beginSqlDatabasePartitionMerge( + resourceGroupName: string, + accountName: string, + databaseName: string, + mergeParameters: MergeParameters, + options?: SqlResourcesSqlDatabasePartitionMergeOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SqlResourcesSqlDatabasePartitionMergeResponse + > + >; + /** + * Merges the partitions of a SQL database + * @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 mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + beginSqlDatabasePartitionMergeAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + mergeParameters: MergeParameters, + options?: SqlResourcesSqlDatabasePartitionMergeOptionalParams, + ): 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< + SimplePollerLike< + OperationState, + 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. @@ -614,63 +761,161 @@ export interface SqlResources { options?: SqlResourcesMigrateSqlContainerToManualThroughputOptionalParams, ): Promise; /** - * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for an Azure Cosmos DB SQL database * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current SQL database. * @param options The options parameters. */ - getClientEncryptionKey( + beginSqlDatabaseRetrieveThroughputDistribution( resourceGroupName: string, accountName: string, databaseName: string, - clientEncryptionKeyName: string, - options?: SqlResourcesGetClientEncryptionKeyOptionalParams, - ): Promise; + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: SqlResourcesSqlDatabaseRetrieveThroughputDistributionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + SqlResourcesSqlDatabaseRetrieveThroughputDistributionResponse + > + >; /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure - * Powershell (instead of directly). + * Retrieve throughput distribution for an Azure Cosmos DB SQL database * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption - * key. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current SQL database. * @param options The options parameters. */ - beginCreateUpdateClientEncryptionKey( + beginSqlDatabaseRetrieveThroughputDistributionAndWait( resourceGroupName: string, accountName: string, databaseName: string, - clientEncryptionKeyName: string, - createUpdateClientEncryptionKeyParameters: ClientEncryptionKeyCreateUpdateParameters, - options?: SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: SqlResourcesSqlDatabaseRetrieveThroughputDistributionOptionalParams, + ): Promise; + /** + * Redistribute throughput for an Azure Cosmos DB SQL database + * @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 redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current SQL database. + * @param options The options parameters. + */ + beginSqlDatabaseRedistributeThroughput( + resourceGroupName: string, + accountName: string, + databaseName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: SqlResourcesSqlDatabaseRedistributeThroughputOptionalParams, ): Promise< SimplePollerLike< - OperationState, - SqlResourcesCreateUpdateClientEncryptionKeyResponse + OperationState, + SqlResourcesSqlDatabaseRedistributeThroughputResponse > >; /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure - * Powershell (instead of directly). + * Redistribute throughput for an Azure Cosmos DB SQL database * @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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption - * key. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current SQL database. * @param options The options parameters. */ - beginCreateUpdateClientEncryptionKeyAndWait( + beginSqlDatabaseRedistributeThroughputAndWait( resourceGroupName: string, accountName: string, databaseName: string, - clientEncryptionKeyName: string, - createUpdateClientEncryptionKeyParameters: ClientEncryptionKeyCreateUpdateParameters, - options?: SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams, - ): Promise; + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: SqlResourcesSqlDatabaseRedistributeThroughputOptionalParams, + ): 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< + SimplePollerLike< + OperationState, + 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< + SimplePollerLike< + OperationState, + 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/src/operationsInterfaces/tableResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/tableResources.ts index 4359d0166d6b..1a4816213001 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/tableResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/tableResources.ts @@ -11,6 +11,10 @@ import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { TableGetResults, TableResourcesListTablesOptionalParams, + TableRoleDefinitionResource, + TableResourcesListTableRoleDefinitionsOptionalParams, + TableRoleAssignmentResource, + TableResourcesListTableRoleAssignmentsOptionalParams, TableResourcesGetTableOptionalParams, TableResourcesGetTableResponse, TableCreateUpdateParameters, @@ -30,7 +34,17 @@ import { ContinuousBackupRestoreLocation, TableResourcesRetrieveContinuousBackupInformationOptionalParams, TableResourcesRetrieveContinuousBackupInformationResponse, -} from "../models"; + TableResourcesGetTableRoleDefinitionOptionalParams, + TableResourcesGetTableRoleDefinitionResponse, + TableResourcesCreateUpdateTableRoleDefinitionOptionalParams, + TableResourcesCreateUpdateTableRoleDefinitionResponse, + TableResourcesDeleteTableRoleDefinitionOptionalParams, + TableResourcesGetTableRoleAssignmentOptionalParams, + TableResourcesGetTableRoleAssignmentResponse, + TableResourcesCreateUpdateTableRoleAssignmentOptionalParams, + TableResourcesCreateUpdateTableRoleAssignmentResponse, + TableResourcesDeleteTableRoleAssignmentOptionalParams, +} from "../models/index.js"; /// /** Interface representing a TableResources. */ @@ -46,6 +60,28 @@ export interface TableResources { accountName: string, options?: TableResourcesListTablesOptionalParams, ): PagedAsyncIterableIterator; + /** + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + listTableRoleDefinitions( + resourceGroupName: string, + accountName: string, + options?: TableResourcesListTableRoleDefinitionsOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param options The options parameters. + */ + listTableRoleAssignments( + resourceGroupName: string, + accountName: string, + options?: TableResourcesListTableRoleAssignmentsOptionalParams, + ): PagedAsyncIterableIterator; /** * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -273,4 +309,156 @@ export interface TableResources { location: ContinuousBackupRestoreLocation, options?: TableResourcesRetrieveContinuousBackupInformationOptionalParams, ): Promise; + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param options The options parameters. + */ + getTableRoleDefinition( + resourceGroupName: string, + accountName: string, + roleDefinitionId: string, + options?: TableResourcesGetTableRoleDefinitionOptionalParams, + ): Promise; + /** + * Creates or updates an Azure Cosmos DB Table Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @param options The options parameters. + */ + beginCreateUpdateTableRoleDefinition( + resourceGroupName: string, + accountName: string, + roleDefinitionId: string, + createUpdateTableRoleDefinitionParameters: TableRoleDefinitionResource, + options?: TableResourcesCreateUpdateTableRoleDefinitionOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TableResourcesCreateUpdateTableRoleDefinitionResponse + > + >; + /** + * Creates or updates an Azure Cosmos DB Table Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @param options The options parameters. + */ + beginCreateUpdateTableRoleDefinitionAndWait( + resourceGroupName: string, + accountName: string, + roleDefinitionId: string, + createUpdateTableRoleDefinitionParameters: TableRoleDefinitionResource, + options?: TableResourcesCreateUpdateTableRoleDefinitionOptionalParams, + ): Promise; + /** + * Deletes an existing Azure Cosmos DB Table Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param options The options parameters. + */ + beginDeleteTableRoleDefinition( + resourceGroupName: string, + accountName: string, + roleDefinitionId: string, + options?: TableResourcesDeleteTableRoleDefinitionOptionalParams, + ): Promise, void>>; + /** + * Deletes an existing Azure Cosmos DB Table Role Definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param options The options parameters. + */ + beginDeleteTableRoleDefinitionAndWait( + resourceGroupName: string, + accountName: string, + roleDefinitionId: string, + options?: TableResourcesDeleteTableRoleDefinitionOptionalParams, + ): Promise; + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param options The options parameters. + */ + getTableRoleAssignment( + resourceGroupName: string, + accountName: string, + roleAssignmentId: string, + options?: TableResourcesGetTableRoleAssignmentOptionalParams, + ): Promise; + /** + * Creates or updates an Azure Cosmos DB Table Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @param options The options parameters. + */ + beginCreateUpdateTableRoleAssignment( + resourceGroupName: string, + accountName: string, + roleAssignmentId: string, + createUpdateTableRoleAssignmentParameters: TableRoleAssignmentResource, + options?: TableResourcesCreateUpdateTableRoleAssignmentOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + TableResourcesCreateUpdateTableRoleAssignmentResponse + > + >; + /** + * Creates or updates an Azure Cosmos DB Table Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @param options The options parameters. + */ + beginCreateUpdateTableRoleAssignmentAndWait( + resourceGroupName: string, + accountName: string, + roleAssignmentId: string, + createUpdateTableRoleAssignmentParameters: TableRoleAssignmentResource, + options?: TableResourcesCreateUpdateTableRoleAssignmentOptionalParams, + ): Promise; + /** + * Deletes an existing Azure Cosmos DB Table Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param options The options parameters. + */ + beginDeleteTableRoleAssignment( + resourceGroupName: string, + accountName: string, + roleAssignmentId: string, + options?: TableResourcesDeleteTableRoleAssignmentOptionalParams, + ): Promise, void>>; + /** + * Deletes an existing Azure Cosmos DB Table Role Assignment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param options The options parameters. + */ + beginDeleteTableRoleAssignmentAndWait( + resourceGroupName: string, + accountName: string, + roleAssignmentId: string, + options?: TableResourcesDeleteTableRoleAssignmentOptionalParams, + ): Promise; } diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPool.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPool.ts new file mode 100644 index 000000000000..6818eed29064 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPool.ts @@ -0,0 +1,122 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + ThroughputPoolGetOptionalParams, + ThroughputPoolGetResponse, + ThroughputPoolResource, + ThroughputPoolCreateOrUpdateOptionalParams, + ThroughputPoolCreateOrUpdateResponse, + ThroughputPoolUpdateOptionalParams, + ThroughputPoolUpdateResponse, + ThroughputPoolDeleteOptionalParams, + ThroughputPoolDeleteResponse, +} from "../models/index.js"; + +/** Interface representing a ThroughputPool. */ +export interface ThroughputPool { + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolGetOptionalParams, + ): Promise; + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when + * performing updates on an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + throughputPoolName: string, + body: ThroughputPoolResource, + options?: ThroughputPoolCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ThroughputPoolCreateOrUpdateResponse + > + >; + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when + * performing updates on an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + throughputPoolName: string, + body: ThroughputPoolResource, + options?: ThroughputPoolCreateOrUpdateOptionalParams, + ): Promise; + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ThroughputPoolUpdateResponse + > + >; + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolUpdateOptionalParams, + ): Promise; + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ThroughputPoolDeleteResponse + > + >; + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPoolAccount.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPoolAccount.ts new file mode 100644 index 000000000000..1a1b94f0eb90 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPoolAccount.ts @@ -0,0 +1,103 @@ +/* + * 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + ThroughputPoolAccountGetOptionalParams, + ThroughputPoolAccountGetResponse, + ThroughputPoolAccountResource, + ThroughputPoolAccountCreateOptionalParams, + ThroughputPoolAccountCreateResponse, + ThroughputPoolAccountDeleteOptionalParams, + ThroughputPoolAccountDeleteResponse, +} from "../models/index.js"; + +/** Interface representing a ThroughputPoolAccount. */ +export interface ThroughputPoolAccount { + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool + * @param options The options parameters. + */ + get( + resourceGroupName: string, + throughputPoolName: string, + throughputPoolAccountName: string, + options?: ThroughputPoolAccountGetOptionalParams, + ): Promise; + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when + * performing updates on an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + throughputPoolName: string, + throughputPoolAccountName: string, + body: ThroughputPoolAccountResource, + options?: ThroughputPoolAccountCreateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ThroughputPoolAccountCreateResponse + > + >; + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when + * performing updates on an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + throughputPoolName: string, + throughputPoolAccountName: string, + body: ThroughputPoolAccountResource, + options?: ThroughputPoolAccountCreateOptionalParams, + ): Promise; + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + throughputPoolName: string, + throughputPoolAccountName: string, + options?: ThroughputPoolAccountDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + ThroughputPoolAccountDeleteResponse + > + >; + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + throughputPoolName: string, + throughputPoolAccountName: string, + options?: ThroughputPoolAccountDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPoolAccounts.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPoolAccounts.ts new file mode 100644 index 000000000000..7cf0a0cdf1a2 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPoolAccounts.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ThroughputPoolAccountResource, + ThroughputPoolAccountsListOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a ThroughputPoolAccounts. */ +export interface ThroughputPoolAccounts { + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + throughputPoolName: string, + options?: ThroughputPoolAccountsListOptionalParams, + ): PagedAsyncIterableIterator; +} diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPools.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPools.ts new file mode 100644 index 000000000000..2ce03d70a1f8 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/throughputPools.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ThroughputPoolResource, + ThroughputPoolsListOptionalParams, + ThroughputPoolsListByResourceGroupOptionalParams, +} from "../models/index.js"; + +/// +/** Interface representing a ThroughputPools. */ +export interface ThroughputPools { + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * @param options The options parameters. + */ + list( + options?: ThroughputPoolsListOptionalParams, + ): PagedAsyncIterableIterator; + /** + * List all the ThroughputPools in a given resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ThroughputPoolsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; +} diff --git a/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_cassandra_examples.ts b/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_cassandra_examples.spec.ts similarity index 87% rename from sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_cassandra_examples.ts rename to sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_cassandra_examples.spec.ts index 9e5f1f4ffb93..4c59c9b0dcdc 100644 --- a/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_cassandra_examples.ts +++ b/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_cassandra_examples.spec.ts @@ -10,15 +10,11 @@ import { env, Recorder, RecorderStartOptions, - delay, isPlaybackMode, } from "@azure-tools/test-recorder"; import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { CosmosDBManagementClient } from "../src/cosmosDBManagementClient"; - - +import { CosmosDBManagementClient } from "../src/cosmosDBManagementClient.js"; +import { afterEach, assert, beforeEach, describe, it } from "vitest"; const replaceableVariables: Record = { SUBSCRIPTION_ID: "88888888-8888-8888-8888-888888888888" @@ -36,7 +32,7 @@ export const testPollingOptions = { updateIntervalInMs: isPlaybackMode() ? 0 : undefined, }; -describe.only("Cosmosdb test", () => { +describe("Cosmosdb test", () => { let recorder: Recorder; let client: CosmosDBManagementClient; let subscriptionId: string; @@ -45,8 +41,8 @@ describe.only("Cosmosdb test", () => { let accountName: string; let keyspaceName: string; - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); + beforeEach(async function (ctx) { + recorder = new Recorder(ctx); await recorder.start(recorderOptions); subscriptionId = env.SUBSCRIPTION_ID || ''; // This is an example of how the environment variables are used @@ -58,11 +54,11 @@ describe.only("Cosmosdb test", () => { keyspaceName = "mykeyspacexxx"; }); - afterEach(async function () { + afterEach(async () => { await recorder.stop(); }); - it("databaseAccounts create for cassandraResources test", async function () { + it("databaseAccounts create for cassandraResources test", async () => { const res = await client.databaseAccounts.beginCreateOrUpdateAndWait(resourceGroupName, accountName, { kind: "GlobalDocumentDB", databaseAccountOfferType: "Standard", @@ -85,7 +81,7 @@ describe.only("Cosmosdb test", () => { assert.equal(res.name, accountName); }); - it("cassandraResources create test", async function () { + it("cassandraResources create test", async () => { const res = await client.cassandraResources.beginCreateUpdateCassandraKeyspaceAndWait(resourceGroupName, accountName, keyspaceName, { location: location, resource: { @@ -98,7 +94,7 @@ describe.only("Cosmosdb test", () => { assert.equal(res.type, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces"); }); - it("cassandraResources update test", async function () { + it("cassandraResources update test", async () => { const res = await client.cassandraResources.beginUpdateCassandraKeyspaceThroughputAndWait(resourceGroupName, accountName, keyspaceName, { location: location, resource: { @@ -108,12 +104,12 @@ describe.only("Cosmosdb test", () => { assert.equal(res.resource?.throughput, 400); }); - it("cassandraResources get test", async function () { + it("cassandraResources get test", async () => { const res = await client.cassandraResources.getCassandraKeyspace(resourceGroupName, accountName, keyspaceName); assert.equal(res.type, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces"); }); - it("cassandraResources list test", async function () { + it("cassandraResources list test", async () => { const resArray = new Array(); for await (let item of client.cassandraResources.listCassandraKeyspaces(resourceGroupName, accountName)) { resArray.push(item); @@ -121,12 +117,12 @@ describe.only("Cosmosdb test", () => { assert.equal(resArray.length, 1); }); - it("cassandraResources MigrateCassandra test", async function () { + it("cassandraResources MigrateCassandra test", async () => { const res = await client.cassandraResources.beginMigrateCassandraKeyspaceToAutoscaleAndWait(resourceGroupName, accountName, keyspaceName, testPollingOptions); assert.equal(res.type, "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces/throughputSettings/migrateToAutoscale") }); - it("cassandraResources delete test", async function () { + it("cassandraResources delete test", async () => { await client.cassandraResources.beginDeleteCassandraKeyspaceAndWait(resourceGroupName, accountName, keyspaceName, testPollingOptions); const resArray = new Array(); for await (let item of client.cassandraResources.listCassandraKeyspaces(resourceGroupName, accountName)) { @@ -135,7 +131,7 @@ describe.only("Cosmosdb test", () => { assert.equal(resArray.length, 0); }); - it("databaseAccount delete for cassandraResources test", async function () { + it("databaseAccount delete for cassandraResources test", async () => { await client.databaseAccounts.beginDeleteAndWait( resourceGroupName, accountName, diff --git a/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_examples.ts b/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_examples.spec.ts similarity index 86% rename from sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_examples.ts rename to sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_examples.spec.ts index 5e9dc490d284..a7d4ca829ef8 100644 --- a/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_examples.ts +++ b/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_examples.spec.ts @@ -10,15 +10,11 @@ import { env, Recorder, RecorderStartOptions, - delay, isPlaybackMode, } from "@azure-tools/test-recorder"; import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { CosmosDBManagementClient } from "../src/cosmosDBManagementClient"; - - +import { CosmosDBManagementClient } from "../src/cosmosDBManagementClient.js"; +import { afterEach, assert, beforeEach, describe, it } from "vitest"; const replaceableVariables: Record = { SUBSCRIPTION_ID: "88888888-8888-8888-8888-888888888888" @@ -45,8 +41,8 @@ describe("Cosmosdb test", () => { let resourceGroupName: string; let accountName: string; - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); + beforeEach(async function (ctx) { + recorder = new Recorder(ctx); await recorder.start(recorderOptions); subscriptionId = env.SUBSCRIPTION_ID || ''; // This is an example of how the environment variables are used @@ -57,11 +53,11 @@ describe("Cosmosdb test", () => { accountName = "myaccountxxyz2"; }); - afterEach(async function () { + afterEach(async () => { await recorder.stop(); }); - it("databaseAccounts create test", async function () { + it("databaseAccounts create test", async () => { const res = await client.databaseAccounts.beginCreateOrUpdateAndWait(resourceGroupName, accountName, { databaseAccountOfferType: "Standard", locations: [ @@ -85,12 +81,12 @@ describe("Cosmosdb test", () => { assert.equal(res.name, accountName); }); - it("databaseAccounts get test", async function () { + it("databaseAccounts get test", async () => { const res = await client.databaseAccounts.get(resourceGroupName, accountName); assert.equal(res.name, accountName); }); - it("databaseAccounts list test", async function () { + it("databaseAccounts list test", async () => { const resArray = new Array(); for await (let item of client.databaseAccounts.listByResourceGroup(resourceGroupName)) { resArray.push(item); @@ -98,12 +94,12 @@ describe("Cosmosdb test", () => { assert.equal(resArray.length, 1); }); - it("databaseAccounts delete test", async function () { + it("databaseAccounts delete test", { timeout: 3600000 }, async () => { await client.databaseAccounts.beginDeleteAndWait(resourceGroupName, accountName, testPollingOptions); const resArray = new Array(); for await (let item of client.databaseAccounts.listByResourceGroup(resourceGroupName)) { resArray.push(item); } assert.equal(resArray.length, 0); - }).timeout(3600000); + }); }); diff --git a/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_mongodb_examples.ts b/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_mongodb_examples.spec.ts similarity index 87% rename from sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_mongodb_examples.ts rename to sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_mongodb_examples.spec.ts index cb0063827c82..4578818d85d2 100644 --- a/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_mongodb_examples.ts +++ b/sdk/cosmosdb/arm-cosmosdb/test/cosmosdb_mongodb_examples.spec.ts @@ -10,15 +10,11 @@ import { env, Recorder, RecorderStartOptions, - delay, isPlaybackMode, } from "@azure-tools/test-recorder"; import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { CosmosDBManagementClient } from "../src/cosmosDBManagementClient"; - - +import { CosmosDBManagementClient } from "../src/cosmosDBManagementClient.js"; +import { afterEach, assert, beforeEach, describe, it } from "vitest"; const replaceableVariables: Record = { SUBSCRIPTION_ID: "88888888-8888-8888-8888-888888888888" @@ -44,8 +40,8 @@ describe("Cosmosdb test", () => { let accountName: string; let databaseName: string; - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); + beforeEach(async function (ctx) { + recorder = new Recorder(ctx); await recorder.start(recorderOptions); subscriptionId = env.SUBSCRIPTION_ID || ''; // This is an example of how the environment variables are used @@ -57,11 +53,11 @@ describe("Cosmosdb test", () => { databaseName = "mydatabasexxxx"; }); - afterEach(async function () { + afterEach(async () => { await recorder.stop(); }); - it("databaseAccounts create for mongoDBResources test", async function () { + it("databaseAccounts create for mongoDBResources test", async () => { const res = await client.databaseAccounts.beginCreateOrUpdateAndWait(resourceGroupName, accountName, { kind: "MongoDB", databaseAccountOfferType: "Standard", @@ -79,7 +75,7 @@ describe("Cosmosdb test", () => { assert.equal(res.name, accountName); }); - it("mongoDBResources create test", async function () { + it("mongoDBResources create test", async () => { const res = await client.mongoDBResources.beginCreateUpdateMongoDBDatabaseAndWait(resourceGroupName, accountName, databaseName, { location: location, resource: { @@ -92,7 +88,7 @@ describe("Cosmosdb test", () => { assert.equal(res.type, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases") }); - it("mongoDBResources update test", async function () { + it("mongoDBResources update test", async () => { const res = await client.mongoDBResources.beginUpdateMongoDBDatabaseThroughputAndWait(resourceGroupName, accountName, databaseName, { location: location, resource: { @@ -102,23 +98,23 @@ describe("Cosmosdb test", () => { assert.equal(res.resource?.throughput, 400); }); - it("mongoDBResources get test", async function () { + it("mongoDBResources get test", async () => { const res = await client.mongoDBResources.getMongoDBDatabase(resourceGroupName, accountName, databaseName); assert.equal(res.type, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases"); }); - it("mongoDBResources list test", async function () { + it("mongoDBResources list test", async () => { for await (let item of client.mongoDBResources.listMongoDBDatabases(resourceGroupName, accountName)) { assert.equal(item.type, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases"); } }); - it("mongoDBResources migrate test", async function () { + it("mongoDBResources migrate test", async () => { const res = await client.mongoDBResources.beginMigrateMongoDBDatabaseToAutoscaleAndWait(resourceGroupName, accountName, databaseName, testPollingOptions); assert.equal(res.type, "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/throughputSettings/migrateToAutoscale"); }); - it("mongoDBResources delete test", async function () { + it("mongoDBResources delete test", async () => { await client.mongoDBResources.beginDeleteMongoDBDatabaseAndWait(resourceGroupName, accountName, databaseName, testPollingOptions); const resArray = new Array(); for await (let item of client.mongoDBResources.listMongoDBDatabases(resourceGroupName, accountName)) { @@ -127,7 +123,7 @@ describe("Cosmosdb test", () => { assert.equal(resArray.length, 0); }); - it("databaseAccount delete for mongoDBResources test", async function () { + it("databaseAccount delete for mongoDBResources test", async () => { await client.databaseAccounts.beginDeleteAndWait( resourceGroupName, accountName, diff --git a/sdk/cosmosdb/arm-cosmosdb/tsconfig.browser.config.json b/sdk/cosmosdb/arm-cosmosdb/tsconfig.browser.config.json new file mode 100644 index 000000000000..b6586181d006 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/tsconfig.browser.config.json @@ -0,0 +1,17 @@ +{ + "extends": "./.tshy/build.json", + "include": [ + "./src/**/*.ts", + "./src/**/*.mts", + "./test/**/*.spec.ts", + "./test/**/*.mts" + ], + "exclude": [ + "./test/**/node/**/*.ts" + ], + "compilerOptions": { + "outDir": "./dist-test/browser", + "rootDir": ".", + "skipLibCheck": true + } +} diff --git a/sdk/cosmosdb/arm-cosmosdb/tsconfig.json b/sdk/cosmosdb/arm-cosmosdb/tsconfig.json index 4c414734673e..19ceb382b521 100644 --- a/sdk/cosmosdb/arm-cosmosdb/tsconfig.json +++ b/sdk/cosmosdb/arm-cosmosdb/tsconfig.json @@ -1,33 +1,13 @@ { - "compilerOptions": { - "module": "es6", - "moduleResolution": "node", - "strict": true, - "target": "es6", - "sourceMap": true, - "declarationMap": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "forceConsistentCasingInFileNames": true, - "lib": [ - "es6", - "dom" - ], - "declaration": true, - "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-cosmosdb": [ - "./src/index" - ] + "references": [ + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.samples.json" + }, + { + "path": "./tsconfig.test.json" } - }, - "include": [ - "src/**/*.ts", - "test/**/*.ts", - "samples-dev/**/*.ts" - ], - "exclude": [ - "node_modules" ] -} \ No newline at end of file +} diff --git a/sdk/cosmosdb/arm-cosmosdb/tsconfig.samples.json b/sdk/cosmosdb/arm-cosmosdb/tsconfig.samples.json new file mode 100644 index 000000000000..f1aa81d8336e --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/tsconfig.samples.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../tsconfig.samples.base.json", + "compilerOptions": { + "paths": { + "@azure/arm-cosmosdb": [ + "./dist/esm" + ] + } + } +} diff --git a/sdk/cosmosdb/arm-cosmosdb/tsconfig.src.json b/sdk/cosmosdb/arm-cosmosdb/tsconfig.src.json new file mode 100644 index 000000000000..bae70752dd38 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/tsconfig.src.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.lib.json" +} diff --git a/sdk/cosmosdb/arm-cosmosdb/tsconfig.test.json b/sdk/cosmosdb/arm-cosmosdb/tsconfig.test.json new file mode 100644 index 000000000000..3c2b783a8c1b --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/tsconfig.test.json @@ -0,0 +1,6 @@ +{ + "extends": [ + "./tsconfig.src.json", + "../../../tsconfig.test.base.json" + ] +} diff --git a/sdk/cosmosdb/arm-cosmosdb/vitest.browser.config.ts b/sdk/cosmosdb/arm-cosmosdb/vitest.browser.config.ts new file mode 100644 index 000000000000..b48c61b2ef46 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/vitest.browser.config.ts @@ -0,0 +1,17 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.browser.shared.config.ts"; + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + include: [ + "dist-test/browser/test/**/*.spec.js", + ], + }, + }), +); diff --git a/sdk/cosmosdb/arm-cosmosdb/vitest.config.ts b/sdk/cosmosdb/arm-cosmosdb/vitest.config.ts new file mode 100644 index 000000000000..2a4750c84292 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/vitest.config.ts @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { defineConfig, mergeConfig } from "vitest/config"; +import viteConfig from "../../../vitest.shared.config.ts"; + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + hookTimeout: 1200000, + testTimeout: 1200000, + }, + }), +); diff --git a/sdk/cosmosdb/arm-cosmosdb/vitest.esm.config.ts b/sdk/cosmosdb/arm-cosmosdb/vitest.esm.config.ts new file mode 100644 index 000000000000..a70127279fc9 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/vitest.esm.config.ts @@ -0,0 +1,12 @@ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig( + vitestConfig, + vitestEsmConfig +);