次の方法で共有


Database Accounts - List Metric Definitions

Retrieves metric definitions for the given database account.

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

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.

Responses

Name Type Description
200 OK

MetricDefinitionsListResult

The metric definitions 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

CosmosDBDatabaseAccountGetMetricDefinitions

Sample request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/metricDefinitions?api-version=2024-08-15

Sample response

{
  "value": [
    {
      "metricAvailabilities": [
        {
          "timeGrain": "PT5M",
          "retention": "P2D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P60D"
        }
      ],
      "primaryAggregationType": "Total",
      "unit": "Count",
      "resourceUri": "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1",
      "name": {
        "value": "Total Requests",
        "localizedValue": "Total Requests"
      }
    }
  ]
}

Definitions

Name Description
MetricAvailability

The availability of the metric.

MetricDefinition

The definition of a metric.

MetricDefinitionsListResult

The response to a list metric definitions request.

MetricName

A metric name.

PrimaryAggregationType

The primary aggregation type of the metric.

UnitType

The unit of the metric.

MetricAvailability

The availability of the metric.

Name Type Description
retention

string

The retention for the metric values.

timeGrain

string

The time grain to be used to summarize the metric values.

MetricDefinition

The definition of a metric.

Name Type Description
metricAvailabilities

MetricAvailability[]

The list of metric availabilities for the account.

name

MetricName

The name information for the metric.

primaryAggregationType

PrimaryAggregationType

The primary aggregation type of the metric.

resourceUri

string

The resource uri of the database.

unit

UnitType

The unit of the metric.

MetricDefinitionsListResult

The response to a list metric definitions request.

Name Type Description
value

MetricDefinition[]

The list of metric definitions for the account.

MetricName

A metric name.

Name Type Description
localizedValue

string

The friendly name of the metric.

value

string

The name of the metric.

PrimaryAggregationType

The primary aggregation type of the metric.

Name Type Description
Average

string

Last

string

Maximum

string

Minimum

string

None

string

Total

string

UnitType

The unit of the metric.

Name Type Description
Bytes

string

BytesPerSecond

string

Count

string

CountPerSecond

string

Milliseconds

string

Percent

string

Seconds

string