Add a Load Balancer Service

POST /load-balancer/{id}/service

Path parameters

  • id string(uuid) Required
application/json

Body Required

  • name string Required

    Load Balancer Service name

    Minimum length is 1, maximum length is 255.

  • Load Balancer Service description

    Maximum length is 255.

  • instance-pool object Required

    Instance Pool to forward network traffic to

    Additional properties are allowed.

    Hide instance-pool attributes Show instance-pool attributes object
    • Instance Pool Anti-affinity Groups

      Hide anti-affinity-groups attributes Show anti-affinity-groups attributes object
      • name string

        Anti-affinity Group name

        Minimum length is 1, maximum length is 255.

      • Anti-affinity Group description

        Maximum length is 255.

    • Instance Pool description

      Minimum length is 1, maximum length is 255.

    • Instance public IP assignment

      Values are inet4, dual, or none.

    • labels object

      Resource labels

      Hide labels attribute Show labels attribute object
      • * string Additional properties
    • security-groups array[object]

      Instance Pool Security Groups

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

        Security Group name

        Minimum length is 1, maximum length is 255.

      • Security Group description

        Maximum length is 255.

      • external-sources array[string]

        Security Group external sources

      • rules array[object]

        Security Group rules

        Hide rules attributes Show rules attributes object
        • Security Group rule description

          Maximum length is 255.

        • start-port integer(int64)

          Start port of the range

          Minimum value is 1, maximum value is 65535.

        • protocol string

          Network protocol

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

        • icmp object

          ICMP details

          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.

        • end-port integer(int64)

          End port of the range

          Minimum value is 1, maximum value is 65535.

        • 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.

        • network string

          CIDR-formatted network allowed

        • Network flow direction to match

          Values are ingress or egress.

    • elastic-ips array[object]

      Instances Elastic IPs

      Hide elastic-ips attributes Show elastic-ips attributes object
      • Elastic IP description

        Maximum length is 255.

      • Elastic IP healthcheck

        Additional properties are allowed.

        Hide healthcheck attributes Show healthcheck attributes object
        • strikes-ok integer(int64)

          Number of attempts before considering the target healthy (default: 2)

          Minimum value is 1, maximum value is 20.

        • Skip TLS verification

        • tls-sni string

          An optional domain or subdomain to check TLS against

          Minimum length is 1, maximum length is 255.

        • strikes-fail integer(int64)

          Number of attempts before considering the target unhealthy (default: 3)

          Minimum value is 1, maximum value is 20.

        • mode string Required

          Health check mode

          Values are tcp, http, or https.

        • port integer(int64) Required

          Health check port

          Minimum value is 1, maximum value is 65535.

        • uri string

          An endpoint to use for the health check, for example '/status'

          Minimum length is 1, maximum length is 255.

        • interval integer(int64)

          Interval between the checks in seconds (default: 10)

          Minimum value is 5, maximum value is 300.

        • timeout integer(int64)

          Health check timeout value in seconds (default: 2)

          Minimum value is 2, maximum value is 60.

      • labels object

        Resource labels

        Hide labels attribute Show labels attribute object
        • * string Additional properties
    • name string

      Instance Pool name

      Minimum length is 1, maximum length is 255.

    • Instance Type

      Additional properties are allowed.

    • min-available integer(int64)

      Minimum number of running instances

      Minimum value is 0.

    • private-networks array[object]

      Instance Pool Private Networks

      Hide private-networks attributes Show private-networks attributes object
      • Private Network description

        Maximum length is 255.

      • labels object

        Resource labels

        Hide labels attribute Show labels attribute object
        • * string Additional properties
      • name string

        Private Network name

        Minimum length is 1, maximum length is 255.

      • start-ip string(ipv4)

        Private Network start IP address

      • vni integer(int64)

        Private Network VXLAN ID

        Minimum value is 0.

      • netmask string(ipv4)

        Private Network netmask

      • options object

        DHCP options

        Additional properties are allowed.

        Hide options attributes Show options attributes object
      • end-ip string(ipv4)

        Private Network end IP address

    • template object

      Instance Template

      Additional properties are allowed.

      Hide template attributes Show template attributes object
      • Template description

        Maximum length is 255.

      • Enable SSH key-based login

      • name string

        Template name

        Minimum length is 1, maximum length is 255.

      • Template default user

        Minimum length is 1, maximum length is 255.

      • size integer(int64)

        Template size

        Minimum value is 0.

      • Enable password-based login

      • checksum string

        Template MD5 checksum

      • Boot mode (default: legacy)

        Values are legacy or uefi.

      • zones array[string]

        Zones availability

        Values are ch-dk-2, de-muc-1, ch-gva-2, at-vie-1, de-fra-1, bg-sof-1, or at-vie-2.

      • url string

        Template source URL

    • size integer(int64)

      Number of instances

      Minimum value is 0.

    • ssh-key object

      Instance SSH Key

      Additional properties are allowed.

      Hide ssh-key attribute Show ssh-key attribute object
      • name string

        SSH key name

        Minimum length is 1, maximum length is 255.

    • The instances created by the Instance Pool will be prefixed with this value (default: pool)

      Minimum length is 1, maximum length is 30.

    • Instances Cloud-init user-data

      Minimum length is 1.

    • Instance Deploy Target

      Additional properties are allowed.

      Hide deploy-target attributes Show deploy-target attributes object
      • id string(uuid) Required

        Deploy Target ID

      • name string

        Deploy Target name

        Minimum length is 1, maximum length is 255.

      • type string

        Deploy Target type

        Values are edge or dedicated.

      • Deploy Target description

        Maximum length is 255.

    • Enable IPv6 for instances

    • disk-size integer(int64)

      Instances disk size in GiB

      Minimum value is 10, maximum value is 51200.

    • ssh-keys array[object]

      Instances SSH keys

      Hide ssh-keys attribute Show ssh-keys attribute object
      • name string

        SSH key name

        Minimum length is 1, maximum length is 255.

  • protocol string Required

    Network traffic protocol

    Values are tcp or udp.

  • strategy string Required

    Load balancing strategy

    Values are round-robin, maglev-hash, or source-hash.

  • port integer(int64) Required

    Port exposed on the Load Balancer's public IP

    Minimum value is 1, maximum value is 65535.

  • target-port integer(int64) Required

    Port on which the network traffic will be forwarded to on the receiving instance

    Minimum value is 1, maximum value is 65535.

  • healthcheck object Required

    Healthcheck configuration

    Additional properties are allowed.

    Hide healthcheck attributes Show healthcheck attributes object
    • mode string

      Healthcheck mode

      Values are tcp, http, or https.

    • interval integer(int64)

      Healthcheck interval (default: 10). Must be greater than or equal to Timeout

      Minimum value is 5, maximum value is 300.

    • uri string

      An endpoint to use for the HTTP healthcheck, e.g. '/status'

      Minimum length is 1, maximum length is 255.

    • port integer(int64)

      Healthcheck port

      Minimum value is 1, maximum value is 65535.

    • timeout integer(int64)

      Healthcheck timeout value (default: 2). Must be lower than or equal to Interval

      Minimum value is 2, maximum value is 60.

    • retries integer(int64)

      Number of retries before considering a Service failed

      Minimum value is 1, maximum value is 20.

    • tls-sni string

      SNI domain for HTTPS healthchecks

      Minimum length is 1, maximum length is 255.

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 /load-balancer/{id}/service
curl \
 -X POST https://api-ch-gva-2.exoscale.com/v2/load-balancer/{id}/service \
 -H "Content-Type: application/json" \
 -d '{"name":"string","description":"string","instance-pool":{"anti-affinity-groups":[{"name":"string","description":"string"}],"description":"string","public-ip-assignment":"inet4","labels":{"additionalProperty1":"string","additionalProperty2":"string"},"security-groups":[{"name":"string","description":"string","external-sources":["string"],"rules":[{"description":"string","start-port":42,"protocol":"tcp","icmp":{"code":42,"type":42},"end-port":42,"security-group":{"name":"string","visibility":"private"},"network":"string","flow-direction":"ingress"}]}],"elastic-ips":[{"description":"string","healthcheck":{"strikes-ok":42,"tls-skip-verify":true,"tls-sni":"string","strikes-fail":42,"mode":"tcp","port":42,"uri":"string","interval":42,"timeout":42},"labels":{"additionalProperty1":"string","additionalProperty2":"string"}}],"name":"string","instance-type":{},"min-available":42,"private-networks":[{"description":"string","labels":{"additionalProperty1":"string","additionalProperty2":"string"},"name":"string","start-ip":"string","vni":42,"netmask":"string","options":{"routers":["string"],"dns-servers":["string"],"ntp-servers":["string"],"domain-search":["string"]},"end-ip":"string"}],"template":{"description":"string","ssh-key-enabled":true,"name":"string","default-user":"string","size":42,"password-enabled":true,"checksum":"string","boot-mode":"legacy","zones":["ch-dk-2"],"url":"string"},"size":42,"ssh-key":{"name":"string"},"instance-prefix":"string","user-data":"string","deploy-target":{"id":"string","name":"string","type":"edge","description":"string"},"ipv6-enabled":true,"disk-size":42,"ssh-keys":[{"name":"string"}]},"protocol":"tcp","strategy":"round-robin","port":42,"target-port":42,"healthcheck":{"mode":"tcp","interval":42,"uri":"string","port":42,"timeout":42,"retries":42,"tls-sni":"string"}}'
