# Get Security Group Information - DescribeSecGroup

## Overview








## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `DescribeSecGroup`.                      | **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. Please refer to [GetProjectList API](/docs/api/summary/regionlist) |**Yes**|
| **ProjectId** | string | Project ID. If not filled, it defaults to the default project. Sub-accounts must fill this in. Please refer to the [GetProjectList API](/docs/api/summary/get_project_list) |No|
| **Limit** | int | Pagination query data length. Default is 20. |No|
| **Offset** | int | Starting offset for paginated queries. Default is 0. |No|
| **VPCId** | string | VPC ID to which the Resource ID belongs |No|
| **SecGroupId.N** | string | Security Group Resource ID Array, if passed, Offset/Limit/BusinessId will be invalid. Supports array format. Type is string array. |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|
| **DataSet** | array[[*SecGroupInfo*](#secgroupinfo)] | Refer to SecGroupInfo for details. |**Yes**|

#### Data Model


#### SecGroupInfo

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **SecGroupId** | string | Security Group Resource ID |No|
| **Name** | string | Security Group Name |No|
| **VPCId** | string | VPC Resource ID |No|
| **Account** | int | User ID |No|
| **Tag** | string | Business Group |No|
| **Remark** | string | Note |No|
| **Type** | string | Security group type, enumeration values are: "user defined", security group created by custom definition; "recommend web", security group created using Web template; "recommend non web", security group created using non-Web template. |No|
| **CreateTime** | int | Creation time, formatted as Unix Timestamp, e.g., 1747030299 |No|
| **Rule** | array[[*SecGroupRuleInfo*](#secgroupruleinfo)] | List of rules in the security group, see SecGroupRuleInfo |No|

#### SecGroupRuleInfo

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RuleId** | string | Rule ID |No|
| **Direction** | string | Ingress/Egress", Inbound Rules/Outbound Rules |No|
| **IPRange** | string | Address |No|
| **Priority** | int | Priority |No|
| **ProtocolType** | string | Protocol Type |No|
| **DstPort** | string | Target Port |No|
| **RuleAction** | string | Matching Strategy |No|
| **Remark** | string | Security Group Rule Remarks |No|
| **IPVersion** | string | IP version, such as "IPv4". Deprecated after IPv6 support |No|

## Example

### Request Example
    
```
https://api.zosoc.com/?Action=DescribeSecGroup
&Region=cn-zj
&ProjectId=pFHEwWhK
&SecGroupId.n=yswMXnnq
&Offset=MtvhXVlk
&Limit=MZYPwcOZ
&VPCId=ZJqpHNUF
&BusinessId=HNhpzbsv
```

### Response Example
    
```json
{
  "Action": "DescribeSecGroupResponse",
  "DataSet": [
    "XJMgfJJa"
  ],
  "RetCode": 0
}
```





