All Products
Search
Document Center

ApsaraDB RDS:ModifyDBInstanceMetrics

Last Updated:Nov 11, 2024

Modifies the Enhanced Monitoring metrics that are displayed for an ApsaraDB RDS for PostgreSQL instance.

Operation description

Supported database engines

  • PostgreSQL

References

Note Before you call this operation, carefully read the following documentation. Make sure that you fully understand the prerequisites and impacts for calling this operation.

View the Enhanced Monitoring metrics

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:ModifyDBInstanceMetricsupdate
  • DBInstance
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceNamestringYes

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

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 cloud disks, this modification is applied to all ApsaraDB RDS for PostgreSQL instances that are equipped with cloud disks 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

The response parameters.

DBInstanceIdstring

The instance ID.

pgm-bp1s1j103lo6****
RequestIdstring

The request ID.

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 code has changedView Change Details