tencent cloud

TencentDB for PostgreSQL

DescribeDBInstanceSecurityGroups

PDF
フォーカスモード
フォントサイズ
最終更新日: 2026-04-13 13:07:17

1. API Description

Domain name for API request: postgres.intl.tencentcloudapi.com.

This API is used to query the security group of an instance.

A maximum of 1000 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: DescribeDBInstanceSecurityGroups.
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. This API only supports: ap-bangkok, ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-jakarta, ap-nanjing, ap-seoul, ap-shanghai, ap-shanghai-fsi, ap-shenzhen-fsi, ap-singapore, ap-tokyo, eu-frankfurt, na-ashburn, na-siliconvalley, sa-saopaulo.
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 query the associated security group of the read-only group, only ReadOnlyGroupId is required.

3. Output Parameters

Parameter Name Type Description
SecurityGroupSet Array of SecurityGroup Information of security groups in array
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 Querying Instance Security Groups

Querying Instance Security Groups

Input Example

POST / HTTP/1.1
Host: postgres.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeDBInstanceSecurityGroups
<Common request parameters>

{
    "DBInstanceId": "postgres-i2q4utnp"
}

Output Example

{
    "Response": {
        "RequestId": "770234c2-8a51-4d06-b3f7-4454664848b1",
        "SecurityGroupSet": [
            {
                "CreateTime": "2022-10-20 21:38:20",
                "Inbound": [
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "Enable Ping service"
                        "IpProtocol": "icmp",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "::/0",
"Description": "Enable Ping service"
                        "IpProtocol": "icmpv6",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "Allow Linux SSH login"
                        "IpProtocol": "tcp",
                        "PortRange": "22"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "::/0",
"Description": "Allow SSH login for Linux"
                        "IpProtocol": "tcp",
                        "PortRange": "22"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "Enable Windows Remote Login"
                        "IpProtocol": "tcp",
                        "PortRange": "3389"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "::/0",
"Description": "Allow Windows Remote Login"
                        "IpProtocol": "tcp",
                        "PortRange": "3389"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "10.0.0.0/8",
"Description": "Allow internal network traffic (VPC)"
                        "IpProtocol": "ALL",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "172.16.0.0/12",
"Description": "Allow internal network traffic (VPC)"
                        "IpProtocol": "ALL",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "192.168.0.0/16",
"Description": "Allow internal network traffic (VPC)"
                        "IpProtocol": "ALL",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "Open the Web service port"
                        "IpProtocol": "tcp",
                        "PortRange": "80"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "::/0",
"Description": "Open the Web server port"
                        "IpProtocol": "tcp",
                        "PortRange": "80"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "Open the Web service port"
                        "IpProtocol": "tcp",
                        "PortRange": "443"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "::/0",
"Description": "Open the Web service port"
                        "IpProtocol": "tcp",
                        "PortRange": "443"
                    }
                ],
                "Outbound": [
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
                        "Description": "",
                        "IpProtocol": "ALL",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "",
                        "Description": "",
                        "IpProtocol": "ALL",
                        "PortRange": "ALL"
                    }
                ],
                "ProjectId": 0,
"SecurityGroupDescription": "Custom template"
                "SecurityGroupId": "sg-91jbmkp1",
"SecurityGroupName": "custom template-20221020213819279"
            }
        ]
    }
}

Example2 Querying Read-Only Group Security Group

This example shows you how to query the security group of a read-only group.

Input Example

POST / HTTP/1.1
Host: postgres.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeDBInstanceSecurityGroups
<Common request parameters>

{
    "ReadOnlyGroupId": "pgrogrp-nqwpkjb"
}

Output Example

{
    "Response": {
        "RequestId": "47e3764e-bce4-477a-a293-49ffa1bfb447",
        "SecurityGroupSet": [
            {
                "CreateTime": "2022-08-30 21:36:58",
                "Inbound": [],
                "Outbound": [],
                "ProjectId": 0,
"SecurityGroupDescription": "Custom222"
                "SecurityGroupId": "sg-116auwb1",
"SecurityGroupName": "custom222-202208302136517989"
            },
            {
                "CreateTime": "2022-10-20 21:38:20",
                "Inbound": [
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
Allow Ping service
                        "IpProtocol": "icmp",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "::/0",
"Description": "Enable Ping service"
                        "IpProtocol": "icmpv6",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "Allow Linux SSH login"
                        "IpProtocol": "tcp",
                        "PortRange": "22"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "::/0",
"Description": "Allow Linux SSH login"
                        "IpProtocol": "tcp",
                        "PortRange": "22"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "Enable Windows Remote Login"
                        "IpProtocol": "tcp",
                        "PortRange": "3389"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "::/0",
"Description": "Allow Windows Remote Login"
                        "IpProtocol": "tcp",
                        "PortRange": "3389"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "10.0.0.0/8",
"Description": "Allow internal network traffic (VPC)"
                        "IpProtocol": "ALL",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "172.16.0.0/12",
"Description": "Allow internal network traffic (VPC)"
                        "IpProtocol": "ALL",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "192.168.0.0/16",
"Description": "Allow internal network traffic (VPC)"
                        "IpProtocol": "ALL",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "Open the Web server port"
                        "IpProtocol": "tcp",
                        "PortRange": "80"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "::/0",
"Description": "Open the Web server port"
                        "IpProtocol": "tcp",
                        "PortRange": "80"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "Open the Web server port"
                        "IpProtocol": "tcp",
                        "PortRange": "443"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "::/0",
"Description": "Open the Web server port"
                        "IpProtocol": "tcp",
                        "PortRange": "443"
                    }
                ],
                "Outbound": [
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
                        "Description": "",
                        "IpProtocol": "ALL",
                        "PortRange": "ALL"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "",
                        "Description": "",
                        "IpProtocol": "ALL",
                        "PortRange": "ALL"
                    }
                ],
                "ProjectId": 0,
"SecurityGroupDescription": "Custom template"
                "SecurityGroupId": "sg-91jbmkp1",
"SecurityGroupName": "custom template-20221020213819279"
            },
            {
                "CreateTime": "2022-08-22 17:34:08",
                "Inbound": [
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "One-click enablement of inbound rule"
                        "IpProtocol": "tcp",
                        "PortRange": "22,3389,80,443,20,21"
                    },
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "One-click enablement of inbound rule"
                        "IpProtocol": "icmp",
                        "PortRange": "ALL"
                    }
                ],
                "Outbound": [
                    {
                        "Action": "ACCEPT",
                        "CidrIp": "0.0.0.0/0",
"Description": "One-click enablement of outbound rule"
                        "IpProtocol": "ALL",
                        "PortRange": "ALL"
                    }
                ],
                "ProjectId": 0,
"SecurityGroupDescription": "deny all"
                "SecurityGroupId": "sg-mpkb1net",
"SecurityGroupName": "custom-2022082217335427078"
            }
        ]
    }
}

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.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック