Skip to main content

database_metric_definitions

Creates, updates, deletes, gets or lists a database_metric_definitions resource.

Overview

Namedatabase_metric_definitions
TypeResource
Idazure.cosmos_db.database_metric_definitions

Fields

The following fields are returned by SELECT queries:

The metric definitions for the database were retrieved successfully.

NameDatatypeDescription
nameobjectThe name information for the metric.
metricAvailabilitiesarrayThe list of metric availabilities for the account.
primaryAggregationTypestringThe primary aggregation type of the metric.
resourceUristringThe resource uri of the database.
unitstringThe unit of the metric.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectsubscriptionId, resourceGroupName, accountName, databaseRidRetrieves metric definitions for the given database.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
accountNamestringCosmos DB database account name.
databaseRidstringCosmos DB database rid.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstringThe ID of the target subscription.

SELECT examples

Retrieves metric definitions for the given database.

SELECT
name,
metricAvailabilities,
primaryAggregationType,
resourceUri,
unit
FROM azure.cosmos_db.database_metric_definitions
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND accountName = '{{ accountName }}' -- required
AND databaseRid = '{{ databaseRid }}' -- required
;