共用方式為


DatabaseAccounts interface

Interface representing a DatabaseAccounts.

Methods

beginCreateOrUpdate(string, string, DatabaseAccountCreateUpdateParameters, DatabaseAccountsCreateOrUpdateOptionalParams)

Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.

beginCreateOrUpdateAndWait(string, string, DatabaseAccountCreateUpdateParameters, DatabaseAccountsCreateOrUpdateOptionalParams)

Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.

beginDelete(string, string, DatabaseAccountsDeleteOptionalParams)

Deletes an existing Azure Cosmos DB database account.

beginDeleteAndWait(string, string, DatabaseAccountsDeleteOptionalParams)

Deletes an existing Azure Cosmos DB database account.

beginFailoverPriorityChange(string, string, FailoverPolicies, DatabaseAccountsFailoverPriorityChangeOptionalParams)

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.

beginFailoverPriorityChangeAndWait(string, string, FailoverPolicies, DatabaseAccountsFailoverPriorityChangeOptionalParams)

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.

beginOfflineRegion(string, string, RegionForOnlineOffline, DatabaseAccountsOfflineRegionOptionalParams)

Offline the specified region for the specified Azure Cosmos DB database account.

beginOfflineRegionAndWait(string, string, RegionForOnlineOffline, DatabaseAccountsOfflineRegionOptionalParams)

Offline the specified region for the specified Azure Cosmos DB database account.

beginOnlineRegion(string, string, RegionForOnlineOffline, DatabaseAccountsOnlineRegionOptionalParams)

Online the specified region for the specified Azure Cosmos DB database account.

beginOnlineRegionAndWait(string, string, RegionForOnlineOffline, DatabaseAccountsOnlineRegionOptionalParams)

Online the specified region for the specified Azure Cosmos DB database account.

beginRegenerateKey(string, string, DatabaseAccountRegenerateKeyParameters, DatabaseAccountsRegenerateKeyOptionalParams)

Regenerates an access key for the specified Azure Cosmos DB database account.

beginRegenerateKeyAndWait(string, string, DatabaseAccountRegenerateKeyParameters, DatabaseAccountsRegenerateKeyOptionalParams)

Regenerates an access key for the specified Azure Cosmos DB database account.

beginUpdate(string, string, DatabaseAccountUpdateParameters, DatabaseAccountsUpdateOptionalParams)

Updates the properties of an existing Azure Cosmos DB database account.

beginUpdateAndWait(string, string, DatabaseAccountUpdateParameters, DatabaseAccountsUpdateOptionalParams)

Updates the properties of an existing Azure Cosmos DB database account.

checkNameExists(string, DatabaseAccountsCheckNameExistsOptionalParams)

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.

get(string, string, DatabaseAccountsGetOptionalParams)

Retrieves the properties of an existing Azure Cosmos DB database account.

getReadOnlyKeys(string, string, DatabaseAccountsGetReadOnlyKeysOptionalParams)

Lists the read-only access keys for the specified Azure Cosmos DB database account.

list(DatabaseAccountsListOptionalParams)

Lists all the Azure Cosmos DB database accounts available under the subscription.

listByResourceGroup(string, DatabaseAccountsListByResourceGroupOptionalParams)

Lists all the Azure Cosmos DB database accounts available under the given resource group.

listConnectionStrings(string, string, DatabaseAccountsListConnectionStringsOptionalParams)

Lists the connection strings for the specified Azure Cosmos DB database account.

listKeys(string, string, DatabaseAccountsListKeysOptionalParams)

Lists the access keys for the specified Azure Cosmos DB database account.

listMetricDefinitions(string, string, DatabaseAccountsListMetricDefinitionsOptionalParams)

Retrieves metric definitions for the given database account.

listMetrics(string, string, string, DatabaseAccountsListMetricsOptionalParams)

Retrieves the metrics determined by the given filter for the given database account.

listReadOnlyKeys(string, string, DatabaseAccountsListReadOnlyKeysOptionalParams)

Lists the read-only access keys for the specified Azure Cosmos DB database account.

listUsages(string, string, DatabaseAccountsListUsagesOptionalParams)

Retrieves the usages (most recent data) for the given database account.

Method Details

beginCreateOrUpdate(string, string, DatabaseAccountCreateUpdateParameters, DatabaseAccountsCreateOrUpdateOptionalParams)

Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.

