Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
© 2022 Yandex.Cloud LLC
Yandex Virtual Private Cloud
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Cloud network
      • Creating a cloud network
      • Deleting a cloud network
      • Updating a cloud network
    • Subnet
      • Creating a subnet
      • Deleting a subnet
      • Updating a subnet
      • Viewing a list of used addresses
    • IP address
      • Reserving a static public IP address
      • Making a dynamic public IP address static
      • Making a static public IP address dynamic
      • Deleting a static public IP address
    • Static routing
      • Creating a static route
      • Enabling NAT to the internet
    • Security groups
      • Create a security group
      • Update a security group and rules
      • Delete a security group
    • Enable a software-accelerated network
    • Protection from DDoS attacks
      • Enable protection from DDoS attacks
  • Practical guidelines
    • Architecture and protection of a basic internet service
    • DHCP settings for working with a corporate DNS server
  • Concepts
    • Relationship between service resources
    • Cloud networks and subnets
    • Cloud resource addresses
    • Static routes
    • Security groups
    • Public IP address ranges
    • MTU and MSS
    • DHCP settings
    • Software-accelerated network
    • Quotas and limits
  • DDoS Protection
  • Recommendations
    • Using public IP addresses
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before January 1, 2019
  • API reference
    • Authentication in the API
    • REST
      • Overview
      • Address
        • Overview
        • create
        • delete
        • get
        • getByValue
        • list
        • listOperations
        • move
        • update
      • Gateway
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • update
      • Network
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • listRouteTables
        • listSecurityGroups
        • listSubnets
        • move
        • update
      • RouteTable
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • update
      • SecurityGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • update
        • updateRule
        • updateRules
      • Subnet
        • Overview
        • addCidrBlocks
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • removeCidrBlocks
        • update
      • Operation
        • Overview
        • get
    • gRPC
      • Overview
      • AddressService
      • GatewayService
      • NetworkService
      • RouteTableService
      • SecurityGroupService
      • SubnetService
      • OperationService
  • Questions and answers
  1. API reference
  2. REST
  3. Network
  4. listSecurityGroups

Method listSecurityGroups

Written by
Yandex Cloud
  • HTTP request
  • Path parameters
  • Query parameters
  • Response

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.

securityGroups[].
name
string
securityGroups[].
description
string
securityGroups[].
labels
object
securityGroups[].
networkId
string
securityGroups[].
status
string
  • UPDATING: updating is a long operation because we must update all instances in SG
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.

Was the article helpful?

Language / Region
© 2022 Yandex.Cloud LLC
In this article:
  • HTTP request
  • Path parameters
  • Query parameters
  • Response