Virtual Private Cloud API, REST: SecurityGroup.list
Retrieves the list of SecurityGroup resources in the specified folder.
HTTP request
GET https://vpc.api.cloud.yandex.net/vpc/v1/securityGroups
Query parameters
Parameter | Description |
---|---|
folderId | Required. ID of the folder to list security groups in. To get the folder ID, use a list request. |
pageSize | The maximum number of results per page to return. 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. |
pageToken | Page token. To get the next page of results, set pageToken to the nextPageToken returned by a previous list request. |
filter | A filter expression that filters resources listed in the response. The expression must specify:
|
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 SecurityGroup resources. |
securityGroups[]. id |
string ID of the security group. |
securityGroups[]. folderId |
string ID of the folder that the security group belongs to. |
securityGroups[]. createdAt |
string (date-time) Creation timestamp in RFC3339 text format. 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 Name of the security group. The name must be unique within the folder. Value must match the regular expression |
securityGroups[]. description |
string Description of the security group. 0-256 characters long. |
securityGroups[]. labels |
object Resource labels as |
securityGroups[]. networkId |
string ID of the network that the security group belongs to. |
securityGroups[]. status |
string Security group status.
|
securityGroups[]. rules[] |
object List of the security group rules. |
securityGroups[]. rules[]. id |
string ID of the rule. |
securityGroups[]. rules[]. description |
string Description of the rule. 0-256 characters long. |
securityGroups[]. rules[]. labels |
object Resource labels as |
securityGroups[]. rules[]. direction |
string Required. The direction of network traffic allowed by this rule.
|
securityGroups[]. rules[]. ports |
object The range of ports that allow traffic to pass through. Null value means any. |
securityGroups[]. rules[]. ports. fromPort |
string (int64) The lowest port in the range. Acceptable values are 0 to 65535, inclusive. |
securityGroups[]. rules[]. ports. toPort |
string (int64) The highest port in the range. Acceptable values are 0 to 65535, inclusive. |
securityGroups[]. rules[]. protocolName |
string Protocol name. Null value means any protocol. Values from IANA. |
securityGroups[]. rules[]. protocolNumber |
string (int64) Protocol number from IANA protocol numbers. |
securityGroups[]. rules[]. cidrBlocks |
object CIDR blocks to allow to recieve or send traffic. securityGroups[].rules[] includes only one of the fields cidrBlocks , securityGroupId , predefinedTarget |
securityGroups[]. rules[]. cidrBlocks. v4CidrBlocks[] |
string IPv4 CIDR blocks to allow traffic to. |
securityGroups[]. rules[]. cidrBlocks. v6CidrBlocks[] |
string IPv6 CIDR blocks to allow traffic to. |
securityGroups[]. rules[]. securityGroupId |
string securityGroups[].rules[] includes only one of the fields cidrBlocks , securityGroupId , predefinedTarget ID of the security group to add rule to. |
securityGroups[]. rules[]. predefinedTarget |
string securityGroups[].rules[] includes only one of the fields cidrBlocks , securityGroupId , predefinedTarget Predefined target. See security groups rules for more information. |
securityGroups[]. defaultForNetwork |
boolean (boolean) Flag that indicates that the security group is the default for the network. |
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. |