mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-22 18:32:00 +00:00
More tweaks
This commit is contained in:
@@ -4,164 +4,112 @@
|
||||
Run "npm run generateARMClients" to regenerate
|
||||
*/
|
||||
|
||||
import * as Types from "./types"
|
||||
import * as Types from "./types";
|
||||
|
||||
export class CassandraResourcesClient {
|
||||
private readonly baseUrl = "https://management.azure.com";
|
||||
private readonly basePath = `/subscriptions/${this.subscriptionId}/resourceGroups/${this.resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${this.accountName}/cassandraKeyspaces`;
|
||||
|
||||
/* 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> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces`, { method: "get", }).then((response) => response.json())
|
||||
}
|
||||
|
||||
constructor(
|
||||
private readonly subscriptionId: string,
|
||||
private readonly resourceGroupName: string,
|
||||
private readonly accountName: string
|
||||
) {}
|
||||
|
||||
/* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. */
|
||||
async listCassandraKeyspaces(): Promise<Types.CassandraKeyspaceListResult> {
|
||||
const path = ``;
|
||||
return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* 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> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`, { method: "get", }).then((response) => response.json())
|
||||
}
|
||||
|
||||
/* Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. */
|
||||
async getCassandraKeyspace(keyspaceName: string): Promise<Types.CassandraKeyspaceGetResults> {
|
||||
const path = `/${keyspaceName}`;
|
||||
return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB Cassandra keyspace */
|
||||
async createUpdateCassandraKeyspace(
|
||||
keyspaceName: string,
|
||||
body: Types.CassandraKeyspaceCreateUpdateParameters
|
||||
): Promise<Types.CassandraKeyspaceGetResults | void> {
|
||||
const path = `/${keyspaceName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + this.basePath + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
}
|
||||
|
||||
/* 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> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`, { method: "put", body: JSON.stringify(body) }).then((response) => response.json())
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB Cassandra keyspace. */
|
||||
async deleteCassandraKeyspace(keyspaceName: string): Promise<void | void> {
|
||||
const path = `/${keyspaceName}`;
|
||||
return window.fetch(this.baseUrl + this.basePath + path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the Cassandra table under an existing Azure Cosmos DB database account. */
|
||||
async listCassandraTables(keyspaceName: string): Promise<Types.CassandraTableListResult> {
|
||||
const path = `/${keyspaceName}/tables`;
|
||||
return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB Cassandra keyspace. */
|
||||
export async function deleteCassandraKeyspace (
|
||||
subscriptionId: string,
|
||||
resourceGroupName: string,
|
||||
accountName: string,
|
||||
keyspaceName: string
|
||||
|
||||
) : Promise<void | void> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`, { method: "delete", }).then((response) => response.json())
|
||||
}
|
||||
|
||||
/* Gets the Cassandra table under an existing Azure Cosmos DB database account. */
|
||||
async getCassandraTable(keyspaceName: string, tableName: string): Promise<Types.CassandraTableGetResults> {
|
||||
const path = `/${keyspaceName}/tables/${tableName}`;
|
||||
return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB Cassandra Table */
|
||||
async createUpdateCassandraTable(
|
||||
keyspaceName: string,
|
||||
tableName: string,
|
||||
body: Types.CassandraTableCreateUpdateParameters
|
||||
): Promise<Types.CassandraTableGetResults | void> {
|
||||
const path = `/${keyspaceName}/tables/${tableName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + this.basePath + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
}
|
||||
|
||||
/* 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> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default`, { method: "get", }).then((response) => response.json())
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB Cassandra table. */
|
||||
async deleteCassandraTable(keyspaceName: string, tableName: string): Promise<void | void> {
|
||||
const path = `/${keyspaceName}/tables/${tableName}`;
|
||||
return window.fetch(this.baseUrl + this.basePath + path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. */
|
||||
async getCassandraTableThroughput(
|
||||
keyspaceName: string,
|
||||
tableName: string
|
||||
): Promise<Types.ThroughputSettingsGetResults> {
|
||||
const path = `/${keyspaceName}/tables/${tableName}/throughputSettings/default`;
|
||||
return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* 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> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default`, { method: "put", body: JSON.stringify(body) }).then((response) => response.json())
|
||||
}
|
||||
|
||||
/* Update RUs per second of an Azure Cosmos DB Cassandra table */
|
||||
async updateCassandraTableThroughput(
|
||||
keyspaceName: string,
|
||||
tableName: string,
|
||||
body: Types.ThroughputSettingsUpdateParameters
|
||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
||||
const path = `/${keyspaceName}/tables/${tableName}/throughputSettings/default`;
|
||||
return window
|
||||
.fetch(this.baseUrl + this.basePath + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. */
|
||||
async getCassandraKeyspaceThroughput(keyspaceName: string): Promise<Types.ThroughputSettingsGetResults> {
|
||||
const path = `/${keyspaceName}/throughputSettings/default`;
|
||||
return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* 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> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables`, { method: "get", }).then((response) => response.json())
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 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> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`, { method: "get", }).then((response) => response.json())
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 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> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`, { method: "put", body: JSON.stringify(body) }).then((response) => response.json())
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB Cassandra table. */
|
||||
export async function deleteCassandraTable (
|
||||
subscriptionId: string,
|
||||
resourceGroupName: string,
|
||||
accountName: string,
|
||||
keyspaceName: string,
|
||||
tableName: string
|
||||
|
||||
) : Promise<void | void> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`, { method: "delete", }).then((response) => response.json())
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 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> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default`, { method: "get", }).then((response) => response.json())
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 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> {
|
||||
return window.fetch(`https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default`, { method: "put", body: JSON.stringify(body) }).then((response) => response.json())
|
||||
}
|
||||
|
||||
/* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace */
|
||||
async updateCassandraKeyspaceThroughput(
|
||||
keyspaceName: string,
|
||||
body: Types.ThroughputSettingsUpdateParameters
|
||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
||||
const path = `/${keyspaceName}/throughputSettings/default`;
|
||||
return window
|
||||
.fetch(this.baseUrl + this.basePath + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user