/* AUTOGENERATED FILE Do not manually edit Run "npm run generateARMClients" to regenerate */ import { armRequest } from "../../request"; import * as Types from "./types"; import { configContext } from "../../../../ConfigContext"; const apiVersion = "2020-04-01"; /* Lists the Tables under an existing Azure Cosmos DB database account. */ export async function listTables( subscriptionId: string, resourceGroupName: string, accountName: string ): Promise { const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables`; return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion }); } /* Gets the Tables under an existing Azure Cosmos DB database account with the provided name. */ export async function getTable( subscriptionId: string, resourceGroupName: string, accountName: string, tableName: string ): Promise { const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}`; return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion }); } /* Create or update an Azure Cosmos DB Table */ export async function createUpdateTable( subscriptionId: string, resourceGroupName: string, accountName: string, tableName: string, body: Types.TableCreateUpdateParameters ): Promise { const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}`; return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body: JSON.stringify(body) }); } /* Deletes an existing Azure Cosmos DB Table. */ export async function deleteTable( subscriptionId: string, resourceGroupName: string, accountName: string, tableName: string ): Promise { const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}`; return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion }); } /* Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. */ export async function getTableThroughput( subscriptionId: string, resourceGroupName: string, accountName: string, tableName: string ): Promise { const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default`; return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion }); } /* Update RUs per second of an Azure Cosmos DB Table */ export async function updateTableThroughput( subscriptionId: string, resourceGroupName: string, accountName: string, tableName: string, body: Types.ThroughputSettingsUpdateParameters ): Promise { const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default`; return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body: JSON.stringify(body) }); } /* Migrate an Azure Cosmos DB Table from manual throughput to autoscale */ export async function migrateTableToAutoscale( subscriptionId: string, resourceGroupName: string, accountName: string, tableName: string ): Promise { const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default/migrateToAutoscale`; return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion }); } /* Migrate an Azure Cosmos DB Table from autoscale to manual throughput */ export async function migrateTableToManualThroughput( subscriptionId: string, resourceGroupName: string, accountName: string, tableName: string ): Promise { const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default/migrateToManualThroughput`; return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion }); }