Skip to content

Capabilities API

Saloni Shah edited this page Jul 12, 2024 · 2 revisions

Overview

CBAS provides a /capabilities API so consumers of the API can programmatically determine if the CBAS instance they are querying supports any given feature. This assists with incremental rollout of features and incremental upgrade of pre-existing CBAS apps.

For example, Terra UI can query CBAS' Capabilities API and look for a key submission.limits.maxWorkflows. If the Capabilities API returns a value associated with this key then Terra UI can accordingly query and display data records from WDS in Submission Config page in Terra on Azure. If the key is not found, Terra UI can keep using the default limit which has been 100 until now.

Response Structure

The structure of the Capabilities API response is:

  • a flat list of key-value pairs where keys are strings and values are of primitive types
  • keys use dot notation to group related keys into a namespace, e.g. submission.limits
  • keys use hyphen-separation to delimit words within a single term, e.g. new-feature-namespace.feature-name
  • for new features added after introduction of capabilities API: values are true if the feature is enabled, false otherwise

Developers

As a developer of CBAS, please consider:

  • when choosing a name for a capability key, use namespaces to allow for future expansion and detail
  • the API response payload is driven by capabilities.json (TODO: add link after PR merges). Ensure your changes result in valid JSON
  • don't forget to modify tests in TestPublicApiController.java (TODO: add link after PR merges)
Clone this wiki locally