function beginCreateOrUpdate(resourceGroupName: string, accountName: string, createUpdateParameters: DatabaseAccountCreateUpdateParameters, options?: DatabaseAccountsCreateOrUpdateOptionalParams): Promise<SimplePollerLike<OperationState<DatabaseAccountGetResults>, DatabaseAccountGetResults>>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

createUpdateParameters
DatabaseAccountCreateUpdateParameters

The parameters to provide for the current database account.

options
DatabaseAccountsCreateOrUpdateOptionalParams

The options parameters.

Returns

Promise<@azure/core-lro.SimplePollerLike<OperationState<DatabaseAccountGetResults>, DatabaseAccountGetResults>>

beginCreateOrUpdateAndWait(string, string, DatabaseAccountCreateUpdateParameters, DatabaseAccountsCreateOrUpdateOptionalParams)

Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account.

function beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, createUpdateParameters: DatabaseAccountCreateUpdateParameters, options?: DatabaseAccountsCreateOrUpdateOptionalParams): Promise<DatabaseAccountGetResults>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

createUpdateParameters
DatabaseAccountCreateUpdateParameters

The parameters to provide for the current database account.

options
DatabaseAccountsCreateOrUpdateOptionalParams

The options parameters.

Returns

beginDelete(string, string, DatabaseAccountsDeleteOptionalParams)

Deletes an existing Azure Cosmos DB database account.

function beginDelete(resourceGroupName: string, accountName: string, options?: DatabaseAccountsDeleteOptionalParams): Promise<SimplePollerLike<OperationState<DatabaseAccountsDeleteHeaders>, DatabaseAccountsDeleteHeaders>>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

options
DatabaseAccountsDeleteOptionalParams

The options parameters.

Returns

Promise<@azure/core-lro.SimplePollerLike<OperationState<DatabaseAccountsDeleteHeaders>, DatabaseAccountsDeleteHeaders>>

beginDeleteAndWait(string, string, DatabaseAccountsDeleteOptionalParams)

Deletes an existing Azure Cosmos DB database account.

function beginDeleteAndWait(resourceGroupName: string, accountName: string, options?: DatabaseAccountsDeleteOptionalParams): Promise<DatabaseAccountsDeleteHeaders>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

options
DatabaseAccountsDeleteOptionalParams

The options parameters.

Returns

beginFailoverPriorityChange(string, string, FailoverPolicies, DatabaseAccountsFailoverPriorityChangeOptionalParams)

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.

function beginFailoverPriorityChange(resourceGroupName: string, accountName: string, failoverParameters: FailoverPolicies, options?: DatabaseAccountsFailoverPriorityChangeOptionalParams): Promise<SimplePollerLike<OperationState<DatabaseAccountsFailoverPriorityChangeHeaders>, DatabaseAccountsFailoverPriorityChangeHeaders>>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

failoverParameters
FailoverPolicies

The new failover policies for the database account.

Returns

beginFailoverPriorityChangeAndWait(string, string, FailoverPolicies, DatabaseAccountsFailoverPriorityChangeOptionalParams)

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.

function beginFailoverPriorityChangeAndWait(resourceGroupName: string, accountName: string, failoverParameters: FailoverPolicies, options?: DatabaseAccountsFailoverPriorityChangeOptionalParams): Promise<DatabaseAccountsFailoverPriorityChangeHeaders>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

failoverParameters
FailoverPolicies

The new failover policies for the database account.

Returns

beginOfflineRegion(string, string, RegionForOnlineOffline, DatabaseAccountsOfflineRegionOptionalParams)

Offline the specified region for the specified Azure Cosmos DB database account.

