All Products
Search
Document Center

ApsaraDB for MongoDB:DescribeDBInstancePerformance

Last Updated:Jan 17, 2023

Queries the performance metric data of an ApsaraDB for MongoDB instance.

Authorization information

The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All resources is used in the Resource type column of the operation.
  • Condition keyword: refers to the condition keyword defined by the cloud product itself.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operate access level Resource type conditional keyword Association operation
dds:DescribeDBInstancePerformance READ
  • MongoDB
    acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • dds:ResourceTag
without

Request parameters

Parameter Type Required Description Example
DBInstanceId string Yes

The ID of the instance.

Note If you set this parameter to the ID of a sharded cluster instance, you must also specify the NodeId parameter.
dds-bp2635****
NodeId string No

The ID of the mongos or shard node in a sharded cluster instance. You can specify this parameter to view the performance data of a single node.

Note This parameter is valid only when DBInstanceId is set to the ID of a sharded cluster instance.
d-bp2287****
Key string Yes

A performance metric. For more information about the valid values, see Performance metrics.

Note If you specify multiple metrics, separate them with commas (,).
CpuUsage
StartTime string Yes

The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

2022-06-13T10:58Z
EndTime string Yes

The end of the time range to query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. The end time must be later than the start time.

2022-06-13T11:58Z
RoleId string No

The role ID of the node in a standalone or replica set instance. You can call the DescribeReplicaSetRole operation to query the role ID of the node.

Note This parameter is valid only when you specify the DBInstanceId parameter to the ID of a standalone instance or a replica set instance.
6025****
ReplicaSetRole string No

The role of the node in a standalone or replica set instance.

  • Primary
  • Secondary
Note
  • This parameter is valid only when you specify the DBInstanceId parameter to the ID of a standalone instance or a replica set instance.
  • If you set the DBInstanceId parameter to the ID of a standalone instance, the value of this parameter can only be Primary.
  • Primary

    Response parameters

    Parameter Type Description Example
    object
    PerformanceKeys array

    Details about the performance metrics.

    object
    Key string

    The performance metric.

    CpuUsage
    Unit string

    The unit of the performance metric.

    %
    ValueFormat string

    The format of the performance metric value. If the performance metric contains multiple fields, the fields are separated with & symbols.

    For example, if you query disk usage, the returned ValueFormat value is in the ins_size&data_size&log_size format.

    cpu_usage
    PerformanceValues array

    Details about the performance metric values.

    object
    Value string

    The value of the performance metric.

    0.23
    Date string

    The date and time when the metric value was generated.

    2022-06-13T10:58:00Z
    EndTime string

    The end of the time range to query. The time is in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC.

    2022-06-13T11:58Z
    RequestId string

    The ID of the request.

    4A300BC7-6D8F-527F-A2DB-A7768D26E9AC
    StartTime string

    The beginning of the time range to query. The time is in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC.

    2022-06-13T10:58Z

    Example

    Normal return example

    JSONFormat

    {
      "PerformanceKeys": {
        "PerformanceKey": [
          {
            "Key": "CpuUsage",
            "Unit": "%",
            "ValueFormat": "cpu_usage",
            "PerformanceValues": {
              "PerformanceValue": [
                {
                  "Value": "0.23",
                  "Date": "2022-06-13T10:58:00Z"
                }
              ]
            }
          }
        ]
      },
      "EndTime": "2022-06-13T11:58Z",
      "RequestId": "4A300BC7-6D8F-527F-A2DB-A7768D26E9AC",
      "StartTime": "2022-06-13T10:58Z"
    }

    Error codes

    Http code Error code Error message
    400 InvalidPerformanceKey.Malformed The specified parameter Key is not valid.
    400 InvalidStartTime.Malformed The specified parameter StartTime is not valid.
    400 InvalidEndTime.Malformed The specified parameter EndTime is not valid.
    400 InvalidStartTimeAndEndTime.Malformed The end time must be greater than the start time

    For a list of error codes, visit the API error center.