功能介绍
查询安全组列表。
调试
您可以在API Explorer中调试该接口。
URI
GET /v1/{project_id}/security-groups
GET https://{Endpoint}/v1/{project_id}/security-groups?
limit=10&marker=4779ab1c-7c1a-44b1-a02e-93dfc361b32d&vpc_id=3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85
名称 |
是否必选 |
参数类型 |
说明 |
---|---|---|---|
project_id |
是 |
String |
项目ID,获取项目ID请参见获取项目ID。 |
marker |
否 |
String |
分页查询的起始资源ID,表示从指定资源的下一条记录开始查询。 marker需要和limit配合使用:
|
limit |
否 |
Integer |
分页查询每页返回的记录个数,取值范围为0~intmax(2^31-1),默认值2000。 limit需要和marker配合使用,详细规则请见marker的参数说明。 |
vpc_id |
否 |
String |
按照vpc_id过滤查询 |
enterprise_project_id |
否 |
String |
说明:
关于企业项目ID的获取及企业项目特性的详细信息,请参见《企业管理用户指南》。 |
remote_address_group_id |
否 |
String |
|
请求参数
无
请求示例
GET https://{Endpoint}/v1/{project_id}/security-groups
响应参数
名称 |
参数类型 |
说明 |
---|---|---|
name |
String |
安全组名称 |
description |
String |
安全组描述 |
id |
String |
安全组唯一标识 |
vpc_id |
String |
安全组所在的vpc的资源标识 说明:
该参数功能已废弃,不建议继续使用。 当前该参数只作提示用,不约束安全组在此vpc下。 |
security_group_rules |
默认安全组规则列表,保证安全组内互通。 |
|
enterprise_project_id |
String |
说明:
关于企业项目ID的获取及企业项目特性的详细信息,请参见《企业管理用户指南》。 |
名称 |
参数类型 |
说明 |
---|---|---|
id |
String |
安全组规则标识 |
description |
String |
|
security_group_id |
String |
安全组标识 |
direction |
String |
|
ethertype |
String |
|
protocol |
String |
|
port_range_min |
Integer |
|
port_range_max |
Integer |
|
remote_ip_prefix |
String |
|
remote_group_id |
String |
|
remote_address_group_id |
String |
|
tenant_id |
String |
|
响应示例
{
"security_groups": [
{
"id": "16b6e77a-08fa-42c7-aa8b-106c048884e6",
"name": "qq",
"description": "qq",
"vpc_id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85",
"enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2",
"security_group_rules": [
{
"direction": "egress",
"ethertype": "IPv4",
"id": "369e6499-b2cb-4126-972a-97e589692c62",
"description": "",
"security_group_id": "16b6e77a-08fa-42c7-aa8b-106c048884e6",
"remote_address_group_id": null
},
{
"direction": "ingress",
"ethertype": "IPv4",
"id": "0222556c-6556-40ad-8aac-9fd5d3c06171",
"description": "",
"remote_group_id": "16b6e77a-08fa-42c7-aa8b-106c048884e6",
"security_group_id": "16b6e77a-08fa-42c7-aa8b-106c048884e6"
}
]
},
{
"id": "9c0f56be-a9ac-438c-8c57-fce62de19419",
"name": "default",
"description": "qq",
"vpc_id": "13551d6b-755d-4757-b956-536f674975c0",
"enterprise_project_id": "0",
"security_group_rules": [
{
"direction": "egress",
"ethertype": "IPv4",
"id": "95479e0a-e312-4844-b53d-a5e4541b783f",
"description": "",
"security_group_id": "9c0f56be-a9ac-438c-8c57-fce62de19419"
},
{
"direction": "ingress",
"ethertype": "IPv4",
"id": "0c4a2336-b036-4fa2-bc3c-1a291ed4c431",
"description": "",
"remote_group_id": "9c0f56be-a9ac-438c-8c57-fce62de19419",
"security_group_id": "9c0f56be-a9ac-438c-8c57-fce62de19419"
}
]
}
]
}
状态码
请参见状态码。
错误码
请参考错误码。