Create a Security Group rule

POST /security-group/{id}/rules

Path parameters

  • id string(uuid) Required
application/json

Body Required

  • flow-direction string Required

    Network flow direction to match

    Values are ingress or egress.

  • Security Group rule description

    Maximum length is 255.

  • network string

    CIDR-formatted network allowed

  • Security Group allowed

    Additional properties are allowed.

    Hide security-group attributes Show security-group attributes object
    • name string

      Security Group name

      Minimum length is 1, maximum length is 255.

    • Whether this points to a public security group. This is only valid when in the context of a rule addition which uses a public security group as a source or destination.

      Values are private or public.

  • protocol string Required

    Network protocol

    Values are tcp, esp, icmp, udp, gre, ah, ipip, or icmpv6.

  • icmp object

    ICMP details (default: -1 (ANY))

    Additional properties are allowed.

    Hide icmp attributes Show icmp attributes object
    • code integer(int64)

      Minimum value is -1, maximum value is 254.

    • type integer(int64)

      Minimum value is -1, maximum value is 254.

  • start-port integer(int64)

    Start port of the range

    Minimum value is 1, maximum value is 65535.

  • end-port integer(int64)

    End port of the range

    Minimum value is 1, maximum value is 65535.

Responses

  • 200 application/json

    200

    Hide response attributes Show response attributes object
    • id string(uuid)

      Operation ID

    • reason string

      Operation failure reason

      Values are incorrect, unknown, unavailable, forbidden, busy, fault, partial, not-found, interrupted, unsupported, or conflict.

    • Related resource reference

      Additional properties are allowed.

      Hide reference attributes Show reference attributes object
      • id string(uuid)

        Reference ID

      • command string

        Command name

    • message string

      Operation message

    • state string

      Operation status

      Values are failure, pending, success, or timeout.

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"
}