Virtual Private Cloud API, gRPC: NetworkService.ListSecurityGroups
Lists security groups from the specified network.
gRPC request
rpc ListSecurityGroups (ListNetworkSecurityGroupsRequest) returns (ListNetworkSecurityGroupsResponse)
ListNetworkSecurityGroupsRequest
{
"networkId": "string",
"pageSize": "int64",
"pageToken": "string"
}
Field |
Description |
networkId |
string Required field. ID of the Network resource to list security groups for. |
pageSize |
int64 The maximum number of results per page that should be returned. If the number of available |
pageToken |
string Page token. Set |
ListNetworkSecurityGroupsResponse
{
"securityGroups": [
{
"id": "string",
"folderId": "string",
"createdAt": "google.protobuf.Timestamp",
"name": "string",
"description": "string",
"labels": "string",
"networkId": "string",
"status": "Status",
"rules": [
{
"id": "string",
"description": "string",
"labels": "string",
"direction": "Direction",
"ports": {
"fromPort": "int64",
"toPort": "int64"
},
"protocolName": "string",
"protocolNumber": "int64",
// 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
}
],
"defaultForNetwork": "bool"
}
],
"nextPageToken": "string"
}
Field |
Description |
securityGroups[] |
List of security groups that belong to the network which is specified in the request. |
nextPageToken |
string This token allows you to get the next page of results for list requests. If the number of results |
SecurityGroup
Field |
Description |
id |
string ID of the security group. |
folderId |
string ID of the folder that the security group belongs to. |
createdAt |
Creation timestamp in RFC3339 |
name |
string Name of the security group. |
description |
string Description of the security group. 0-256 characters long. |
labels |
string Resource labels as |
networkId |
string ID of the network that the security group belongs to. |
status |
enum Status Security group status.
|
rules[] |
List of the security group rules. |
defaultForNetwork |
bool Flag that indicates that the security group is the default for the network. |
SecurityGroupRule
Field |
Description |
id |
string ID of the rule. |
description |
string Description of the rule. 0-256 characters long. |
labels |
string Resource labels as |
direction |
enum Direction Required field. The direction of network traffic allowed by this rule.
|
ports |
The range of ports that allow traffic to pass through. Null value means any. |
protocolName |
string Protocol name. Null value means any protocol. |
protocolNumber |
int64 Protocol number from IANA protocol numbers |
cidrBlocks |
CIDR blocks to allow to recieve or send traffic. Includes only one of the fields |
securityGroupId |
string ID of the security group to add rule to. Includes only one of the fields |
predefinedTarget |
string Predefined target. See security groups rules for more information. Includes only one of the fields |
PortRange
Field |
Description |
fromPort |
int64 The lowest port in the range. |
toPort |
int64 The highest port in the range. |
CidrBlocks
Field |
Description |
v4CidrBlocks[] |
string IPv4 CIDR blocks to allow traffic to. |
v6CidrBlocks[] |
string IPv6 CIDR blocks to allow traffic to. |