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 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. 1-63 characters long. |
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. |