mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-17 09:47:06 +00:00
Tweaks
This commit is contained in:
parent
8aeff8fb45
commit
6870bd9b54
@ -13,7 +13,7 @@ export async function listCassandraKeyspaces(
|
||||
accountName: string
|
||||
): Promise<Types.CassandraKeyspaceListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. */
|
||||
@ -24,7 +24,7 @@ export async function getCassandraKeyspace(
|
||||
keyspaceName: string
|
||||
): Promise<Types.CassandraKeyspaceGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB Cassandra keyspace */
|
||||
@ -36,9 +36,7 @@ export async function createUpdateCassandraKeyspace(
|
||||
body: Types.CassandraKeyspaceCreateUpdateParameters
|
||||
): Promise<Types.CassandraKeyspaceGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB Cassandra keyspace. */
|
||||
@ -49,7 +47,7 @@ export async function deleteCassandraKeyspace(
|
||||
keyspaceName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).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. */
|
||||
@ -60,7 +58,7 @@ export async function getCassandraKeyspaceThroughput(
|
||||
keyspaceName: string
|
||||
): Promise<Types.ThroughputSettingsGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace */
|
||||
@ -72,9 +70,7 @@ export async function updateCassandraKeyspaceThroughput(
|
||||
body: Types.ThroughputSettingsUpdateParameters
|
||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the Cassandra table under an existing Azure Cosmos DB database account. */
|
||||
@ -85,7 +81,7 @@ export async function listCassandraTables(
|
||||
keyspaceName: string
|
||||
): Promise<Types.CassandraTableListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the Cassandra table under an existing Azure Cosmos DB database account. */
|
||||
@ -97,7 +93,7 @@ export async function getCassandraTable(
|
||||
tableName: string
|
||||
): Promise<Types.CassandraTableGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB Cassandra Table */
|
||||
@ -110,9 +106,7 @@ export async function createUpdateCassandraTable(
|
||||
body: Types.CassandraTableCreateUpdateParameters
|
||||
): Promise<Types.CassandraTableGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB Cassandra table. */
|
||||
@ -124,7 +118,7 @@ export async function deleteCassandraTable(
|
||||
tableName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(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. */
|
||||
@ -136,7 +130,7 @@ export async function getCassandraTableThroughput(
|
||||
tableName: string
|
||||
): Promise<Types.ThroughputSettingsGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Update RUs per second of an Azure Cosmos DB Cassandra table */
|
||||
@ -149,7 +143,5 @@ export async function updateCassandraTableThroughput(
|
||||
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 window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ export async function listMetrics(
|
||||
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());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Retrieves the usages (most recent storage data) for the given collection. */
|
||||
@ -27,7 +27,7 @@ export async function listUsages(
|
||||
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());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Retrieves metric definitions for the given collection. */
|
||||
@ -39,5 +39,5 @@ export async function listMetricDefinitions(
|
||||
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());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ export async function listMetrics(
|
||||
collectionRid: string
|
||||
): Promise<Types.PartitionMetricListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/partitions/metrics`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Retrieves the usages (most recent storage data) for the given collection, split by partition. */
|
||||
@ -27,5 +27,5 @@ export async function listUsages(
|
||||
collectionRid: string
|
||||
): Promise<Types.PartitionUsagesResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/partitions/usages`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -16,5 +16,5 @@ export async function listMetrics(
|
||||
collectionRid: string
|
||||
): Promise<Types.PartitionMetricListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/region/${region}/databases/${databaseRid}/collections/${collectionRid}/partitions/metrics`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -16,5 +16,5 @@ export async function listMetrics(
|
||||
collectionRid: string
|
||||
): Promise<Types.MetricListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/region/${region}/databases/${databaseRid}/collections/${collectionRid}/metrics`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ export async function listMetrics(
|
||||
databaseRid: string
|
||||
): Promise<Types.MetricListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/metrics`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Retrieves the usages (most recent data) for the given database. */
|
||||
@ -25,7 +25,7 @@ export async function listUsages(
|
||||
databaseRid: string
|
||||
): Promise<Types.UsagesResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/usages`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Retrieves metric definitions for the given database. */
|
||||
@ -36,5 +36,5 @@ export async function listMetricDefinitions(
|
||||
databaseRid: string
|
||||
): Promise<Types.MetricDefinitionsListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/metricDefinitions`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -14,5 +14,5 @@ export async function listMetrics(
|
||||
region: string
|
||||
): Promise<Types.MetricListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/region/${region}/metrics`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export async function get(
|
||||
accountName: string
|
||||
): Promise<Types.DatabaseAccountGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Updates the properties of an existing Azure Cosmos DB database account. */
|
||||
@ -24,9 +24,7 @@ export async function update(
|
||||
body: Types.DatabaseAccountUpdateParameters
|
||||
): Promise<Types.DatabaseAccountGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "patch", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "patch", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. */
|
||||
@ -37,9 +35,7 @@ export async function createOrUpdate(
|
||||
body: Types.DatabaseAccountCreateUpdateParameters
|
||||
): Promise<Types.DatabaseAccountGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB database account. */
|
||||
@ -49,7 +45,7 @@ export async function destroy(
|
||||
accountName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. */
|
||||
@ -60,15 +56,13 @@ export async function failoverPriorityChange(
|
||||
body: Types.FailoverPolicies
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/failoverPriorityChange`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "post", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "post", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists all the Azure Cosmos DB database accounts available under the subscription. */
|
||||
export async function list(subscriptionId: string): Promise<Types.DatabaseAccountsListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists all the Azure Cosmos DB database accounts available under the given resource group. */
|
||||
@ -77,7 +71,7 @@ export async function listByResourceGroup(
|
||||
resourceGroupName: string
|
||||
): Promise<Types.DatabaseAccountsListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the access keys for the specified Azure Cosmos DB database account. */
|
||||
@ -87,7 +81,7 @@ export async function listKeys(
|
||||
accountName: string
|
||||
): Promise<Types.DatabaseAccountListKeysResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/listKeys`;
|
||||
return window.fetch(this.baseUrl + path, { method: "post" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "post" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the connection strings for the specified Azure Cosmos DB database account. */
|
||||
@ -97,7 +91,7 @@ export async function listConnectionStrings(
|
||||
accountName: string
|
||||
): Promise<Types.DatabaseAccountListConnectionStringsResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/listConnectionStrings`;
|
||||
return window.fetch(this.baseUrl + path, { method: "post" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "post" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Offline the specified region for the specified Azure Cosmos DB database account. */
|
||||
@ -108,9 +102,7 @@ export async function offlineRegion(
|
||||
body: Types.RegionForOnlineOffline
|
||||
): Promise<void | void | Types.ErrorResponse> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/offlineRegion`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "post", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "post", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Online the specified region for the specified Azure Cosmos DB database account. */
|
||||
@ -121,9 +113,7 @@ export async function onlineRegion(
|
||||
body: Types.RegionForOnlineOffline
|
||||
): Promise<void | void | Types.ErrorResponse> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/onlineRegion`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "post", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "post", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the read-only access keys for the specified Azure Cosmos DB database account. */
|
||||
@ -133,7 +123,7 @@ export async function getReadOnlyKeys(
|
||||
accountName: string
|
||||
): Promise<Types.DatabaseAccountListReadOnlyKeysResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/readonlykeys`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the read-only access keys for the specified Azure Cosmos DB database account. */
|
||||
@ -143,7 +133,7 @@ export async function listReadOnlyKeys(
|
||||
accountName: string
|
||||
): Promise<Types.DatabaseAccountListReadOnlyKeysResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/readonlykeys`;
|
||||
return window.fetch(this.baseUrl + path, { method: "post" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "post" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Regenerates an access key for the specified Azure Cosmos DB database account. */
|
||||
@ -154,15 +144,13 @@ export async function regenerateKey(
|
||||
body: Types.DatabaseAccountRegenerateKeyParameters
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/regenerateKey`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "post", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "post", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. */
|
||||
export async function checkNameExists(accountName: string): Promise<void | void> {
|
||||
const path = `/providers/Microsoft.DocumentDB/databaseAccountNames/${accountName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "head" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "head" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Retrieves the metrics determined by the given filter for the given database account. */
|
||||
@ -172,7 +160,7 @@ export async function listMetrics(
|
||||
accountName: string
|
||||
): Promise<Types.MetricListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/metrics`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Retrieves the usages (most recent data) for the given database account. */
|
||||
@ -182,7 +170,7 @@ export async function listUsages(
|
||||
accountName: string
|
||||
): Promise<Types.UsagesResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/usages`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Retrieves metric definitions for the given database account. */
|
||||
@ -192,5 +180,5 @@ export async function listMetricDefinitions(
|
||||
accountName: string
|
||||
): Promise<Types.MetricDefinitionsListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/metricDefinitions`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export async function listGremlinDatabases(
|
||||
accountName: string
|
||||
): Promise<Types.GremlinDatabaseListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. */
|
||||
@ -24,7 +24,7 @@ export async function getGremlinDatabase(
|
||||
databaseName: string
|
||||
): Promise<Types.GremlinDatabaseGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB Gremlin database */
|
||||
@ -36,9 +36,7 @@ export async function createUpdateGremlinDatabase(
|
||||
body: Types.GremlinDatabaseCreateUpdateParameters
|
||||
): Promise<Types.GremlinDatabaseGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB Gremlin database. */
|
||||
@ -49,7 +47,7 @@ export async function deleteGremlinDatabase(
|
||||
databaseName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. */
|
||||
@ -60,7 +58,7 @@ export async function getGremlinDatabaseThroughput(
|
||||
databaseName: string
|
||||
): Promise<Types.ThroughputSettingsGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/throughputSettings/default`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Update RUs per second of an Azure Cosmos DB Gremlin database */
|
||||
@ -72,9 +70,7 @@ export async function updateGremlinDatabaseThroughput(
|
||||
body: Types.ThroughputSettingsUpdateParameters
|
||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/throughputSettings/default`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the Gremlin graph under an existing Azure Cosmos DB database account. */
|
||||
@ -85,7 +81,7 @@ export async function listGremlinGraphs(
|
||||
databaseName: string
|
||||
): Promise<Types.GremlinGraphListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the Gremlin graph under an existing Azure Cosmos DB database account. */
|
||||
@ -97,7 +93,7 @@ export async function getGremlinGraph(
|
||||
graphName: string
|
||||
): Promise<Types.GremlinGraphGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB Gremlin graph */
|
||||
@ -110,9 +106,7 @@ export async function createUpdateGremlinGraph(
|
||||
body: Types.GremlinGraphCreateUpdateParameters
|
||||
): Promise<Types.GremlinGraphGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB Gremlin graph. */
|
||||
@ -124,7 +118,7 @@ export async function deleteGremlinGraph(
|
||||
graphName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. */
|
||||
@ -136,7 +130,7 @@ export async function getGremlinGraphThroughput(
|
||||
graphName: string
|
||||
): Promise<Types.ThroughputSettingsGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}/throughputSettings/default`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Update RUs per second of an Azure Cosmos DB Gremlin graph */
|
||||
@ -149,7 +143,5 @@ export async function updateGremlinGraphThroughput(
|
||||
body: Types.ThroughputSettingsUpdateParameters
|
||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}/throughputSettings/default`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export async function listMongoDBDatabases(
|
||||
accountName: string
|
||||
): Promise<Types.MongoDBDatabaseListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. */
|
||||
@ -24,7 +24,7 @@ export async function getMongoDBDatabase(
|
||||
databaseName: string
|
||||
): Promise<Types.MongoDBDatabaseGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or updates Azure Cosmos DB MongoDB database */
|
||||
@ -36,9 +36,7 @@ export async function createUpdateMongoDBDatabase(
|
||||
body: Types.MongoDBDatabaseCreateUpdateParameters
|
||||
): Promise<Types.MongoDBDatabaseGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB MongoDB database. */
|
||||
@ -49,7 +47,7 @@ export async function deleteMongoDBDatabase(
|
||||
databaseName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. */
|
||||
@ -60,7 +58,7 @@ export async function getMongoDBDatabaseThroughput(
|
||||
databaseName: string
|
||||
): Promise<Types.ThroughputSettingsGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Update RUs per second of the an Azure Cosmos DB MongoDB database */
|
||||
@ -72,9 +70,7 @@ export async function updateMongoDBDatabaseThroughput(
|
||||
body: Types.ThroughputSettingsUpdateParameters
|
||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the MongoDB collection under an existing Azure Cosmos DB database account. */
|
||||
@ -85,7 +81,7 @@ export async function listMongoDBCollections(
|
||||
databaseName: string
|
||||
): Promise<Types.MongoDBCollectionListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the MongoDB collection under an existing Azure Cosmos DB database account. */
|
||||
@ -97,7 +93,7 @@ export async function getMongoDBCollection(
|
||||
collectionName: string
|
||||
): Promise<Types.MongoDBCollectionGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB MongoDB Collection */
|
||||
@ -110,9 +106,7 @@ export async function createUpdateMongoDBCollection(
|
||||
body: Types.MongoDBCollectionCreateUpdateParameters
|
||||
): Promise<Types.MongoDBCollectionGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB MongoDB Collection. */
|
||||
@ -124,7 +118,7 @@ export async function deleteMongoDBCollection(
|
||||
collectionName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. */
|
||||
@ -136,7 +130,7 @@ export async function getMongoDBCollectionThroughput(
|
||||
collectionName: string
|
||||
): Promise<Types.ThroughputSettingsGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}/throughputSettings/default`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Update the RUs per second of an Azure Cosmos DB MongoDB collection */
|
||||
@ -149,7 +143,5 @@ export async function updateMongoDBCollectionThroughput(
|
||||
body: Types.ThroughputSettingsUpdateParameters
|
||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}/throughputSettings/default`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ import * as Types from "./types";
|
||||
/* Lists all of the available Cosmos DB Resource Provider operations. */
|
||||
export async function list(): Promise<Types.OperationListResult> {
|
||||
const path = `/providers/Microsoft.DocumentDB/operations`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -16,5 +16,5 @@ export async function listMetrics(
|
||||
partitionKeyRangeId: string
|
||||
): Promise<Types.PartitionMetricListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/partitionKeyRangeId/${partitionKeyRangeId}/metrics`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -17,5 +17,5 @@ export async function listMetrics(
|
||||
partitionKeyRangeId: string
|
||||
): Promise<Types.PartitionMetricListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/region/${region}/databases/${databaseRid}/collections/${collectionRid}/partitionKeyRangeId/${partitionKeyRangeId}/metrics`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ export async function listMetrics(
|
||||
accountName: string
|
||||
): Promise<Types.PercentileMetricListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/percentile/metrics`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -15,5 +15,5 @@ export async function listMetrics(
|
||||
targetRegion: string
|
||||
): Promise<Types.PercentileMetricListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sourceRegion/${sourceRegion}/targetRegion/${targetRegion}/percentile/metrics`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -14,5 +14,5 @@ export async function listMetrics(
|
||||
targetRegion: string
|
||||
): Promise<Types.PercentileMetricListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/targetRegion/${targetRegion}/percentile/metrics`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ export async function listByLocation(
|
||||
location: string
|
||||
): Promise<Types.RestorableDatabaseAccountsListResult | Types.ErrorResponseUpdatedFormat> {
|
||||
const path = `/subscriptions/${subscriptionId}/providers/Microsoft.DocumentDB/locations/${location}/restorableDatabaseAccounts`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists all the restorable Azure Cosmos DB database accounts available under the subscription. */
|
||||
@ -20,7 +20,7 @@ export async function list(
|
||||
subscriptionId: string
|
||||
): Promise<Types.RestorableDatabaseAccountsListResult | Types.ErrorResponseUpdatedFormat> {
|
||||
const path = `/subscriptions/${subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Retrieves the properties of an existing Azure Cosmos DB restorable database account. */
|
||||
@ -30,5 +30,5 @@ export async function getByLocation(
|
||||
instanceId: string
|
||||
): Promise<Types.RestorableDatabaseAccountGetResult | Types.ErrorResponseUpdatedFormat> {
|
||||
const path = `/subscriptions/${subscriptionId}/providers/Microsoft.DocumentDB/locations/${location}/restorableDatabaseAccounts/${instanceId}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export async function listSqlDatabases(
|
||||
accountName: string
|
||||
): Promise<Types.SqlDatabaseListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. */
|
||||
@ -24,7 +24,7 @@ export async function getSqlDatabase(
|
||||
databaseName: string
|
||||
): Promise<Types.SqlDatabaseGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB SQL database */
|
||||
@ -36,9 +36,7 @@ export async function createUpdateSqlDatabase(
|
||||
body: Types.SqlDatabaseCreateUpdateParameters
|
||||
): Promise<Types.SqlDatabaseGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB SQL database. */
|
||||
@ -49,7 +47,7 @@ export async function deleteSqlDatabase(
|
||||
databaseName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. */
|
||||
@ -60,7 +58,7 @@ export async function getSqlDatabaseThroughput(
|
||||
databaseName: string
|
||||
): Promise<Types.ThroughputSettingsGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/throughputSettings/default`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Update RUs per second of an Azure Cosmos DB SQL database */
|
||||
@ -72,9 +70,7 @@ export async function updateSqlDatabaseThroughput(
|
||||
body: Types.ThroughputSettingsUpdateParameters
|
||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/throughputSettings/default`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the SQL container under an existing Azure Cosmos DB database account. */
|
||||
@ -85,7 +81,7 @@ export async function listSqlContainers(
|
||||
databaseName: string
|
||||
): Promise<Types.SqlContainerListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the SQL container under an existing Azure Cosmos DB database account. */
|
||||
@ -97,7 +93,7 @@ export async function getSqlContainer(
|
||||
containerName: string
|
||||
): Promise<Types.SqlContainerGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB SQL container */
|
||||
@ -110,9 +106,7 @@ export async function createUpdateSqlContainer(
|
||||
body: Types.SqlContainerCreateUpdateParameters
|
||||
): Promise<Types.SqlContainerGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB SQL container. */
|
||||
@ -124,7 +118,7 @@ export async function deleteSqlContainer(
|
||||
containerName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. */
|
||||
@ -136,7 +130,7 @@ export async function getSqlContainerThroughput(
|
||||
containerName: string
|
||||
): Promise<Types.ThroughputSettingsGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/throughputSettings/default`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Update RUs per second of an Azure Cosmos DB SQL container */
|
||||
@ -149,9 +143,7 @@ export async function updateSqlContainerThroughput(
|
||||
body: Types.ThroughputSettingsUpdateParameters
|
||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/throughputSettings/default`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. */
|
||||
@ -163,7 +155,7 @@ export async function listSqlStoredProcedures(
|
||||
containerName: string
|
||||
): Promise<Types.SqlStoredProcedureListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/storedProcedures`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. */
|
||||
@ -176,7 +168,7 @@ export async function getSqlStoredProcedure(
|
||||
storedProcedureName: string
|
||||
): Promise<Types.SqlStoredProcedureGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/storedProcedures/${storedProcedureName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB SQL storedProcedure */
|
||||
@ -190,9 +182,7 @@ export async function createUpdateSqlStoredProcedure(
|
||||
body: Types.SqlStoredProcedureCreateUpdateParameters
|
||||
): Promise<Types.SqlStoredProcedureGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/storedProcedures/${storedProcedureName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB SQL storedProcedure. */
|
||||
@ -205,7 +195,7 @@ export async function deleteSqlStoredProcedure(
|
||||
storedProcedureName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/storedProcedures/${storedProcedureName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. */
|
||||
@ -217,7 +207,7 @@ export async function listSqlUserDefinedFunctions(
|
||||
containerName: string
|
||||
): Promise<Types.SqlUserDefinedFunctionListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/userDefinedFunctions`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. */
|
||||
@ -230,7 +220,7 @@ export async function getSqlUserDefinedFunction(
|
||||
userDefinedFunctionName: string
|
||||
): Promise<Types.SqlUserDefinedFunctionGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/userDefinedFunctions/${userDefinedFunctionName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB SQL userDefinedFunction */
|
||||
@ -244,9 +234,7 @@ export async function createUpdateSqlUserDefinedFunction(
|
||||
body: Types.SqlUserDefinedFunctionCreateUpdateParameters
|
||||
): Promise<Types.SqlUserDefinedFunctionGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/userDefinedFunctions/${userDefinedFunctionName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB SQL userDefinedFunction. */
|
||||
@ -259,7 +247,7 @@ export async function deleteSqlUserDefinedFunction(
|
||||
userDefinedFunctionName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/userDefinedFunctions/${userDefinedFunctionName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Lists the SQL trigger under an existing Azure Cosmos DB database account. */
|
||||
@ -271,7 +259,7 @@ export async function listSqlTriggers(
|
||||
containerName: string
|
||||
): Promise<Types.SqlTriggerListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/triggers`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the SQL trigger under an existing Azure Cosmos DB database account. */
|
||||
@ -284,7 +272,7 @@ export async function getSqlTrigger(
|
||||
triggerName: string
|
||||
): Promise<Types.SqlTriggerGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/triggers/${triggerName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB SQL trigger */
|
||||
@ -298,9 +286,7 @@ export async function createUpdateSqlTrigger(
|
||||
body: Types.SqlTriggerCreateUpdateParameters
|
||||
): Promise<Types.SqlTriggerGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/triggers/${triggerName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB SQL trigger. */
|
||||
@ -313,5 +299,5 @@ export async function deleteSqlTrigger(
|
||||
triggerName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/triggers/${triggerName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export async function listTables(
|
||||
accountName: string
|
||||
): Promise<Types.TableListResult> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the Tables under an existing Azure Cosmos DB database account with the provided name. */
|
||||
@ -24,7 +24,7 @@ export async function getTable(
|
||||
tableName: string
|
||||
): Promise<Types.TableGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Create or update an Azure Cosmos DB Table */
|
||||
@ -36,9 +36,7 @@ export async function createUpdateTable(
|
||||
body: Types.TableCreateUpdateParameters
|
||||
): Promise<Types.TableGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Deletes an existing Azure Cosmos DB Table. */
|
||||
@ -49,7 +47,7 @@ export async function deleteTable(
|
||||
tableName: string
|
||||
): Promise<void | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}`;
|
||||
return window.fetch(this.baseUrl + path, { method: "delete" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "delete" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. */
|
||||
@ -60,7 +58,7 @@ export async function getTableThroughput(
|
||||
tableName: string
|
||||
): Promise<Types.ThroughputSettingsGetResults> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default`;
|
||||
return window.fetch(this.baseUrl + path, { method: "get" }).then(response => response.json());
|
||||
return window.fetch(path, { method: "get" }).then(response => response.json());
|
||||
}
|
||||
|
||||
/* Update RUs per second of an Azure Cosmos DB Table */
|
||||
@ -72,7 +70,5 @@ export async function updateTableThroughput(
|
||||
body: Types.ThroughputSettingsUpdateParameters
|
||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default`;
|
||||
return window
|
||||
.fetch(this.baseUrl + path, { method: "put", body: JSON.stringify(body) })
|
||||
.then(response => response.json());
|
||||
return window.fetch(path, { method: "put", body: JSON.stringify(body) }).then(response => response.json());
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ async function main() {
|
||||
${bodyParam(bodyParameter, "Types")}
|
||||
) : Promise<${responseType(operation, "Types")}> {
|
||||
const path = \`${path.replace(/{/g, "${")}\`
|
||||
return window.fetch(this.baseUrl + path, { method: "${method}", ${
|
||||
return window.fetch(path, { method: "${method}", ${
|
||||
bodyParameter ? "body: JSON.stringify(body)" : ""
|
||||
} }).then((response) => response.json())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user