Skip to main content

AttachProjectGatewayProject

POST 

/admin/v1/project-gateways/:id/projects

Attach a project to a project gateway (idempotent). Establishes a gateway<->project binding in the many-to-many project_gateway_projects relationship.

A project gateway may host only ONE project: attaching a second, different project is rejected (detach the current project first). Re-attaching the same project is a no-op.

Ensure the attached project has assigned models BEFORE setting the gateway's URL: under strict isolation a gateway with no assigned models serves an EMPTY route map and will return 404 for every request. The response carries any such warnings in the warnings field.

Multi-gateway projects (fraser#5987): a project may be attached to multiple gateways, capped per project (PROJECT_GATEWAY_CAP, default 10 on Enterprise; 1 on SaaS) — attaching beyond the cap is rejected with RESOURCE_EXHAUSTED (the cap is a quota, not a name collision; ALREADY_EXISTS stays reserved for hostname/slug uniqueness conflicts). The cap is a SOFT limit: the check is not atomic with the insert, so two concurrent attaches can both pass it and overshoot the cap by one. Attaching a gateway whose slug is shared with another live gateway is rejected with FAILED_PRECONDITION (rename or delete the sibling first). A successful attach starts the membership in the syncing state; see ListProjectGatewayMembers for the state machine.

Request

Responses

Success