Skip to content

Latest commit

 

History

History
124 lines (96 loc) · 2.31 KB

PublicAPI.md

File metadata and controls

124 lines (96 loc) · 2.31 KB

Public Cloudbuild API

Supported Targets

GET - /api/targets

This endpoint allows for retrieving the supported targets and build options. It returns the configured targets.json (see here).

Each release also includes what it can't build, computed from the version_supported and values_version_supported constraints (see the README):

  • exclude_targets: targets not supported by this release.
  • exclude_flags: option flag values not supported by this release, as a map from flag name to values, e.g. {"language": ["AR"]}.

Both are omitted when empty. Clients should hide these for the selected release; build requests using them are rejected.

CURL

curl -X GET "https://cloudbuild.edgetx.org/api/targets"

Build Job Requests

POST - /api/jobs

This request allows for creating build jobs. In case this build job (uniquely identified by [commit hash, target, flags]) already exists, its current status is returned. If the build job does not exist, it will be created.

CURL

cat << EOF > body.json
{
  "release": "v2.9.0",
  "target": "x9e",
  "flags": [
	{
	  "name": "sticks",
	  "value": "HORUS"
	}
  ]
}
EOF

curl -X POST -H "Content-Type: application/json" -d @body.json \
     https://cloudbuild.edgetx.org/api/jobs

Body Parameters

  • body should respect the following schema:
{
  "release": "v2.9.0",
  "target": "x9e",
  "flags": [
	{
	  "name": "sticks",
	  "value": "HORUS"
	}
  ]
}

POST - /api/status

This request allows for fetching the status of an existing build jobs. Build jobs are uniquely identified by [commit hash, target, flags].

CURL

cat << EOF > body.json
{
  "release": "v2.9.0",
  "target": "x9e",
  "flags": [
	{
	  "name": "sticks",
	  "value": "HORUS"
	}
  ]
}
EOF

curl -X POST -H "Content-Type: application/json" -d @body.json \
     https://cloudbuild.edgetx.org/api/status

Body Parameters

  • body should respect the following schema:
{
  "release": "v2.9.0",
  "target": "x9e",
  "flags": [
	{
	  "name": "sticks",
	  "value": "HORUS"
	}
  ]
}

Error Format

All requests will return a JSON formated reply on errors.

Example:

{
  "error": "option flag not supported: ppm_unit=USE"
}