cosmos-explorer/src/Utils/arm/Collection.ts
Steve Faulkner 8aeff8fb45 Tweaks
2020-07-23 21:52:05 -05:00

44 lines
1.9 KiB
TypeScript

/*
AUTOGENERATED FILE
Do not manually edit
Run "npm run generateARMClients" to regenerate
*/
import * as Types from "./types";
/* Retrieves the metrics determined by the given filter for the given database account and collection. */
export async function listMetrics(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseRid: string,
collectionRid: string
): Promise<Types.MetricListResult> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/metrics`;
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
}
/* Retrieves the usages (most recent storage data) for the given collection. */
export async function listUsages(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseRid: string,
collectionRid: string
): Promise<Types.UsagesResult> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/usages`;
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
}
/* Retrieves metric definitions for the given collection. */
export async function listMetricDefinitions(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
databaseRid: string,
collectionRid: string
): Promise<Types.MetricDefinitionsListResult> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/metricDefinitions`;
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
}