Skip to main content

Create your first group and route

Attach your upstream group to an HTTP group, then add a route and a domain.

Before you start​

Use the returned HTTP_LB_ID and UPSTREAM_GROUP_ID from the previous page. Use an API key with write access. This example uses HTTP on port 80 to your origin.

Use https://<your-api-host> as your API base URL. The host is shown in the Balancer portal. Examples use $BALANCER_API_KEY for an existing credential with the required access.

Create the application configuration​

  1. Create the group:
curl --fail-with-body -sS -X POST "https://<your-api-host>/http-loadbalancers/$HTTP_LB_ID/groups" \
-H "x-api-key: $BALANCER_API_KEY" \
-H "Content-Type: application/json" \
--data "{\"name\":\"first-group\",\"upstreamGroupId\":$UPSTREAM_GROUP_ID,\"backendPort\":80}"

API reference: Creates a new application group within an HTTP load balancer

Expect HTTP 200 with data.groupId. Set GROUP_ID to that returned identifier.

  1. Create a route with an explicit priority:
curl --fail-with-body -sS -X POST "https://<your-api-host>/http-loadbalancers/$HTTP_LB_ID/groups/$GROUP_ID/routes" \
-H "x-api-key: $BALANCER_API_KEY" \
-H "Content-Type: application/json" \
--data '{"name":"first-route","priority":100}'

API reference: Creates a new route for an HTTP group

Expect HTTP 200 with data.routeId. Set ROUTE_ID to that returned identifier.

  1. Add the site domain. Replace example.com with the domain clients will request:
curl --fail-with-body -sS -X POST "https://<your-api-host>/http-loadbalancers/$HTTP_LB_ID/groups/$GROUP_ID/domains" \
-H "x-api-key: $BALANCER_API_KEY" \
-H "Content-Type: application/json" \
--data '{"domain":"example.com"}'

API reference: Adds a domain to an HTTP group

Expect HTTP 200 with data.domainId.

  1. Verify the saved route:
curl --fail-with-body -sS -X GET "https://<your-api-host>/http-loadbalancers/$HTTP_LB_ID/groups/$GROUP_ID/routes" \
-H "x-api-key: $BALANCER_API_KEY"

API reference: List routes for an HTTP group

Expect HTTP 200 with the route list. Check priority 100 and the route name. Continue with DNS.

Group settingDefault
algorithmround-robin
matchPorts80+443
stickySessionsEnabledtrue
sslToBackendEnabledfalse
retry.count2
retry.allMethodsfalse

TODO(verify): Confirm the exact match-all behavior of a route created without requestExpression before sending production traffic through this example.

API reference​

Need Help?​

Contact your NetActuate account manager.