Skip to main content

Service and link API

Services are the instances developers create from a service specification: a database, a bucket, a queue, or anything a platform team crafted. This section covers what happens to a service once it exists, from creating it to linking a scope to it and running actions on it. The definitions behind those services live in the Service and link specifications API.

How the endpoints nest

EntityEndpointsLives underDefined by
Service/service, /service/{id}, /service/{id}/compareThe NRN you create it at (entity_nrn)A service specification
Service action/service/{serviceId}/action, /service/{serviceId}/action/{id}A serviceThe specification's service action specifications
Link/link, /link/{id}A scope and a serviceOne of the specification's link specifications
Link action/link/{linkId}/action, /link/{linkId}/action/{id}A linkThe link specification's link action specifications

A typical flow

  1. Create the service with POST /service, sending its specification_id and the entity_nrn it belongs to. When the specification is packaged, the service binds to the package's default revision unless you send a package_revision_id.
  2. Follow its actions. Creating, updating and deleting a service run the specification's actions. GET /service/{serviceId}/action lists them with their status, and POST runs a custom action.
  3. Link a scope with POST /link, choosing one of the specification's link specifications. Links run their own actions, listed under /link/{linkId}/action.
  4. Move it to another version by patching desired_package_revision_id. The next successful action makes that revision the one the service runs.

Endpoints