Virtual Private Cloud API, REST: SecurityGroup.get
Returns the specified SecurityGroup resource.
To get the list of all available SecurityGroup resources, make a list request.
HTTP request
GET https://vpc.api.cloud.yandex.net/vpc/v1/securityGroups/{securityGroupId}
Path parameters
Parameter | Description |
---|---|
securityGroupId | Required. ID of the Security Group resource to return. To get the security group ID, use a [SecurityGroup.List] request. |
Response
HTTP Code: 200 - OK
{
"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",
// `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`rules[]`
}
],
"defaultForNetwork": true
}
Field | Description |
---|---|
id | string ID of the security group. |
folderId | string ID of the folder that the security group belongs to. |
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). |
name | string Name of the security group. The name must be unique within the folder. Value must match the regular expression |
description | string Description of the security group. 0-256 characters long. |
labels | object Resource labels as |
networkId | string ID of the network that the security group belongs to. |
status | string Security group status.
|
rules[] | object List of the security group rules. |
rules[]. id |
string ID of the rule. |
rules[]. description |
string Description of the rule. 0-256 characters long. |
rules[]. labels |
object Resource labels as |
rules[]. direction |
string Required. The direction of network traffic allowed by this rule.
|
rules[]. ports |
object The range of ports that allow traffic to pass through. Null value means any. |
rules[]. ports. fromPort |
string (int64) The lowest port in the range. Acceptable values are 0 to 65535, inclusive. |
rules[]. ports. toPort |
string (int64) The highest port in the range. Acceptable values are 0 to 65535, inclusive. |
rules[]. protocolName |
string Protocol name. Null value means any protocol. Values from IANA. |
rules[]. protocolNumber |
string (int64) Protocol number from IANA protocol numbers. |
rules[]. cidrBlocks |
object CIDR blocks to allow to recieve or send traffic. rules[] includes only one of the fields cidrBlocks , securityGroupId , predefinedTarget |
rules[]. cidrBlocks. v4CidrBlocks[] |
string IPv4 CIDR blocks to allow traffic to. |
rules[]. cidrBlocks. v6CidrBlocks[] |
string IPv6 CIDR blocks to allow traffic to. |
rules[]. securityGroupId |
string rules[] includes only one of the fields cidrBlocks , securityGroupId , predefinedTarget ID of the security group to add rule to. |
rules[]. predefinedTarget |
string rules[] includes only one of the fields cidrBlocks , securityGroupId , predefinedTarget Predefined target. See security groups rules for more information. |
defaultForNetwork | boolean (boolean) Flag that indicates that the security group is the default for the network. |