api
VerifiedEnrichment0.3.2Use when: When the system offers an API and you need its contract: the resources, endpoints, schemas, errors and how each is secured.
An API as a contract: resources and endpoints, the schemas they accept and return, the errors they raise and how each is secured. Rules refuse an endpoint with no response, no error cases or no stated security.
Add it
Open it in trumly cloud to start a project with this pack already in. In an existing project, open the editor's Packs tab, choose api, then Add. Nodes you change after adding are kept when the pack is upgraded.
From a known source. Reviewed by us, and the publisher is known.
Explore is a read-only demo in your browser: nothing to sign in to, and nothing is saved.
- Namespace
api--- Size
- 33 nodes
- Needs
- core@^1.0.0
- Works with
- links@^1.0.0, dns@^0.4.0
- Enriches
- interface
- Publisher
- trumly
- Versions
0.3.2·0.3.1·0.3.0·0.2.0- Checksum
919b3678b5687911…
Examples 1
- The ops API as a contractA starting point
One resource, an endpoint that returns a schema and says how it fails and how it is secured, and an event, all attached to the ops API interface.
Show the 32 nodes
- Jobs listed
acceptance-criterionacceptance-criterion-jobs-listed - Ops staff
actoractor-ops-staff - Job volume stays modest
assumptionassumption-job-volume - Bearer token
api-authauth-bearer - View job status
capabilitycapability-view-job-status - Ops API
componentcomponent-ops-api - Job
conceptconcept-job - Vertical scaling
consequenceconsequence-one-engine - Data stays in UK/EU
constraintconstraint-uk-eu-data - Short titles
conventionconvention-short-titles - Ops db
datastoredatastore-ops-db - Managed document store
decision-optiondecision-option-document-store - Managed PostgreSQL
decision-optiondecision-option-managed-postgres - Database choice
decisiondecision-use-postgres - Production
environmentenvironment-production - List jobs
api-endpointep-list-jobs - Bad request
api-errorerr-bad-request - Job changed
api-eventevt-job-changed - Timely ops visibility
goalgoal-timely-visibility - Live job status
incrementincrement-live-status - Ops API
interfaceinterface-ops-api - Job status age
metricmetric-status-freshness - Ops API
overviewoverview - Prefer managed services
principleprinciple-prefer-managed - List jobs
requirementrequirement-list-jobs - Job
api-resourceres-job - Job volume growth
riskrisk-job-volume-growth - Job
api-schemaschema-job - Job list
api-schemaschema-job-list - Dev
teamteam-dev - Platform
teamteam-platform - Build status API
work-packagework-package-build-status-api
- Jobs listed
Planes 2
- Surface
- Contract
Types 6
- api-authHow a caller proves who they are.
- api-endpointOne operation a caller can make.
- api-errorA way a call can fail, and what the caller sees.
- api-eventA message the API publishes when something happens.
- api-resourceA thing the API lets callers work with.
- api-schemaThe shape of a request, response or message body.
Link types 7
- accepts
api-endpoint → api-schemaThe endpoint takes this body. - fails-with
api-endpoint → api-errorThe endpoint can fail this way. - operates-on
api-endpoint → api-resourceThe endpoint works on this resource. - payload
api-event → api-schemaThe event carries this body. - returns
api-endpoint → api-schemaThe endpoint answers with this body. - secured-by
api-endpoint, api-event → api-authCallers must satisfy this to use the endpoint. - served-by
api-endpoint → anyThe component that implements this endpoint.
Calculated values 2
- operation
{method} {path}The method and path of an endpoint, such as GET /jobs. - url
https://{served-by/runs-in/^serves/title}{path}The full address of an endpoint, one for each hostname that serves it.
Rules 16
- ErrorEvery auth names its scheme
- WarningA built endpoint is served by something
- WarningA PATCH endpoint accepts a schema
- WarningA POST endpoint accepts a schema
- WarningA PUT endpoint accepts a schema
- WarningEvery endpoint documents its error cases
- ErrorEvery endpoint states its method and path
- ErrorEvery endpoint says whether it is public
- WarningEvery endpoint operates on a resource
- WarningEvery endpoint returns a schema
- ErrorA non-public endpoint is secured
- WarningEvery endpoint satisfies a requirement
- ErrorEvery error states its status code
- ErrorEvery event carries a schema
- WarningEvery event says how consumers are authorised
- InfoEvery schema is used by an endpoint or event