function beginOfflineRegion(resourceGroupName: string, accountName: string, regionParameterForOffline: RegionForOnlineOffline, options?: DatabaseAccountsOfflineRegionOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

regionParameterForOffline
RegionForOnlineOffline

Cosmos DB region to offline for the database account.

options
DatabaseAccountsOfflineRegionOptionalParams

The options parameters.

Returns

Promise<@azure/core-lro.SimplePollerLike<OperationState<void>, void>>

beginOfflineRegionAndWait(string, string, RegionForOnlineOffline, DatabaseAccountsOfflineRegionOptionalParams)

Offline the specified region for the specified Azure Cosmos DB database account.

function beginOfflineRegionAndWait(resourceGroupName: string, accountName: string, regionParameterForOffline: RegionForOnlineOffline, options?: DatabaseAccountsOfflineRegionOptionalParams): Promise<void>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

regionParameterForOffline
RegionForOnlineOffline

Cosmos DB region to offline for the database account.

options
DatabaseAccountsOfflineRegionOptionalParams

The options parameters.

Returns

Promise<void>

beginOnlineRegion(string, string, RegionForOnlineOffline, DatabaseAccountsOnlineRegionOptionalParams)

Online the specified region for the specified Azure Cosmos DB database account.

function beginOnlineRegion(resourceGroupName: string, accountName: string, regionParameterForOnline: RegionForOnlineOffline, options?: DatabaseAccountsOnlineRegionOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

regionParameterForOnline
RegionForOnlineOffline

Cosmos DB region to online for the database account.

options
DatabaseAccountsOnlineRegionOptionalParams

The options parameters.

Returns

Promise<@azure/core-lro.SimplePollerLike<OperationState<void>, void>>

beginOnlineRegionAndWait(string, string, RegionForOnlineOffline, DatabaseAccountsOnlineRegionOptionalParams)

Online the specified region for the specified Azure Cosmos DB database account.

function beginOnlineRegionAndWait(resourceGroupName: string, accountName: string, regionParameterForOnline: RegionForOnlineOffline, options?: DatabaseAccountsOnlineRegionOptionalParams): Promise<void>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

regionParameterForOnline
RegionForOnlineOffline

Cosmos DB region to online for the database account.

options
DatabaseAccountsOnlineRegionOptionalParams

The options parameters.

Returns

Promise<void>

beginRegenerateKey(string, string, DatabaseAccountRegenerateKeyParameters, DatabaseAccountsRegenerateKeyOptionalParams)

Regenerates an access key for the specified Azure Cosmos DB database account.

function beginRegenerateKey(resourceGroupName: string, accountName: string, keyToRegenerate: DatabaseAccountRegenerateKeyParameters, options?: DatabaseAccountsRegenerateKeyOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

keyToRegenerate
DatabaseAccountRegenerateKeyParameters

The name of the key to regenerate.

options
DatabaseAccountsRegenerateKeyOptionalParams

The options parameters.

Returns

Promise<@azure/core-lro.SimplePollerLike<OperationState<void>, void>>

beginRegenerateKeyAndWait(string, string, DatabaseAccountRegenerateKeyParameters, DatabaseAccountsRegenerateKeyOptionalParams)

Regenerates an access key for the specified Azure Cosmos DB database account.

function beginRegenerateKeyAndWait(resourceGroupName: string, accountName: string, keyToRegenerate: DatabaseAccountRegenerateKeyParameters, options?: DatabaseAccountsRegenerateKeyOptionalParams): Promise<void>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

keyToRegenerate
DatabaseAccountRegenerateKeyParameters

The name of the key to regenerate.

options
DatabaseAccountsRegenerateKeyOptionalParams

The options parameters.

Returns

Promise<void>

beginUpdate(string, string, DatabaseAccountUpdateParameters, DatabaseAccountsUpdateOptionalParams)

Updates the properties of an existing Azure Cosmos DB database account.

function beginUpdate(resourceGroupName: string, accountName: string, updateParameters: DatabaseAccountUpdateParameters, options?: DatabaseAccountsUpdateOptionalParams): Promise<SimplePollerLike<OperationState<DatabaseAccountGetResults>, DatabaseAccountGetResults>>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

updateParameters
DatabaseAccountUpdateParameters

The parameters to provide for the current database account.

options
DatabaseAccountsUpdateOptionalParams

The options parameters.

Returns

Promise<@azure/core-lro.SimplePollerLike<OperationState<DatabaseAccountGetResults>, DatabaseAccountGetResults>>

beginUpdateAndWait(string, string, DatabaseAccountUpdateParameters, DatabaseAccountsUpdateOptionalParams)

Updates the properties of an existing Azure Cosmos DB database account.

function beginUpdateAndWait(resourceGroupName: string, accountName: string, updateParameters: DatabaseAccountUpdateParameters, options?: DatabaseAccountsUpdateOptionalParams): Promise<DatabaseAccountGetResults>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

updateParameters
DatabaseAccountUpdateParameters

The parameters to provide for the current database account.

options
DatabaseAccountsUpdateOptionalParams

The options parameters.

Returns

checkNameExists(string, DatabaseAccountsCheckNameExistsOptionalParams)

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.

function checkNameExists(accountName: string, options?: DatabaseAccountsCheckNameExistsOptionalParams): Promise<DatabaseAccountsCheckNameExistsResponse>

Parameters

accountName

string

Cosmos DB database account name.

options
DatabaseAccountsCheckNameExistsOptionalParams

The options parameters.

Returns

get(string, string, DatabaseAccountsGetOptionalParams)

Retrieves the properties of an existing Azure Cosmos DB database account.

function get(resourceGroupName: string, accountName: string, options?: DatabaseAccountsGetOptionalParams): Promise<DatabaseAccountGetResults>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

options
DatabaseAccountsGetOptionalParams

The options parameters.

Returns

getReadOnlyKeys(string, string, DatabaseAccountsGetReadOnlyKeysOptionalParams)

Lists the read-only access keys for the specified Azure Cosmos DB database account.

function getReadOnlyKeys(resourceGroupName: string, accountName: string, options?: DatabaseAccountsGetReadOnlyKeysOptionalParams): Promise<DatabaseAccountListReadOnlyKeysResult>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

options
DatabaseAccountsGetReadOnlyKeysOptionalParams

The options parameters.

Returns

list(DatabaseAccountsListOptionalParams)

Lists all the Azure Cosmos DB database accounts available under the subscription.

function list(options?: DatabaseAccountsListOptionalParams): PagedAsyncIterableIterator<DatabaseAccountGetResults, DatabaseAccountGetResults[], PageSettings>

Parameters

options
DatabaseAccountsListOptionalParams

The options parameters.

Returns

listByResourceGroup(string, DatabaseAccountsListByResourceGroupOptionalParams)

Lists all the Azure Cosmos DB database accounts available under the given resource group.

function listByResourceGroup(resourceGroupName: string, options?: DatabaseAccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator<DatabaseAccountGetResults, DatabaseAccountGetResults[], PageSettings>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

options
DatabaseAccountsListByResourceGroupOptionalParams

The options parameters.

Returns

listConnectionStrings(string, string, DatabaseAccountsListConnectionStringsOptionalParams)

Lists the connection strings for the specified Azure Cosmos DB database account.

function listConnectionStrings(resourceGroupName: string, accountName: string, options?: DatabaseAccountsListConnectionStringsOptionalParams): Promise<DatabaseAccountListConnectionStringsResult>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

options
DatabaseAccountsListConnectionStringsOptionalParams

The options parameters.

Returns

listKeys(string, string, DatabaseAccountsListKeysOptionalParams)

Lists the access keys for the specified Azure Cosmos DB database account.

function listKeys(resourceGroupName: string, accountName: string, options?: DatabaseAccountsListKeysOptionalParams): Promise<DatabaseAccountListKeysResult>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

options
DatabaseAccountsListKeysOptionalParams

The options parameters.

Returns

listMetricDefinitions(string, string, DatabaseAccountsListMetricDefinitionsOptionalParams)

Retrieves metric definitions for the given database account.

function listMetricDefinitions(resourceGroupName: string, accountName: string, options?: DatabaseAccountsListMetricDefinitionsOptionalParams): PagedAsyncIterableIterator<MetricDefinition, MetricDefinition[], PageSettings>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

options
DatabaseAccountsListMetricDefinitionsOptionalParams

The options parameters.

Returns

listMetrics(string, string, string, DatabaseAccountsListMetricsOptionalParams)

Retrieves the metrics determined by the given filter for the given database account.

function listMetrics(resourceGroupName: string, accountName: string, filter: string, options?: DatabaseAccountsListMetricsOptionalParams): PagedAsyncIterableIterator<Metric, Metric[], PageSettings>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

filter

string

An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq.

options
DatabaseAccountsListMetricsOptionalParams

The options parameters.

Returns

listReadOnlyKeys(string, string, DatabaseAccountsListReadOnlyKeysOptionalParams)

Lists the read-only access keys for the specified Azure Cosmos DB database account.

function listReadOnlyKeys(resourceGroupName: string, accountName: string, options?: DatabaseAccountsListReadOnlyKeysOptionalParams): Promise<DatabaseAccountListReadOnlyKeysResult>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

options
DatabaseAccountsListReadOnlyKeysOptionalParams

The options parameters.

Returns

listUsages(string, string, DatabaseAccountsListUsagesOptionalParams)

Retrieves the usages (most recent data) for the given database account.

function listUsages(resourceGroupName: string, accountName: string, options?: DatabaseAccountsListUsagesOptionalParams): PagedAsyncIterableIterator<Usage, Usage[], PageSettings>

Parameters

resourceGroupName

string

The name of the resource group. The name is case insensitive.

accountName

string

Cosmos DB database account name.

options
DatabaseAccountsListUsagesOptionalParams

The options parameters.

Returns