lb.load-balancers.create

Create a load balancer

POST /lb/api/load-balancersIAM lb:CreateLoadBalancerChanges state

It starts with no services and no targets: add a service (listener) and at least one target before it carries traffic. Refused (400) when an organization tag policy requires tags that are missing.

Request syntax

POST /lb/api/load-balancers
{
  "name": "string",
  "type": "enum",
  "scheme": "enum",
  "algorithm": "enum",
  "regionId": "string",
  "vpcId": "string",
  "tags": "map of string",
  "webAclId": "string"
}

Request body

  • nameRequired

    string

    Name shown in the console, 1–64 characters. Not unique: two load balancers may share one. An application load balancer’s platform name is `<name>-<id8>.lb.apps.…`

    Constraints: 1-64 chars

  • typeRequired

    enum

    Required (the console's form starts on lb11). lb11/lb21/lb31: a network load balancer of that size (tcp/http/https, VPC targets). application: an HTTP/HTTPS load balancer on the shared Deutsche Cloud fleet: its own name under lb.apps, per-request access logs, live numbers, health checks every second; http on 80 and https on 443 only, public targets only. dedicated: its own address on the Deutsche Cloud fleet, tcp/http/https on any port; public (own IPv4 + IPv6) or private (scheme private + vpcId: an address in the VPC only). In an organization whose load balancers run on its own hosts, only application is accepted (409, code provider_unsupported). Fixed at creation

    One of: lb11, lb21, lb31, application, dedicated

  • schemeOptional

    enum

    dedicated type only (400 on any other type): public (default; its own IPv4 and IPv6, public targets; 400 with vpcId) or private (an address in vpcId only, no public address; targets inside that VPC; 400 without vpcId; 409 when the VPC has no address left, at most 5 private load balancers per VPC). Fixed at creation

    One of: public, private

  • algorithmOptional

    enum

    How new connections are spread over healthy targets: round_robin (default) sends each to the next target, least_connections to the least busy

    One of: round_robin, least_connections

    Default: "round_robin"

  • regionIdRequired

    string

    Region id, from `dcloud ec2 catalog regions`. Unknown: 404. Counts against the region’s load balancer quota (20 standard, 2 on a trial; over it: 409)

    Constraints: min 1 chars

  • vpcIdOptional

    string

    lb11/lb21/lb31: join this VPC, so targets can be reached by their private address (`usePrivateIp`). dedicated: required with scheme private, refused with public. application: refused (400). Not found: 404; in another region than regionId: 400. Default: no VPC

    Constraints: uuid

  • tagsOptional

    map of string

    Tags to set at creation, e.g. {"env": "prod"}: at most 50; keys lowercase, 1–64 characters; values 1–128 characters without spaces. Keys your organization marks required must be present, or the create is refused (400)

    Constraints: key=value

  • webAclIdOptional

    string

    application type only (400 on any other type): a web ACL (`dcloud waf web-acls`) every request passes before anything else answers. Needs lb:SetWebAcl, and waf:GetWebAcl on the ACL (403); an ACL not in your organization: 404. Absent or null: none

    Constraints: uuid

    May be null.

Response

201 with the new load balancer (status `provisioning`): id, name, type, algorithm, regionId, vpcId, scheme, hostname, webAclId, … ; its addresses follow once placed (follow it with `get`). 404 when the region, VPC or web ACL is not found; 409 over the quota, for a non-application type in an organization on its own hosts, or when a private one finds no address in the VPC.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow lb:CreateLoadBalancer on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud lb load-balancers create --name example --type lb11 --region-id example

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_lb_load-balancers_create.