All Products
Search
Document Center

ApsaraDB RDS:ModifyDBInstanceMetrics

Last Updated:May 29, 2023

You can call the ModifyDBInstanceMetrics operation to modify the Enhanced Monitoring metrics that are displayed for an ApsaraDB RDS for PostgreSQL instance.

Operation Description

Prerequisites

Before you call this operation, make sure that the instance runs PostgreSQL.

For more information, see View the Enhanced Monitoring metrics of an ApsaraDB RDS for PostgreSQL instance.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • 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 Key: the condition key that is defined by the cloud service.
  • 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.
OperationAccess levelResource typeCondition keyAssociated operation
rds:ModifyDBInstanceMetricsWrite
  • RDS
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceNamestringYes

The ID of the instance. You can call the DescribeDBInstances operation to query the IDs of instances.

pgm-bp1s1j103lo6****
ScopestringYes

The application scope of this modification. Valid values:

  • instance: This modification is applied only to the current instance.
  • region: This modification is applied to all ApsaraDB RDS for PostgreSQL instances that are equipped with the same type of storage media as the current instance in the region to which the current instance belongs. For example, if the current instance is equipped with standard SSDs or enhanced SSDs (ESSDs), this modification is applied to all ApsaraDB RDS for PostgreSQL instances that are equipped with standard SSDs or ESSDs in the region to which the current instance belongs.
instance
MetricsConfigstringYes

The keys of the Enhanced Monitoring metrics that you want to display for the instance. You can enter a maximum of 30 metric keys. If you enter multiple metric keys, you must separate the metric keys with commas (,).

You can call the DescribeAvailableMetrics operation to query the keys of metrics.

os.cpu_usage.sys.avg,os.cpu_usage.user.avg

Response parameters

ParameterTypeDescriptionExample
object
DBInstanceIdstring

The ID of the instance.

pgm-bp1s1j103lo6****
RequestIdstring

The ID of the request.

B55934BB-FFAA-5276-80A8-E0FDB12810B3
Scopestring

The application scope of this modification. Valid values:

  • instance: This modification is applied only to the current instance.
  • region: This modification is applied to all ApsaraDB RDS for PostgreSQL instances that are equipped with the same type of storage media as the current instance in the region to which the current instance belongs.
instance

Examples

Sample success responses

JSONformat

{
  "DBInstanceId": "pgm-bp1s1j103lo6****",
  "RequestId": "B55934BB-FFAA-5276-80A8-E0FDB12810B3",
  "Scope": "instance"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidMetricsConfigThe specified metrics config is invalid.The specified metric configuration is invalid.
400InvalidScopeThe specified scope is invalidThe specified scope is invalid.
400InvalidDBInstanceEngineType.Formatthe DB instance engine type does not support this operation.This operation is not supported for the database engine of the instance.
404InvalidDBInstanceName.NotFoundThe database instance does not exist.The name of the RDS instance cannot be found. Check the name of the RDS instance.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-06-23API Description Update,The error codes of the API operation change.
Change itemChange content
API DescriptionAPI Description Update
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
    delete Error Codes: 404