Skip to main content

collection_partition

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

Overview

Namecollection_partition
TypeResource
Idazure.cosmosdb.collection_partition

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
nameobjectThe name information for the metric.
endTimestring (date-time)The end time for the metric (ISO-8601 format).
metricValuesarrayThe metric values for the specified time window and timestep.
partitionIdstringThe partition id (GUID identifier) of the metric values.
partitionKeyRangeIdstringThe partition key range id (integer identifier) of the metric values.
startTimestring (date-time)The start time for the metric (ISO-8601 format).
timeGrainstringThe time grain to be used to summarize the metric values.
unitstringThe unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", "CountPerSecond", "BytesPerSecond", and "Milliseconds". (Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond, Milliseconds)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_metricsselectresource_group_name, account_name, database_rid, collection_rid, subscription_id, $filterRetrieves the metrics determined by the given filter for the given collection, split by partition.
list_usagesselectresource_group_name, account_name, database_rid, collection_rid, subscription_id$filterRetrieves the usages (most recent storage data) for the given collection, split by partition.

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
$filterstringAn 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. Required.
account_namestringCosmos DB database account name. Required.
collection_ridstringCosmos DB collection rid. Required.
database_ridstringCosmos DB database rid. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
$filterstringAn 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). Default value is None.

SELECT examples

Retrieves the metrics determined by the given filter for the given collection, split by partition.

SELECT
name,
endTime,
metricValues,
partitionId,
partitionKeyRangeId,
startTime,
timeGrain,
unit
FROM azure.cosmosdb.collection_partition
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND database_rid = '{{ database_rid }}' -- required
AND collection_rid = '{{ collection_rid }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}' -- required
;