Request examples
{
  "name": "string",
  "description": "string",
  "instance-pool": {
    "anti-affinity-groups": [
      {
        "name": "string",
        "description": "string"
      }
    ],
    "description": "string",
    "public-ip-assignment": "inet4",
    "labels": {
      "additionalProperty1": "string",
      "additionalProperty2": "string"
    },
    "security-groups": [
      {
        "name": "string",
        "description": "string",
        "external-sources": [
          "string"
        ],
        "rules": [
          {
            "description": "string",
            "start-port": 42,
            "protocol": "tcp",
            "icmp": {
              "code": 42,
              "type": 42
            },
            "end-port": 42,
            "security-group": {
              "name": "string",
              "visibility": "private"
            },
            "network": "string",
            "flow-direction": "ingress"
          }
        ]
      }
    ],
    "elastic-ips": [
      {
        "description": "string",
        "healthcheck": {
          "strikes-ok": 42,
          "tls-skip-verify": true,
          "tls-sni": "string",
          "strikes-fail": 42,
          "mode": "tcp",
          "port": 42,
          "uri": "string",
          "interval": 42,
          "timeout": 42
        },
        "labels": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        }
      }
    ],
    "name": "string",
    "instance-type": {},
    "min-available": 42,
    "private-networks": [
      {
        "description": "string",
        "labels": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        },
        "name": "string",
        "start-ip": "string",
        "vni": 42,
        "netmask": "string",
        "options": {
          "routers": [
            "string"
          ],
          "dns-servers": [
            "string"
          ],
          "ntp-servers": [
            "string"
          ],
          "domain-search": [
            "string"
          ]
        },
        "end-ip": "string"
      }
    ],
    "template": {
      "description": "string",
      "ssh-key-enabled": true,
      "name": "string",
      "default-user": "string",
      "size": 42,
      "password-enabled": true,
      "checksum": "string",
      "boot-mode": "legacy",
      "zones": [
        "ch-dk-2"
      ],
      "url": "string"
    },
    "size": 42,
    "ssh-key": {
      "name": "string"
    },
    "instance-prefix": "string",
    "user-data": "string",
    "deploy-target": {
      "id": "string",
      "name": "string",
      "type": "edge",
      "description": "string"
    },
    "ipv6-enabled": true,
    "disk-size": 42,
    "ssh-keys": [
      {
        "name": "string"
      }
    ]
  },
  "protocol": "tcp",
  "strategy": "round-robin",
  "port": 42,
  "target-port": 42,
  "healthcheck": {
    "mode": "tcp",
    "interval": 42,
    "uri": "string",
    "port": 42,
    "timeout": 42,
    "retries": 42,
    "tls-sni": "string"
  }
}
Response examples (200)
{
  "id": "string",
  "reason": "incorrect",
  "reference": {
    "id": "string",
    "link": "string",
    "command": "string"
  },
  "message": "string",
  "state": "failure"
}