功能介紹
查詢安全組列表。
調(diào)試
您可以在API Explorer中調(diào)試該接口。
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
|
名稱 |
是否必選 |
參數(shù)類型 |
說明 |
|---|---|---|---|
|
project_id |
是 |
String |
項(xiàng)目ID,獲取項(xiàng)目ID請(qǐng)參見獲取項(xiàng)目ID。 |
|
marker |
否 |
String |
分頁查詢的起始資源ID,表示從指定資源的下一條記錄開始查詢。 marker需要和limit配合使用:
|
|
limit |
否 |
Integer |
分頁查詢每頁返回的記錄個(gè)數(shù),取值范圍為0~intmax(2^31-1),默認(rèn)值2000。 limit需要和marker配合使用,詳細(xì)規(guī)則請(qǐng)見marker的參數(shù)說明。 |
|
vpc_id |
否 |
String |
按照vpc_id過濾查詢 |
|
enterprise_project_id |
否 |
String |
說明:
關(guān)于企業(yè)項(xiàng)目ID的獲取及企業(yè)項(xiàng)目特性的詳細(xì)信息,請(qǐng)參見《企業(yè)管理用戶指南》。 |
|
remote_address_group_id |
否 |
String |
|
請(qǐng)求參數(shù)
無
請(qǐng)求示例
GET https://{Endpoint}/v1/{project_id}/security-groups
響應(yīng)參數(shù)
|
名稱 |
參數(shù)類型 |
說明 |
|---|---|---|
|
security_groups |
|
名稱 |
參數(shù)類型 |
說明 |
|---|---|---|
|
name |
String |
安全組名稱 |
|
description |
String |
安全組描述 |
|
id |
String |
安全組唯一標(biāo)識(shí) |
|
vpc_id |
String |
安全組所在的vpc的資源標(biāo)識(shí) 說明:
該參數(shù)功能已廢棄,不建議繼續(xù)使用。 當(dāng)前該參數(shù)只作提示用,不約束安全組在此vpc下。 |
|
security_group_rules |
默認(rèn)安全組規(guī)則列表,保證安全組內(nèi)互通。 |
|
|
enterprise_project_id |
String |
說明:
關(guān)于企業(yè)項(xiàng)目ID的獲取及企業(yè)項(xiàng)目特性的詳細(xì)信息,請(qǐng)參見《企業(yè)管理用戶指南》。 |
|
名稱 |
參數(shù)類型 |
說明 |
|---|---|---|
|
id |
String |
安全組規(guī)則標(biāo)識(shí) |
|
description |
String |
|
|
security_group_id |
String |
安全組標(biāo)識(shí) |
|
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 |
|
響應(yīng)示例
{
"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"
}
]
}
]
}
狀態(tài)碼
請(qǐng)參見狀態(tài)碼。
錯(cuò)誤碼
請(qǐng)參考錯(cuò)誤碼。
