Virtual Private Cloud API, REST: Network.listSecurityGroups
Lists security groups from the specified network.
HTTP request
GET https://vpc.api.cloud.yandex.net/vpc/v1/networks/{networkId}/security_groups
Path parameters
Parameter | Description |
---|---|
networkId | Required. ID of the Network resource to list security groups for. The maximum string length in characters is 50. |
Query parameters
Parameter | Description |
---|---|
pageSize | The maximum number of results per page that should be returned. If the number of available results is larger than pageSize, the service returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Default value: 100. The maximum value is 1000. |
pageToken | Page token. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. The maximum string length in characters is 100. |
Response
HTTP Code: 200 - OK
{
"securityGroups": [
{
"id": "string",
"folderId": "string",
"createdAt": "string",
"name": "string",
"description": "string",
"labels": "object",
"networkId": "string",
"status": "string",
"rules": [
{
"id": "string",
"description": "string",
"labels": "object",
"direction": "string",
"ports": {
"fromPort": "string",
"toPort": "string"
},
"protocolName": "string",
"protocolNumber": "string",
// `securityGroups[].rules[]` includes only one of the fields `cidrBlocks`, `securityGroupId`, `predefinedTarget`
"cidrBlocks": {
"v4CidrBlocks": [
"string"
],
"v6CidrBlocks": [
"string"
]
},
"securityGroupId": "string",
"predefinedTarget": "string",
// end of the list of possible fields`securityGroups[].rules[]`
}
],
"defaultForNetwork": true
}
],
"nextPageToken": "string"
}
Field | Description |
---|---|
securityGroups[] | object List of security groups that belong to the network which is specified in the request. |
securityGroups[]. id |
string |
securityGroups[]. folderId |
string |
securityGroups[]. createdAt |
string (date-time) String in RFC3339 text format. The range of possible values is from To work with values in this field, use the APIs described in the Protocol Buffers reference. In some languages, built-in datetime utilities do not support nanosecond precision (9 digits). |
securityGroups[]. name |
string |
securityGroups[]. description |
string |
securityGroups[]. labels |
object |
securityGroups[]. networkId |
string |
securityGroups[]. status |
string
|
securityGroups[]. rules[] |
object |
securityGroups[]. rules[]. id |
string |
securityGroups[]. rules[]. description |
string |
securityGroups[]. rules[]. labels |
object |
securityGroups[]. rules[]. direction |
string Required. |
securityGroups[]. rules[]. ports |
object |
securityGroups[]. rules[]. ports. fromPort |
string (int64) Acceptable values are 0 to 65535, inclusive. |
securityGroups[]. rules[]. ports. toPort |
string (int64) Acceptable values are 0 to 65535, inclusive. |
securityGroups[]. rules[]. protocolName |
string null value means any protocol values from https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml |
securityGroups[]. rules[]. protocolNumber |
string (int64) |
securityGroups[]. rules[]. cidrBlocks |
object securityGroups[].rules[] includes only one of the fields cidrBlocks , securityGroupId , predefinedTarget |
securityGroups[]. rules[]. cidrBlocks. v4CidrBlocks[] |
string |
securityGroups[]. rules[]. cidrBlocks. v6CidrBlocks[] |
string |
securityGroups[]. rules[]. securityGroupId |
string securityGroups[].rules[] includes only one of the fields cidrBlocks , securityGroupId , predefinedTarget |
securityGroups[]. rules[]. predefinedTarget |
string securityGroups[].rules[] includes only one of the fields cidrBlocks , securityGroupId , predefinedTarget |
securityGroups[]. defaultForNetwork |
boolean (boolean) |
nextPageToken | string This token allows you to get the next page of results for list requests. If the number of results is larger than pageSize, use the nextPageToken as the value for the pageToken query parameter in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. |