Domain name for API request: postgres.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 | No | String | Common Params. This parameter is not required for this API. |
SecurityGroupIdSet.N | Yes | Array of String | The list of security groups to be associated with the instance or RO groups. Information of security groups can be obtained from the sgld field in the returned value of the DescribeSecurityGroups API. |
DBInstanceId | No | String | Instance ID. Either this parameter or ReadOnlyGroupId must be passed in. If both parameters are passed in, ReadOnlyGroupId will be ignored. |
ReadOnlyGroupId | No | String | RO group ID. Either this parameter or DBInstanceId must be passed in. To modify the security groups associated with the RO groups, only pass in ReadOnlyGroupId . |
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.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.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. |
本页内容是否解决了您的问题?