Move Delete Container call to use ARM when logged in with AAD (#110)

This commit is contained in:
Steve Faulkner
2020-08-03 17:11:07 -05:00
committed by GitHub
parent 8c792fd147
commit 2904a1a60d
71 changed files with 3493 additions and 126 deletions

View File

@@ -0,0 +1,196 @@
/*
AUTOGENERATED FILE
Do not manually edit
Run "npm run generateARMClients" to regenerate
*/
import { armRequest } from "../../request";
import * as Types from "./types";
import { config } from "../../../../Config";
const apiVersion = "2020-04-01";
/* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. */
export async function listCassandraKeyspaces(
subscriptionId: string,
resourceGroupName: string,
accountName: string
): Promise<Types.CassandraKeyspaceListResult> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. */
export async function getCassandraKeyspace(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string
): Promise<Types.CassandraKeyspaceGetResults> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Create or update an Azure Cosmos DB Cassandra keyspace */
export async function createUpdateCassandraKeyspace(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
body: Types.CassandraKeyspaceCreateUpdateParameters
): Promise<Types.CassandraKeyspaceGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "PUT", apiVersion, body: JSON.stringify(body) });
}
/* Deletes an existing Azure Cosmos DB Cassandra keyspace. */
export async function deleteCassandraKeyspace(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string
): Promise<void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "DELETE", apiVersion });
}
/* Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. */
export async function getCassandraKeyspaceThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string
): Promise<Types.ThroughputSettingsGetResults> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace */
export async function updateCassandraKeyspaceThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
body: Types.ThroughputSettingsUpdateParameters
): Promise<Types.ThroughputSettingsGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "PUT", apiVersion, body: JSON.stringify(body) });
}
/* Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale */
export async function migrateCassandraKeyspaceToAutoscale(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string
): Promise<Types.ThroughputSettingsGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default/migrateToAutoscale`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "POST", apiVersion });
}
/* Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput */
export async function migrateCassandraKeyspaceToManualThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string
): Promise<Types.ThroughputSettingsGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default/migrateToManualThroughput`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "POST", apiVersion });
}
/* Lists the Cassandra table under an existing Azure Cosmos DB database account. */
export async function listCassandraTables(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string
): Promise<Types.CassandraTableListResult> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Gets the Cassandra table under an existing Azure Cosmos DB database account. */
export async function getCassandraTable(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
tableName: string
): Promise<Types.CassandraTableGetResults> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Create or update an Azure Cosmos DB Cassandra Table */
export async function createUpdateCassandraTable(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
tableName: string,
body: Types.CassandraTableCreateUpdateParameters
): Promise<Types.CassandraTableGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "PUT", apiVersion, body: JSON.stringify(body) });
}
/* Deletes an existing Azure Cosmos DB Cassandra table. */
export async function deleteCassandraTable(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
tableName: string
): Promise<void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "DELETE", apiVersion });
}
/* Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. */
export async function getCassandraTableThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
tableName: string
): Promise<Types.ThroughputSettingsGetResults> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "GET", apiVersion });
}
/* Update RUs per second of an Azure Cosmos DB Cassandra table */
export async function updateCassandraTableThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
tableName: string,
body: Types.ThroughputSettingsUpdateParameters
): Promise<Types.ThroughputSettingsGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "PUT", apiVersion, body: JSON.stringify(body) });
}
/* Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale */
export async function migrateCassandraTableToAutoscale(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
tableName: string
): Promise<Types.ThroughputSettingsGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default/migrateToAutoscale`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "POST", apiVersion });
}
/* Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput */
export async function migrateCassandraTableToManualThroughput(
subscriptionId: string,
resourceGroupName: string,
accountName: string,
keyspaceName: string,
tableName: string
): Promise<Types.ThroughputSettingsGetResults | void> {
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default/migrateToManualThroughput`;
return armRequest({ host: config.ARM_ENDPOINT, path, method: "POST", apiVersion });
}