For the complete documentation index, see llms.txt. This page is also available as Markdown.

DescribeSecurityGroups

1. 接口描述

本接口(DescribeSecurityGroups)用于查询账户下的安全组信息,支持按安全组 ID 或名称进行筛选,支持分页查询。

2. 请求参数

以下请求参数列表仅列出了接口中需要的请求参数

参数名称
必选
类型
描述

securityGroupIds

Array of String

根据安全组ID列表筛选。

securityGroupName

String

根据安全组名称筛选。

支持模糊搜索。

pageSize

Integer

返回的分页大小。

默认值:20

pageNum

Integer

返回的分页数。

默认值:1

3. 响应结果

参数名称
类型
描述

requestId

String

唯一请求 ID。

每次请求都会返回。定位问题时需要提供该次请求的 requestId。

totalCount

Integer

符合条件的数据总数。

dataSet

安全组的结果数据。

4. 代码示例

1. 查询安全组列表。

POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeSecurityGroups
<Common Request Params>

Request:
{
  "securityGroupIds": [],
  "securityGroupName": "",
  "pageSize": 5,
  "pageNum": 1
}

Response:
{
  "requestId": "T4237F94B-6A3B-4BD6-A9D5-398F4A049714",
  "response": {
      "requestId": "T4237F94B-6A3B-4BD6-A9D5-398F4A049714",
      "totalCount": 1,
      "dataSet": [
          {
              "securityGroupId": "<securityGroupId>",
              "securityGroupName": "Default-Security-Group",
              "isDefault": true,
              "nicIdList": ["xxx"],
              "createTime": "2024-08-14T02:31:57Z",
              "scope": "Global",
              "natIdList": ["xxx"],
              "vpcIds": ["xxx"],
              "loadBalancerIdList": ["xxx"],
              "haVipIdList": ["havip-xxxxxxxx"]
          }
      ]
  }
}

5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的开发工具集(SDK),未来会陆续支持更多开发语言,方便快速接入和使用Zenlayer的产品和服务。

6. 错误码

下面包含业务逻辑中遇到的错误码,其他错误码见公共错误码

HTTP状态码

错误码

说明

最后更新于