Domain name for API request: postgres.intl.tencentcloudapi.com.
This API is used to modify the security group of an instance.
A maximum of 100 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: ModifyDBInstanceSecurityGroups. |
| Version | Yes | String | Common Params. The value used for this API: 2017-03-12. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| SecurityGroupIdSet.N | Yes | Array of String | Specifies the security group list to bind to the instance or read-only group. Security group information can be queried by calling the sgId field in the return value of DescribeSecurityGroups. Note: This input parameter performs a full replacement on all existing collections but not an incremental update. To modify it, import the expected full collections. |
| DBInstanceId | No | String | Instance ID. obtain through the api DescribeDBInstances. specify either DBInstanceId or ReadOnlyGroupId. if both are provided, ReadOnlyGroupId is ignored. |
| ReadOnlyGroupId | No | String | ReadOnlyGroupId. specifies the read-only group ID, which can be obtained through the api DescribeReadOnlyGroups. valid values: DBInstanceId and ReadOnlyGroupId (at least one is required). if you need to modify the associated security group of the read-only group, only ReadOnlyGroupId is required. |
| Parameter Name | Type | Description |
|---|---|---|
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you how to modify a security group.
POST / HTTP/1.1
Host: postgres.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyDBInstanceSecurityGroups
<Common request parameters>
{
"DBInstanceId": "postgres-i2q4utnp",
"SecurityGroupIdSet": [
"sg-91jbmkp1"
]
}
{
"Response": {
"RequestId": "5fad142d-9597-408f-84b8-41a27a1486ce"
}
}
This example shows you how to modify the security groups of an RO group.
POST / HTTP/1.1
Host: postgres.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyDBInstanceSecurityGroups
<Common request parameters>
{
"ReadOnlyGroupId": "pgrogrp-nqwpkjb",
"SecurityGroupIdSet": [
"sg-91jbmkp1"
]
}
{
"Response": {
"RequestId": "f81495e4-bca8-4946-b5b0-0aedc512413d"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| FailedOperation.FailedOperationError | Operation failed. Please try again later. |
| FailedOperation.ROGroupNotFoundError | The RO group does not exist. |
| InvalidParameter.ParameterCheckError | Failed to check the parameter. |
| OperationDenied.CamDeniedError | This operation cannot be performed. |
| OperationDenied.InstanceAccessDeniedError | You do not have the permission to operate this resource. |
| OperationDenied.InstanceStatusLimitOpError | This operation cannot be performed on an instance in this status. |
| OperationDenied.ROGroupStatusError | This operation cannot be performed on an RO group in this status. |
| ResourceNotFound.InstanceNotFoundError | The instance does not exist. |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback