次の方法で共有


Database Accounts - List Usages

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

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages?api-version=2024-08-15
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages?api-version=2024-08-15&$filter={$filter}

URI Parameters

Name In Required Type Description
accountName
path True

string

Cosmos DB database account name.

Regex pattern: ^[a-z0-9]+(-[a-z0-9]+)*

resourceGroupName
path True

string

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

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

$filter
query

string

An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names).

Responses

Name Type Description
200 OK

UsagesResult

The usages for the database account were retrieved successfully.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation Impersonate your user account

Examples

CosmosDBDatabaseAccountGetUsages

Sample request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/usages?api-version=2024-08-15&$filter=$filter=name.value eq 'Storage'

Sample response

{
  "value": [
    {
      "unit": "Bytes",
      "quotaPeriod": "P1D",
      "limit": 10737418240,
      "currentValue": 0,
      "name": {
        "value": "Storage",
        "localizedValue": "Storage"
      }
    }
  ]
}

Definitions

Name Description
MetricName

A metric name.

UnitType

The unit of the metric.

Usage

The usage data for a usage request.

UsagesResult

The response to a list usage request.

MetricName

A metric name.

Name Type Description
localizedValue

string

The friendly name of the metric.

value

string

The name of the metric.

UnitType

The unit of the metric.

Name Type Description
Bytes

string

BytesPerSecond

string

Count

string

CountPerSecond

string

Milliseconds

string

Percent

string

Seconds

string

Usage

The usage data for a usage request.

Name Type Description
currentValue

integer

Current value for this metric

limit

integer

Maximum value for this metric

name

MetricName

The name information for the metric.

quotaPeriod

string

The quota period used to summarize the usage values.

unit

UnitType

The unit of the metric.

UsagesResult

The response to a list usage request.

Name Type Description
value

Usage[]

The list of usages for the database. A usage is a point in time metric