mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-03-13 05:15:30 +00:00
* 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>
46 lines
2.1 KiB
TypeScript
46 lines
2.1 KiB
TypeScript
/*
|
|
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";
|
|
|
|
/* Retrieves the metrics determined by the given filter for the given database account and database. */
|
|
export async function listMetrics(
|
|
subscriptionId: string,
|
|
resourceGroupName: string,
|
|
accountName: string,
|
|
databaseRid: string
|
|
): Promise<Types.MetricListResult> {
|
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/metrics`;
|
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
|
}
|
|
|
|
/* Retrieves the usages (most recent data) for the given database. */
|
|
export async function listUsages(
|
|
subscriptionId: string,
|
|
resourceGroupName: string,
|
|
accountName: string,
|
|
databaseRid: string
|
|
): Promise<Types.UsagesResult> {
|
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/usages`;
|
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
|
}
|
|
|
|
/* Retrieves metric definitions for the given database. */
|
|
export async function listMetricDefinitions(
|
|
subscriptionId: string,
|
|
resourceGroupName: string,
|
|
accountName: string,
|
|
databaseRid: string
|
|
): Promise<Types.MetricDefinitionsListResult> {
|
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/metricDefinitions`;
|
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
|
}
|