tencent cloud

TencentDB for PostgreSQL

ModifyDBInstanceSecurityGroups

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 2026-05-22 14:48:25

1. API Description

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.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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.

3. Output Parameters

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.

4. Example

Example1 Modifying a security group

This example shows you how to modify a security group.

Input Example

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"
    ]
}

Output Example

{
    "Response": {
        "RequestId": "5fad142d-9597-408f-84b8-41a27a1486ce"
    }
}

Example2 Modifying the security groups of an RO group

This example shows you how to modify the security groups of an RO group.

Input Example

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"
    ]
}

Output Example

{
    "Response": {
        "RequestId": "f81495e4-bca8-4946-b5b0-0aedc512413d"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

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.

Ajuda e Suporte

Esta página foi útil?

comentários