Update generated ARM clients to latest version (#807)

This commit is contained in:
Steve Faulkner
2021-05-20 20:34:29 -05:00
committed by GitHub
parent e6b3f01f16
commit f4b0ea7d69
73 changed files with 1228 additions and 347 deletions

View File

@@ -0,0 +1,101 @@
/*
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
*/
import { configContext } from "../../../../ConfigContext";
import { armRequest } from "../../request";
import * as Types from "./types";
const apiVersion = "2021-04-15";
/* Lists the Tables under an existing Azure Cosmos DB database account. */
export async function listTables(
subscriptionId: string,
resourceGroupName: string,
accountName: string
): Promise<Types.TableListResult> {
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<Types.TableGetResults> {
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<Types.TableGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}`;
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
}
/* Deletes an existing Azure Cosmos DB Table. */
export async function deleteTable(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
tableName: string
): Promise<void> {
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<Types.ThroughputSettingsGetResults> {
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<Types.ThroughputSettingsGetResults | void> {
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 });
}
/* Migrate an Azure Cosmos DB Table from manual throughput to autoscale */
export async function migrateTableToAutoscale(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
tableName: string
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
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<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
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 });
}