Walmart enable priority based execution feature (#1625)

* changed the variable enablePriorityBasedThrottling to enablePriorityBasedExecution

* Update the arm client version to '2023-09-15-preview' to fetch the status for the 'enablePriorityBasedExecution' property and performed the respective changes for priority based execution to grab the changes from the DatabaseAccount data model

* formatting changes to all the committed files

* review comments - removed the variable and added the check in the if loop itself

* check style changes

---------

Co-authored-by: Faiz Chachiya <faizchachiya@microsoft.com>
This commit is contained in:
FAIZ CHACHIYA 2023-09-25 22:41:46 +05:30 committed by GitHub
parent 5c7c0eae61
commit 7b568df150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 685 additions and 72 deletions

View File

@ -109,7 +109,7 @@ export function client(): Cosmos.CosmosClient {
(options as any).plugins = [{ on: "request", plugin: requestPlugin }]; (options as any).plugins = [{ on: "request", plugin: requestPlugin }];
} }
if (userContext.features.enablePriorityBasedThrottling && userContext.apiType === "SQL") { if (userContext.databaseAccount?.properties?.enablePriorityBasedExecution && userContext.apiType === "SQL") {
const plugins = (options as any).plugins || []; const plugins = (options as any).plugins || [];
plugins.push({ on: "request", plugin: PriorityBasedExecutionUtils.requestPlugin }); plugins.push({ on: "request", plugin: PriorityBasedExecutionUtils.requestPlugin });
(options as any).plugins = plugins; (options as any).plugins = plugins;

View File

@ -38,6 +38,7 @@ export interface DatabaseAccountExtendedProperties {
locations?: DatabaseAccountResponseLocation[]; locations?: DatabaseAccountResponseLocation[];
postgresqlEndpoint?: string; postgresqlEndpoint?: string;
publicNetworkAccess?: string; publicNetworkAccess?: string;
enablePriorityBasedExecution?: boolean;
vcoreMongoEndpoint?: string; vcoreMongoEndpoint?: string;
} }

View File

@ -52,7 +52,7 @@ export const SettingsPane: FunctionComponent = () => {
const shouldShowCrossPartitionOption = userContext.apiType !== "Gremlin"; const shouldShowCrossPartitionOption = userContext.apiType !== "Gremlin";
const shouldShowParallelismOption = userContext.apiType !== "Gremlin"; const shouldShowParallelismOption = userContext.apiType !== "Gremlin";
const shouldShowPriorityLevelOption = const shouldShowPriorityLevelOption =
userContext.features.enablePriorityBasedThrottling && userContext.apiType === "SQL"; userContext.databaseAccount?.properties?.enablePriorityBasedExecution && userContext.apiType === "SQL";
const handlerOnSubmit = (e: MouseEvent<HTMLButtonElement>) => { const handlerOnSubmit = (e: MouseEvent<HTMLButtonElement>) => {
setIsExecuting(true); setIsExecuting(true);

View File

@ -36,7 +36,6 @@ export type Features = {
readonly enableLegacyMongoShellV2Debug: boolean; readonly enableLegacyMongoShellV2Debug: boolean;
readonly loadLegacyMongoShellFromBE: boolean; readonly loadLegacyMongoShellFromBE: boolean;
readonly enableCopilot: boolean; readonly enableCopilot: boolean;
readonly enablePriorityBasedThrottling: boolean;
readonly copilotVersion?: string; readonly copilotVersion?: string;
readonly disableCopilotPhoenixGateaway: boolean; readonly disableCopilotPhoenixGateaway: boolean;
readonly enableCopilotFullSchema: boolean; readonly enableCopilotFullSchema: boolean;
@ -108,7 +107,6 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear
enableLegacyMongoShellV2: "true" === get("enablelegacymongoshellv2"), enableLegacyMongoShellV2: "true" === get("enablelegacymongoshellv2"),
enableLegacyMongoShellV2Debug: "true" === get("enablelegacymongoshellv2debug"), enableLegacyMongoShellV2Debug: "true" === get("enablelegacymongoshellv2debug"),
loadLegacyMongoShellFromBE: "true" === get("loadlegacymongoshellfrombe"), loadLegacyMongoShellFromBE: "true" === get("loadlegacymongoshellfrombe"),
enablePriorityBasedThrottling: "true" === get("enableprioritybasedthrottling"),
enableCopilot: "true" === get("enablecopilot", "true"), enableCopilot: "true" === get("enablecopilot", "true"),
copilotVersion: get("copilotversion") ?? "v1.0", copilotVersion: get("copilotversion") ?? "v1.0",
disableCopilotPhoenixGateaway: "true" === get("disablecopilotphoenixgateaway"), disableCopilotPhoenixGateaway: "true" === get("disablecopilotphoenixgateaway"),

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. */ /* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. */
export async function listCassandraKeyspaces( export async function listCassandraKeyspaces(
@ -196,3 +196,100 @@ export async function migrateCassandraTableToManualThroughput(
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default/migrateToManualThroughput`; const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default/migrateToManualThroughput`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion }); return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
} }
/* Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. */
export async function listCassandraViews(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string
): Promise<Types.CassandraViewListResult> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/views`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Gets the Cassandra view under an existing Azure Cosmos DB database account. */
export async function getCassandraView(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
viewName: string
): Promise<Types.CassandraViewGetResults> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/views/${viewName}`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Create or update an Azure Cosmos DB Cassandra View */
export async function createUpdateCassandraView(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
viewName: string,
body: Types.CassandraViewCreateUpdateParameters
): Promise<Types.CassandraViewGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/views/${viewName}`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
}
/* Deletes an existing Azure Cosmos DB Cassandra view. */
export async function deleteCassandraView(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
viewName: string
): Promise<void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/views/${viewName}`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion });
}
/* Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name. */
export async function getCassandraViewThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
viewName: string
): Promise<Types.ThroughputSettingsGetResults> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/views/${viewName}/throughputSettings/default`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Update RUs per second of an Azure Cosmos DB Cassandra view */
export async function updateCassandraViewThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
viewName: string,
body: Types.ThroughputSettingsUpdateParameters
): Promise<Types.ThroughputSettingsGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/views/${viewName}/throughputSettings/default`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
}
/* Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale */
export async function migrateCassandraViewToAutoscale(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
viewName: string
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/views/${viewName}/throughputSettings/default/migrateToAutoscale`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
}
/* Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput */
export async function migrateCassandraViewToManualThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
viewName: string
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/views/${viewName}/throughputSettings/default/migrateToManualThroughput`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
}

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Retrieves the metrics determined by the given filter for the given database account and collection. */ /* Retrieves the metrics determined by the given filter for the given database account and collection. */
export async function listMetrics( export async function listMetrics(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Retrieves the metrics determined by the given filter for the given collection, split by partition. */ /* Retrieves the metrics determined by the given filter for the given collection, split by partition. */
export async function listMetrics( export async function listMetrics(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Retrieves the metrics determined by the given filter for the given collection and region, split by partition. */ /* Retrieves the metrics determined by the given filter for the given collection and region, split by partition. */
export async function listMetrics( export async function listMetrics(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Retrieves the metrics determined by the given filter for the given database account, collection and region. */ /* Retrieves the metrics determined by the given filter for the given database account, collection and region. */
export async function listMetrics( export async function listMetrics(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Retrieves the metrics determined by the given filter for the given database account and database. */ /* Retrieves the metrics determined by the given filter for the given database account and database. */
export async function listMetrics( export async function listMetrics(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Retrieves the metrics determined by the given filter for the given database account and region. */ /* Retrieves the metrics determined by the given filter for the given database account and region. */
export async function listMetrics( export async function listMetrics(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Retrieves the properties of an existing Azure Cosmos DB database account. */ /* Retrieves the properties of an existing Azure Cosmos DB database account. */
export async function get( export async function get(

View File

@ -0,0 +1,56 @@
/*
AUTOGENERATED FILE
Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/
import { armRequest } from "../../request";
import * as Types from "./types";
import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-09-15-preview";
/* Lists the graphs under an existing Azure Cosmos DB database account. */
export async function listGraphs(
subscriptionId: string,
resourceGroupName: string,
accountName: string
): Promise<Types.GraphResourcesListResult> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/graphs`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. */
export async function getGraph(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
graphName: string
): Promise<Types.GraphResourceGetResults> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/graphs/${graphName}`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Create or update an Azure Cosmos DB Graph. */
export async function createUpdateGraph(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
graphName: string,
body: Types.GraphResourceCreateUpdateParameters
): Promise<Types.GraphResourceGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/graphs/${graphName}`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
}
/* Deletes an existing Azure Cosmos DB Graph Resource. */
export async function deleteGraphResource(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
graphName: string
): Promise<void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/graphs/${graphName}`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion });
}

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Lists the Gremlin databases under an existing Azure Cosmos DB database account. */ /* Lists the Gremlin databases under an existing Azure Cosmos DB database account. */
export async function listGremlinDatabases( export async function listGremlinDatabases(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* List Cosmos DB locations and their properties */ /* List Cosmos DB locations and their properties */
export async function list(subscriptionId: string): Promise<Types.LocationListResult | Types.CloudError> { export async function list(subscriptionId: string): Promise<Types.LocationListResult | Types.CloudError> {

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Lists the MongoDB databases under an existing Azure Cosmos DB database account. */ /* Lists the MongoDB databases under an existing Azure Cosmos DB database account. */
export async function listMongoDBDatabases( export async function listMongoDBDatabases(
@ -100,6 +100,56 @@ export async function migrateMongoDBDatabaseToManualThroughput(
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion }); return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
} }
/* Retrieve throughput distribution for an Azure Cosmos DB MongoDB database */
export async function mongoDBDatabaseRetrieveThroughputDistribution(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
body: Types.RetrieveThroughputParameters
): Promise<Types.PhysicalPartitionThroughputInfoResult | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default/retrieveThroughputDistribution`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
}
/* Redistribute throughput for an Azure Cosmos DB MongoDB database */
export async function mongoDBDatabaseRedistributeThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
body: Types.RedistributeThroughputParameters
): Promise<Types.PhysicalPartitionThroughputInfoResult | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default/redistributeThroughput`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
}
/* Retrieve throughput distribution for an Azure Cosmos DB MongoDB container */
export async function mongoDBContainerRetrieveThroughputDistribution(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
collectionName: string,
body: Types.RetrieveThroughputParameters
): Promise<Types.PhysicalPartitionThroughputInfoResult | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}/throughputSettings/default/retrieveThroughputDistribution`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
}
/* Redistribute throughput for an Azure Cosmos DB MongoDB container */
export async function mongoDBContainerRedistributeThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
collectionName: string,
body: Types.RedistributeThroughputParameters
): Promise<Types.PhysicalPartitionThroughputInfoResult | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}/throughputSettings/default/redistributeThroughput`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
}
/* Lists the MongoDB collection under an existing Azure Cosmos DB database account. */ /* Lists the MongoDB collection under an existing Azure Cosmos DB database account. */
export async function listMongoDBCollections( export async function listMongoDBCollections(
subscriptionId: string, subscriptionId: string,
@ -148,6 +198,31 @@ export async function deleteMongoDBCollection(
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion }); return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion });
} }
/* Merges the partitions of a MongoDB database */
export async function mongoDBDatabasePartitionMerge(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
body: Types.MergeParameters
): Promise<Types.PhysicalPartitionStorageInfoCollection | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/partitionMerge`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
}
/* Merges the partitions of a MongoDB Collection */
export async function listMongoDBCollectionPartitionMerge(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
collectionName: string,
body: Types.MergeParameters
): Promise<Types.PhysicalPartitionStorageInfoCollection | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}/partitionMerge`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
}
/* Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. */ /* Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. */
export async function getMongoDBCollectionThroughput( export async function getMongoDBCollectionThroughput(
subscriptionId: string, subscriptionId: string,

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Lists all of the available Cosmos DB Resource Provider operations. */ /* Lists all of the available Cosmos DB Resource Provider operations. */
export async function list(): Promise<Types.OperationListResult> { export async function list(): Promise<Types.OperationListResult> {

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Retrieves the metrics determined by the given filter for the given partition key range id. */ /* Retrieves the metrics determined by the given filter for the given partition key range id. */
export async function listMetrics( export async function listMetrics(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Retrieves the metrics determined by the given filter for the given partition key range id and region. */ /* Retrieves the metrics determined by the given filter for the given partition key range id and region. */
export async function listMetrics( export async function listMetrics(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data */ /* Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data */
export async function listMetrics( export async function listMetrics(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* 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 */ /* 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 */
export async function listMetrics( export async function listMetrics(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data */ /* Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data */
export async function listMetrics( export async function listMetrics(

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Lists the SQL databases under an existing Azure Cosmos DB database account. */ /* Lists the SQL databases under an existing Azure Cosmos DB database account. */
export async function listSqlDatabases( export async function listSqlDatabases(
@ -100,6 +100,42 @@ export async function migrateSqlDatabaseToManualThroughput(
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion }); return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
} }
/* Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. */
export async function listClientEncryptionKeys(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string
): Promise<Types.ClientEncryptionKeysListResult> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/clientEncryptionKeys`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. */
export async function getClientEncryptionKey(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
clientEncryptionKeyName: string
): Promise<Types.ClientEncryptionKeyGetResults> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/clientEncryptionKeys/${clientEncryptionKeyName}`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell (instead of directly). */
export async function createUpdateClientEncryptionKey(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
clientEncryptionKeyName: string,
body: Types.ClientEncryptionKeyCreateUpdateParameters
): Promise<Types.ClientEncryptionKeyGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/clientEncryptionKeys/${clientEncryptionKeyName}`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
}
/* Lists the SQL container under an existing Azure Cosmos DB database account. */ /* Lists the SQL container under an existing Azure Cosmos DB database account. */
export async function listSqlContainers( export async function listSqlContainers(
subscriptionId: string, subscriptionId: string,
@ -148,6 +184,31 @@ export async function deleteSqlContainer(
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion }); return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion });
} }
/* Merges the partitions of a SQL database */
export async function sqlDatabasePartitionMerge(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
body: Types.MergeParameters
): Promise<Types.PhysicalPartitionStorageInfoCollection | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/partitionMerge`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
}
/* Merges the partitions of a SQL Container */
export async function listSqlContainerPartitionMerge(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
containerName: string,
body: Types.MergeParameters
): Promise<Types.PhysicalPartitionStorageInfoCollection | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/partitionMerge`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
}
/* Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. */ /* Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. */
export async function getSqlContainerThroughput( export async function getSqlContainerThroughput(
subscriptionId: string, subscriptionId: string,
@ -197,40 +258,54 @@ export async function migrateSqlContainerToManualThroughput(
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion }); return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
} }
/* Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. */ /* Retrieve throughput distribution for an Azure Cosmos DB SQL database */
export async function listClientEncryptionKeys( export async function sqlDatabaseRetrieveThroughputDistribution(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string
): Promise<Types.ClientEncryptionKeysListResult> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/clientEncryptionKeys`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. */
export async function getClientEncryptionKey(
subscriptionId: string, subscriptionId: string,
resourceGroupName: string, resourceGroupName: string,
accountName: string, accountName: string,
databaseName: string, databaseName: string,
clientEncryptionKeyName: string body: Types.RetrieveThroughputParameters
): Promise<Types.ClientEncryptionKeyGetResults> { ): Promise<Types.PhysicalPartitionThroughputInfoResult | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/clientEncryptionKeys/${clientEncryptionKeyName}`; const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/throughputSettings/default/retrieveThroughputDistribution`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion }); return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
} }
/* 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 */
export async function createUpdateClientEncryptionKey( export async function sqlDatabaseRedistributeThroughput(
subscriptionId: string, subscriptionId: string,
resourceGroupName: string, resourceGroupName: string,
accountName: string, accountName: string,
databaseName: string, databaseName: string,
clientEncryptionKeyName: string, body: Types.RedistributeThroughputParameters
body: Types.ClientEncryptionKeyCreateUpdateParameters ): Promise<Types.PhysicalPartitionThroughputInfoResult | void | Types.CloudError> {
): Promise<Types.ClientEncryptionKeyGetResults | void> { const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/throughputSettings/default/redistributeThroughput`;
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/clientEncryptionKeys/${clientEncryptionKeyName}`; return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body }); }
/* Retrieve throughput distribution for an Azure Cosmos DB SQL container */
export async function sqlContainerRetrieveThroughputDistribution(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
containerName: string,
body: Types.RetrieveThroughputParameters
): Promise<Types.PhysicalPartitionThroughputInfoResult | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/throughputSettings/default/retrieveThroughputDistribution`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
}
/* Redistribute throughput for an Azure Cosmos DB SQL container */
export async function sqlContainerRedistributeThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseName: string,
containerName: string,
body: Types.RedistributeThroughputParameters
): Promise<Types.PhysicalPartitionThroughputInfoResult | void | Types.CloudError> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/throughputSettings/default/redistributeThroughput`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion, body });
} }
/* Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. */ /* Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. */

View File

@ -3,13 +3,13 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
import { armRequest } from "../../request"; import { armRequest } from "../../request";
import * as Types from "./types"; import * as Types from "./types";
import { configContext } from "../../../../ConfigContext"; import { configContext } from "../../../../ConfigContext";
const apiVersion = "2023-04-15"; const apiVersion = "2023-09-15-preview";
/* Lists the Tables under an existing Azure Cosmos DB database account. */ /* Lists the Tables under an existing Azure Cosmos DB database account. */
export async function listTables( export async function listTables(

View File

@ -3,7 +3,7 @@
Run "npm run generateARMClients" to regenerate Run "npm run generateARMClients" to regenerate
Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs
Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-04-15/cosmos-db.json Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-09-15-preview/cosmos-db.json
*/ */
/* The List operation response, that contains the client encryption keys and their properties. */ /* The List operation response, that contains the client encryption keys and their properties. */
@ -18,6 +18,12 @@ export interface DatabaseAccountsListResult {
readonly value?: DatabaseAccountGetResults[]; readonly value?: DatabaseAccountGetResults[];
} }
/* The List operation response, that contains the Graph resource and their properties. */
export interface GraphResourcesListResult {
/* List of Graph resource and their properties. */
readonly value?: GraphResourceGetResults[];
}
/* The List operation response, that contains the SQL databases and their properties. */ /* The List operation response, that contains the SQL databases and their properties. */
export interface SqlDatabaseListResult { export interface SqlDatabaseListResult {
/* List of SQL databases and their properties. */ /* List of SQL databases and their properties. */
@ -90,6 +96,12 @@ export interface GremlinGraphListResult {
readonly value?: GremlinGraphGetResults[]; readonly value?: GremlinGraphGetResults[];
} }
/* The List operation response, that contains the Cassandra views and their properties. */
export interface CassandraViewListResult {
/* List of Cassandra views and their properties. */
readonly value?: CassandraViewGetResults[];
}
/* Error Response. */ /* Error Response. */
export interface ErrorResponse { export interface ErrorResponse {
/* Error code. */ /* Error code. */
@ -155,6 +167,9 @@ export interface ARMResourceProperties {
location?: string; location?: string;
/* undocumented */ /* undocumented */
tags?: Tags; tags?: Tags;
/* undocumented */
identity?: ManagedServiceIdentity;
} }
/* The resource model definition for a ARM proxy resource. It will have everything other than required location and tags */ /* The resource model definition for a ARM proxy resource. It will have everything other than required location and tags */
@ -234,6 +249,20 @@ export type SqlDatabaseGetResults = ARMResourceProperties & {
properties?: SqlDatabaseGetProperties; properties?: SqlDatabaseGetProperties;
}; };
/* The properties of an Azure Cosmos DB SQL database */
export interface GraphResourceGetProperties {
/* undocumented */
resource?: GraphResource;
/* undocumented */
options?: OptionsResource;
}
/* An Azure Cosmos DB Graph resource. */
export type GraphResourceGetResults = ARMResourceProperties & {
/* The properties of an Azure Cosmos DB Graph resource. */
properties?: GraphResourceGetProperties;
};
/* The properties of an Azure Cosmos DB SQL database */ /* The properties of an Azure Cosmos DB SQL database */
export interface SqlDatabaseGetProperties { export interface SqlDatabaseGetProperties {
/* undocumented */ /* undocumented */
@ -390,6 +419,20 @@ export interface GremlinGraphGetProperties {
options?: OptionsResource; options?: OptionsResource;
} }
/* An Azure Cosmos DB Cassandra view. */
export type CassandraViewGetResults = ARMResourceProperties & {
/* The properties of an Azure Cosmos DB Cassandra view */
properties?: CassandraViewGetProperties;
};
/* The properties of an Azure Cosmos DB Cassandra view */
export interface CassandraViewGetProperties {
/* undocumented */
resource?: CassandraViewResource & ExtendedResourceProperties;
/* undocumented */
options?: OptionsResource;
}
/* The consistency policy for the Cosmos DB database account. */ /* The consistency policy for the Cosmos DB database account. */
export interface ConsistencyPolicy { export interface ConsistencyPolicy {
/* The default consistency level and configuration settings of the Cosmos DB account. */ /* The default consistency level and configuration settings of the Cosmos DB account. */
@ -502,18 +545,33 @@ export interface DatabaseAccountGetProperties {
/* An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */ /* An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */
networkAclBypassResourceIds?: unknown[]; networkAclBypassResourceIds?: unknown[];
/* 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. */ /* Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */
disableLocalAuth?: boolean; disableLocalAuth?: boolean;
/* The object that represents all properties related to capacity enforcement on an account. */ /* The object that represents all properties related to capacity enforcement on an account. */
capacity?: Capacity; capacity?: Capacity;
/* Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */
enableMaterializedViews?: boolean;
/* The object that represents the metadata for the Account Keys of the Cosmos DB account. */ /* The object that represents the metadata for the Account Keys of the Cosmos DB account. */
keysMetadata?: DatabaseAccountKeysMetadata; keysMetadata?: DatabaseAccountKeysMetadata;
/* Flag to indicate enabling/disabling of Partition Merge feature on the account */ /* Flag to indicate enabling/disabling of Partition Merge feature on the account */
enablePartitionMerge?: boolean; enablePartitionMerge?: boolean;
/* 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. */ /* 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; 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?: CustomerManagedKeyStatus;
/* 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;
} }
/* Properties to create and update Azure Cosmos DB database accounts. */ /* Properties to create and update Azure Cosmos DB database accounts. */
@ -581,6 +639,9 @@ export interface DatabaseAccountCreateUpdateProperties {
/* An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */ /* An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */
networkAclBypassResourceIds?: unknown[]; networkAclBypassResourceIds?: unknown[];
/* 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. */ /* Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */
disableLocalAuth?: boolean; disableLocalAuth?: boolean;
/* Parameters to indicate the information about the restore. */ /* Parameters to indicate the information about the restore. */
@ -589,13 +650,25 @@ export interface DatabaseAccountCreateUpdateProperties {
/* The object that represents all properties related to capacity enforcement on an account. */ /* The object that represents all properties related to capacity enforcement on an account. */
capacity?: Capacity; capacity?: Capacity;
/* Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */
enableMaterializedViews?: boolean;
/* This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. */ /* This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. */
keysMetadata?: DatabaseAccountKeysMetadata; keysMetadata?: DatabaseAccountKeysMetadata;
/* Flag to indicate enabling/disabling of Partition Merge feature on the account */ /* Flag to indicate enabling/disabling of Partition Merge feature on the account */
enablePartitionMerge?: boolean; enablePartitionMerge?: boolean;
/* 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. */ /* 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; 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?: CustomerManagedKeyStatus;
/* 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;
} }
/* Parameters to create and update Cosmos DB database accounts. */ /* Parameters to create and update Cosmos DB database accounts. */
@ -669,18 +742,33 @@ export interface DatabaseAccountUpdateProperties {
/* An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */ /* An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */
networkAclBypassResourceIds?: unknown[]; networkAclBypassResourceIds?: unknown[];
/* 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. */ /* Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */
disableLocalAuth?: boolean; disableLocalAuth?: boolean;
/* The object that represents all properties related to capacity enforcement on an account. */ /* The object that represents all properties related to capacity enforcement on an account. */
capacity?: Capacity; capacity?: Capacity;
/* Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */
enableMaterializedViews?: boolean;
/* This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. */ /* This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. */
keysMetadata?: DatabaseAccountKeysMetadata; keysMetadata?: DatabaseAccountKeysMetadata;
/* Flag to indicate enabling/disabling of Partition Merge feature on the account */ /* Flag to indicate enabling/disabling of Partition Merge feature on the account */
enablePartitionMerge?: boolean; enablePartitionMerge?: boolean;
/* 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. */ /* 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; 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?: CustomerManagedKeyStatus;
/* 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;
} }
/* Parameters for patching Azure Cosmos DB database account properties. */ /* Parameters for patching Azure Cosmos DB database account properties. */
@ -762,6 +850,27 @@ export interface ThroughputSettingsUpdateProperties {
resource: ThroughputSettingsResource; resource: ThroughputSettingsResource;
} }
/* Parameters to create and update Cosmos DB Graph resource. */
export type GraphResourceCreateUpdateParameters = ARMResourceProperties & {
/* Properties to create and update Azure Cosmos DB Graph resource. */
properties: GraphResourceCreateUpdateProperties;
};
/* Properties to create and update Azure Cosmos DB Graph resource. */
export interface GraphResourceCreateUpdateProperties {
/* 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;
}
/* Cosmos DB Graph resource object */
export interface GraphResource {
/* Name of the Cosmos DB Graph */
id: string;
}
/* Parameters to create and update Cosmos DB SQL database. */ /* Parameters to create and update Cosmos DB SQL database. */
export type SqlDatabaseCreateUpdateParameters = ARMResourceProperties & { export type SqlDatabaseCreateUpdateParameters = ARMResourceProperties & {
/* Properties to create and update Azure Cosmos DB SQL database. */ /* Properties to create and update Azure Cosmos DB SQL database. */
@ -942,6 +1051,21 @@ export interface GremlinGraphCreateUpdateProperties {
options?: CreateUpdateOptions; options?: CreateUpdateOptions;
} }
/* Parameters to create and update Cosmos DB Cassandra view. */
export type CassandraViewCreateUpdateParameters = ARMResourceProperties & {
/* Properties to create and update Azure Cosmos DB Cassandra view. */
properties: CassandraViewCreateUpdateProperties;
};
/* Properties to create and update Azure Cosmos DB Cassandra view. */
export interface CassandraViewCreateUpdateProperties {
/* 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;
}
/* Cosmos DB resource throughput object. Either throughput is required or autoscaleSettings is required, but not both. */ /* Cosmos DB resource throughput object. Either throughput is required or autoscaleSettings is required, but not both. */
export interface ThroughputSettingsResource { export interface ThroughputSettingsResource {
/* Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. */ /* Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. */
@ -992,6 +1116,80 @@ export interface OptionsResource {
autoscaleSettings?: AutoscaleSettings; autoscaleSettings?: AutoscaleSettings;
} }
/* Cosmos DB redistribute throughput parameters object */
export type RedistributeThroughputParameters = ARMResourceProperties & {
/* Properties to redistribute throughput parameters object */
properties: RedistributeThroughputProperties;
};
/* Properties to redistribute throughput for Azure Cosmos DB resource. */
export interface RedistributeThroughputProperties {
/* The standard JSON format of a resource throughput */
resource: RedistributeThroughputPropertiesResource;
}
/* Resource to redistribute throughput for Azure Cosmos DB resource */
export interface RedistributeThroughputPropertiesResource {
/* ThroughputPolicy to apply for throughput redistribution */
throughputPolicy: "none" | "equal" | "custom";
/* Array of PhysicalPartitionThroughputInfoResource objects. */
targetPhysicalPartitionThroughputInfo: PhysicalPartitionThroughputInfoResource[];
/* Array of PhysicalPartitionThroughputInfoResource objects. */
sourcePhysicalPartitionThroughputInfo: PhysicalPartitionThroughputInfoResource[];
}
/* Cosmos DB retrieve throughput parameters object */
export type RetrieveThroughputParameters = ARMResourceProperties & {
/* Properties to retrieve throughput parameters object */
properties: RetrieveThroughputProperties;
};
/* Properties to retrieve throughput for Azure Cosmos DB resource. */
export interface RetrieveThroughputProperties {
/* The standard JSON format of a resource throughput */
resource: RetrieveThroughputPropertiesResource;
}
/* 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;
}
/* An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */
export type PhysicalPartitionThroughputInfoResult = ARMResourceProperties & {
/* The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object */
properties?: PhysicalPartitionThroughputInfoResultProperties;
};
/* The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object */
export interface PhysicalPartitionThroughputInfoResultProperties {
/* properties of physical partition throughput info */
resource?: PhysicalPartitionThroughputInfoProperties;
}
/* 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;
}
/* Cosmos DB client encryption key resource object. */ /* Cosmos DB client encryption key resource object. */
export interface ClientEncryptionKeyResource { export interface ClientEncryptionKeyResource {
/* Name of the ClientEncryptionKey */ /* Name of the ClientEncryptionKey */
@ -1020,6 +1218,11 @@ export interface KeyWrapMetadata {
export interface SqlDatabaseResource { export interface SqlDatabaseResource {
/* Name of the Cosmos DB SQL database */ /* Name of the Cosmos DB SQL database */
id: string; id: string;
/* Parameters to indicate the information about the restore */
restoreParameters?: ResourceRestoreParameters;
/* Enum to indicate the mode of resource creation. */
createMode?: CreateMode;
} }
/* Cosmos DB SQL container resource object */ /* Cosmos DB SQL container resource object */
@ -1045,6 +1248,14 @@ export interface SqlContainerResource {
/* Analytical TTL. */ /* Analytical TTL. */
analyticalStorageTtl?: number; analyticalStorageTtl?: number;
/* Parameters to indicate the information about the restore */
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;
} }
/* Cosmos DB indexing policy */ /* Cosmos DB indexing policy */
@ -1175,6 +1386,16 @@ export interface ClientEncryptionIncludedPath {
encryptionAlgorithm: string; encryptionAlgorithm: string;
} }
/* Materialized View definition for the container. */
export interface MaterializedViewDefinition {
/* An unique identifier for the source collection. This is a system generated property. */
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;
}
/* Cosmos DB SQL storedProcedure resource object */ /* Cosmos DB SQL storedProcedure resource object */
export interface SqlStoredProcedureResource { export interface SqlStoredProcedureResource {
/* Name of the Cosmos DB SQL storedProcedure */ /* Name of the Cosmos DB SQL storedProcedure */
@ -1208,6 +1429,11 @@ export interface SqlTriggerResource {
export interface MongoDBDatabaseResource { export interface MongoDBDatabaseResource {
/* Name of the Cosmos DB MongoDB database */ /* Name of the Cosmos DB MongoDB database */
id: string; id: string;
/* Parameters to indicate the information about the restore */
restoreParameters?: ResourceRestoreParameters;
/* Enum to indicate the mode of resource creation. */
createMode?: CreateMode;
} }
/* Cosmos DB MongoDB collection resource object */ /* Cosmos DB MongoDB collection resource object */
@ -1222,6 +1448,11 @@ export interface MongoDBCollectionResource {
/* Analytical TTL. */ /* Analytical TTL. */
analyticalStorageTtl?: number; analyticalStorageTtl?: number;
/* Parameters to indicate the information about the restore */
restoreParameters?: ResourceRestoreParameters;
/* Enum to indicate the mode of resource creation. */
createMode?: CreateMode;
} }
/* The shard key and partition kind pair, only support "Hash" partition kind */ /* The shard key and partition kind pair, only support "Hash" partition kind */
@ -1257,6 +1488,11 @@ export interface MongoIndexOptions {
export interface TableResource { export interface TableResource {
/* Name of the Cosmos DB table */ /* Name of the Cosmos DB table */
id: string; id: string;
/* Parameters to indicate the information about the restore */
restoreParameters?: ResourceRestoreParameters;
/* Enum to indicate the mode of resource creation. */
createMode?: CreateMode;
} }
/* Cosmos DB Cassandra keyspace resource object */ /* Cosmos DB Cassandra keyspace resource object */
@ -1316,6 +1552,11 @@ export interface ClusterKey {
export interface GremlinDatabaseResource { export interface GremlinDatabaseResource {
/* Name of the Cosmos DB Gremlin database */ /* Name of the Cosmos DB Gremlin database */
id: string; id: string;
/* Parameters to indicate the information about the restore */
restoreParameters?: ResourceRestoreParameters;
/* Enum to indicate the mode of resource creation. */
createMode?: CreateMode;
} }
/* Cosmos DB Gremlin graph resource object */ /* Cosmos DB Gremlin graph resource object */
@ -1338,13 +1579,26 @@ export interface GremlinGraphResource {
/* Analytical TTL. */ /* Analytical TTL. */
analyticalStorageTtl?: number; analyticalStorageTtl?: number;
/* Parameters to indicate the information about the restore */
restoreParameters?: ResourceRestoreParameters;
/* Enum to indicate the mode of resource creation. */
createMode?: CreateMode;
}
/* 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;
} }
/* CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput" */ /* CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput" */
export interface CreateUpdateOptions { export interface CreateUpdateOptions {
/* Request Units per second. For example, "throughput": 10000. */ /* Request Units per second. For example, "throughput": 10000. */
throughput?: number; throughput?: number;
/* Specifies the Autoscale settings. */ /* Specifies the Autoscale settings. Note: Either throughput or autoscaleSettings is required, but not both. */
autoscaleSettings?: AutoscaleSettings; autoscaleSettings?: AutoscaleSettings;
} }
@ -1426,6 +1680,12 @@ export interface DatabaseAccountKeysMetadata {
readonly secondaryReadonlyMasterKey?: AccountKeyMetadata; readonly secondaryReadonlyMasterKey?: AccountKeyMetadata;
} }
/* 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?: "None" | "True" | "False";
}
/* REST API operation */ /* REST API operation */
export interface Operation { export interface Operation {
/* Operation name: {provider}/{resource}/{operation} */ /* Operation name: {provider}/{resource}/{operation} */
@ -1642,7 +1902,7 @@ export type AnalyticalStorageSchemaType = "WellDefined" | "FullFidelity";
export type CreateMode = "Default" | "Restore"; export type CreateMode = "Default" | "Restore";
/* Parameters to indicate the information about the restore. */ /* Parameters to indicate the information about the restore. */
export interface RestoreParameters { export type RestoreParameters = RestoreParametersBase & {
/* Describes the mode of the restore. */ /* Describes the mode of the restore. */
restoreMode?: "PointInTime"; restoreMode?: "PointInTime";
@ -1658,8 +1918,22 @@ export interface RestoreParameters {
/* List of specific tables available for restore. */ /* List of specific tables available for restore. */
tablesToRestore?: TableName[]; tablesToRestore?: TableName[];
/* The source backup location for restore. */
sourceBackupLocation?: string;
};
/* Parameters to indicate the information about the restore. */
export interface RestoreParametersBase {
/* The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} */
restoreSource?: string;
/* Time to which the account has to be restored (ISO-8601 format). */
restoreTimestampInUtc?: string;
} }
/* Parameters to indicate the information about the restore. */
export type ResourceRestoreParameters = RestoreParametersBase;
/* Specific Databases to restore. */ /* Specific Databases to restore. */
export interface DatabaseRestoreResource { export interface DatabaseRestoreResource {
/* The name of the database available for restore. */ /* The name of the database available for restore. */
@ -1736,10 +2010,30 @@ export interface PeriodicModeProperties {
/* Configuration values for periodic mode backup */ /* Configuration values for periodic mode backup */
export interface ContinuousModeProperties { export interface ContinuousModeProperties {
/* Enum to indicate type of Continuous backup mode */ /* Enum to indicate type of Continuos backup mode */
tier?: ContinuousTier; tier?: ContinuousTier;
} }
/* The properties of an Azure Cosmos DB merge operations */
export interface MergeParameters {
/* Specifies whether the operation is a real merge operation or a simulation. */
isDryRun?: boolean;
}
/* List of physical partitions and their properties returned by a merge operation. */
export interface PhysicalPartitionStorageInfoCollection {
/* List of physical partitions and their properties. */
readonly physicalPartitionStorageInfoCollection?: physicalPartitionStorageInfo[];
}
/* The storage of a physical partition */
export interface physicalPartitionStorageInfo {
/* The unique identifier of the partition. */
readonly id?: string;
/* The storage in KB for the physical partition. */
readonly storageInKB?: number;
}
/* The List operation response, that contains Cosmos DB locations and their properties. */ /* The List operation response, that contains Cosmos DB locations and their properties. */
export interface LocationListResult { export interface LocationListResult {
/* List of Cosmos DB locations and their properties. */ /* List of Cosmos DB locations and their properties. */
@ -1777,3 +2071,20 @@ export type ContinuousTier = "Continuous7Days" | "Continuous30Days";
/* 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. */ /* 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. */
export type MinimalTlsVersion = "Tls" | "Tls11" | "Tls12"; export type MinimalTlsVersion = "Tls" | "Tls11" | "Tls12";
/* Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. */
export type CustomerManagedKeyStatus =
| "Access to your account is currently revoked because the Azure Cosmos DB service is unable to obtain the AAD authentication token for the account's default identity; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#azure-active-directory-token-acquisition-error (4000)."
| "Access to your account is currently revoked because the Azure Cosmos DB account's key vault key URI does not follow the expected format; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#improper-syntax-detected-on-the-key-vault-uri-property (4006)."
| "Access to your account is currently revoked because the current default identity no longer has permission to the associated Key Vault key; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#default-identity-is-unauthorized-to-access-the-azure-key-vault-key (4002)."
| "Access to your account is currently revoked because the Azure Key Vault DNS name specified by the account's keyvaultkeyuri property could not be resolved; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#unable-to-resolve-the-key-vaults-dns (4009)."
| "Access to your account is currently revoked because the correspondent key is not found on the specified Key Vault; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#azure-key-vault-resource-not-found (4003)."
| "Access to your account is currently revoked because the Azure Cosmos DB service is unable to wrap or unwrap the key; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#internal-unwrapping-procedure-error (4005)."
| "Access to your account is currently revoked because the Azure Cosmos DB account has an undefined default identity; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#invalid-azure-cosmos-db-default-identity (4015)."
| "Access to your account is currently revoked because the access rules are blocking outbound requests to the Azure Key Vault service; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide (4016)."
| "Access to your account is currently revoked because the correspondent Azure Key Vault was not found; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#azure-key-vault-resource-not-found (4017)."
| "Access to your account is currently revoked; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide"
| "Access to the configured customer managed key confirmed.";
/* Enum to indicate default priorityLevel of requests */
export type DefaultPriorityLevel = "High" | "Low";

View File

@ -16,14 +16,14 @@ Results of this file should be checked into the repo.
*/ */
// CHANGE THESE VALUES TO GENERATE NEW CLIENTS // CHANGE THESE VALUES TO GENERATE NEW CLIENTS
const version = "2023-04-15"; const version = "2023-09-15-preview";
/* The following are legal options for resourceName but you generally will only use cosmos-db: /* The following are legal options for resourceName but you generally will only use cosmos-db:
"cosmos-db" | "managedCassandra" | "mongorbac" | "notebook" | "privateEndpointConnection" | "privateLinkResources" | "cosmos-db" | "managedCassandra" | "mongorbac" | "notebook" | "privateEndpointConnection" | "privateLinkResources" |
"rbac" | "restorable" | "services" "rbac" | "restorable" | "services"
*/ */
const githubResourceName = "cosmos-db"; const githubResourceName = "cosmos-db";
const deResourceName = "cosmos"; const deResourceName = "cosmos";
const schemaURL = `https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/${version}/${githubResourceName}.json`; const schemaURL = `https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/${version}/${githubResourceName}.json`;
const outputDir = path.join(__dirname, `../../src/Utils/arm/generatedClients/${deResourceName}`); const outputDir = path.join(__dirname, `../../src/Utils/arm/generatedClients/${deResourceName}`);
// Array of strings to use for eventual output // Array of strings to use for eventual output