Create a Security Group rule
Body Required
-
Network flow direction to match
Values are
ingress
oregress
. -
description string
Security Group rule description
Maximum length is
255
. -
network string
CIDR-formatted network allowed
-
security-group object
Security Group allowed
Additional properties are allowed.
-
Network protocol
Values are
tcp
,esp
,icmp
,udp
,gre
,ah
,ipip
, oricmpv6
. -
icmp object
ICMP details (default: -1 (ANY))
Additional properties are allowed.
-
start-port integer(int64)
Start port of the range
Minimum value is
1
, maximum value is65535
. -
end-port integer(int64)
End port of the range
Minimum value is
1
, maximum value is65535
.
POST /security-group/{id}/rules
curl \
-X POST https://api-ch-gva-2.exoscale.com/v2/security-group/{id}/rules \
-H "Content-Type: application/json" \
-d '{"flow-direction":"ingress","description":"string","network":"string","security-group":{"name":"string","visibility":"private"},"protocol":"tcp","icmp":{"code":42,"type":42},"start-port":42,"end-port":42}'
Request examples
{
"flow-direction": "ingress",
"description": "string",
"network": "string",
"security-group": {
"name": "string",
"visibility": "private"
},
"protocol": "tcp",
"icmp": {
"code": 42,
"type": 42
},
"start-port": 42,
"end-port": 42
}
Response examples (200)
{
"id": "string",
"reason": "incorrect",
"reference": {
"id": "string",
"link": "string",
"command": "string"
},
"message": "string",
"state": "failure"
}