# Query the security group information bound to the resource - DescribeResourceSecGroup

## Overview

Query the security group information bound to the resource






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `DescribeResourceSecGroup`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.zosoc.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [Region and Availability Zone List](/docs/api/summary/regionlist) |**Yes**|
| **ProjectId** | string | Project ID. Leave blank for the default project, sub-account must fill in. Please refer to [GetProjectList API](/docs/api/summary/get_project_list) |No|
| **ResourceType** | string | Resource types, such as UHost, UNI |No|
| **Offset** | int | Offset for pagination queries. If ResourceId is provided, pagination is not applied. |No|
| **Limit** | int | Maximum number of resources returned when querying by pagination. |No|
| **VPCId** | string | VPC ID. Optional, used for pagination (can be omitted when paginating); when ResourceId is not empty, ignore. |No|
| **ResourceId.N** | string | Resource ID array, if specified, no pagination; otherwise, paginate to get the specified type of resources under the account. Supports string array format. |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **TotalCount** | int | Total number of resources. When ResourceId is passed in, it refers to the number of valid resources among the passed-in resources. |**Yes**|
| **DataSet** | array[[*ResourceSecgroupInfoEx*](#resourcesecgroupinfoex)] | Security group information bound to the resource |**Yes**|

#### Data Model


#### ResourceSecgroupInfoEx

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ResourceId** | string | Resource ID |**Yes**|
| **ResourceName** | string | Resource Name |**Yes**|
| **Count** | int | The number of security groups bound to this resource |**Yes**|
| **SecGroupInfo** | array[[*BindingSecGroupInfo*](#bindingsecgroupinfo)] | Bind Security Group Information |**Yes**|
| **PermitAssociate** | boolean | Indicates whether binding a security group is allowed |**Yes**|
| **ExInfo** | [*ResourceExInfo*](#resourceexinfo) | Security Group Binding Information |No|

#### BindingSecGroupInfo

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **SecGroupId** | string | Security Group ID |No|
| **Name** | string | Security Group Name |No|
| **VPCId** | string | Security Group's VPC |No|
| **Priority** | int | The priority of this resource bound to this security group |No|

#### ResourceExInfo

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **SuperResourceId** | string | Parent Resource ID |**Yes**|
| **ResourceName** | string | Resource Name |No|
| **IP** | array[string] | Host Internal IP |No|
| **EIP** | array[string] | Host External IP |No|
| **Uni** | array[[*ResourceSecgroupInfo*](#resourcesecgroupinfo)] | Elastic NIC Information |No|
| **SuperResourceName** | string | Parent Resource Name |No|

#### ResourceSecgroupInfo

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ResourceId** | string | Resource ID |**Yes**|
| **Count** | int | Number of Resources Bound to Security Group |**Yes**|
| **SecGroupInfo** | array[[*SecGroupSimpleInfo*](#secgroupsimpleinfo)] | See SecGroupSimpleInfo |No|

#### SecGroupSimpleInfo

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **SecGroupId** | string | Security Group Resource ID |No|
| **Name** | string | Security Group Name |No|

## Example

### Request Example
    
```
https://api.zosoc.com/?Action=DescribeResourceSecGroup
&Region=cn-zj
&Zone=cn-zj-01
&ProjectId=bKOyoPxS
&ResourceType=ECVHqgZo
&ResourceId.n=YziDaDxa
&Offset=4
&Limit=3
```

### Response Example
    
```json
{
  "Action": "DescribeResourceSecGroupResponse",
  "DataSet": [
    {
      "Count": 6,
      "ResourceId": "ljSwPBgv",
      "SecGroupInfo": [
        {
          "Name": "ohoFGMfk",
          "SecGroupId": "aVrzsMDI"
        }
      ]
    }
  ],
  "RetCode": 0,
  "TotalCount": 4
}
```





