Authentication
All API requests require authentication using thex-buildbuddy-api-key header:
GetInvocation
Retrieves invocations associated with a commit SHA or invocation ID.Endpoint
Request
The selector defining which invocation(s) to retrieve
Return only the invocation with this invocation ID
Return only invocations with this commit SHA
If true, includes additional build metadata
If true, include artifacts attached to the invocation
If true, include child invocations (if this invocation was a workflow)
The next_page_token value returned from a previous request
Response
Invocations matching the request, possibly capped by a server limit
Token to retrieve the next page of results, or empty if there are no more results
Example
GetLog
Retrieves build logs associated with an invocation ID.Endpoint
Request
The selector defining which log(s) to retrieve
Return only logs associated with this invocation ID
The next_page_token value returned from a previous request
Response
Token to retrieve the next page of the log, or empty if there are no more logs
Example
GetTarget
Retrieves targets associated with a given invocation ID.Endpoint
Request
The selector defining which target(s) to retrieve
All targets returned will be scoped to this invocation
If set, only the target with this target ID will be returned
If set, only targets with this tag will be returned
If set, only the target with this target label will be returned
The next_page_token value returned from a previous request
Response
Targets matching the request invocation, possibly capped by a server limit
The label of the target (e.g.,
//server/test:foo)The aggregate status of the target
The type of the target rule (e.g.,
go_library, java_binary)The language of the target rule (e.g.,
go, java, sh)Token to retrieve the next page of results
Example
GetAction
Retrieves actions associated with a given target or invocation.Endpoint
Request
The selector defining which action(s) to retrieve
All actions returned will be scoped to this invocation
If set, all actions returned will be scoped to this target
If set, all actions returned will be scoped to this configuration
If set, only the action with this action ID will be returned
If set, only the action with this target label will be returned
The next_page_token value returned from a previous request
Response
Actions matching the request, possibly capped by a server limit
The resource ID components that identify the action
A list of file references for action level files
The label of the target that generated this action
The test shard this action represents (only for test actions)
The test run this action represents (only for test actions)
The test attempt this action represents (only for test actions)
Token to retrieve the next page of results
Example
GetFile
Retrieves files associated with a given URI.Endpoint
Request
File URI corresponding to the
uri field in the File messageIf the BuildBuddy instance supports ZSTD transcoding, the literal string /blobs/ in the URI (third-to-last path segment) may be replaced with /compressed-blobs/zstd/, and the server will return a compressed payload.Examples:- Uncompressed blob with remote instance name of “ci”:
bytestream://remote.buildbuddy.io/ci/blobs/09e6fe6e1fd8c8734339a0a84c3c7a0eb121b57a45d21cfeb1f265bffe4c4888/216 - zstd-compressed blob with no remote instance name:
bytestream://remote.buildbuddy.io/compressed-blobs/zstd/09e6fe6e1fd8c8734339a0a84c3c7a0eb121b57a45d21cfeb1f265bffe4c4888/216
Response
The file data
Example
DeleteFile
Deletes a specific cache entry associated with a URI. This can be used to address cache poisoning.Endpoint
Request
URI of file to deleteCAS URI format:
<instance_name>/<blobs|compressed-blobs/zstd>/<digest_hash>/<digest_size>Action cache URI format:
<instance_name>/<blobs|compressed-blobs/zstd>/ac/<digest_hash>/<digest_size>Examples:- CAS artifact:
compressed-blobs/zstd/aaaa.../2084 - CAS artifact with remote_instance_name:
my_instance/blobs/aaaa.../2084 - Action cache artifact:
blobs/ac/aaaa.../2084 - Action cache artifact with remote_instance_name:
my_instance/blobs/ac/aaaa.../2084
Response
Empty response on success.Example
ExecuteWorkflow
Triggers a BuildBuddy Workflow for the given repository and branch/commit.GitHub App authentication is required. The API does not support running legacy workflows. See the Workflows setup guide for more information.
Endpoint
Request
URL of the repo the workflow is running for (e.g.,
https://github.com/some-user/acme)Git branch at which the workflow should be run. At least one of
branch or commit_sha must be setGit commit SHA at which the workflow should be run. At least one of
branch or commit_sha must be setNames of the workflow actions to execute. Correspond to actions in buildbuddy.yaml. If not set, will execute all actions in the workflow config
VISIBILITY build metadata used for the workflow invocation. Can be set to “PUBLIC” to make the workflow invocation public
If true, start the workflow but do not wait for the status to be returned
Environment variables to apply to each action. These overrides take precedence over env vars in buildbuddy.yaml
If true, disable automatic retry of transient errors (for non-idempotent workloads)
Response
A list of the actions executed by the API, or actions started if async is true
The name of the action from buildbuddy.yaml
The BuildBuddy invocation ID from executing the action
The gRPC status from executing the action, or from starting the action if async is true
Example
Run
Runs a command on a remote runner hosted on a remote executor.Endpoint
Request
URL of the repo the remote workspace should be initialized for (e.g.,
https://github.com/some-user/acme). If not provided, commands will run in an empty directoryGit branch to configure the remote git workspace. At least one of
branch or commit_sha must be set when repo is providedGit commit SHA to configure the remote git workspace. At least one of
branch or commit_sha must be set when repo is providedLocal patches that should be applied to the repo before running the command. Patches will be applied using
git apply in the root directory. In JSON requests, specify as a list of base64-encoded stringsBash commands to run, in order. If a step fails, subsequent steps are not runExample:
[{"run": "bazel build :server"}, {"run": "echo 'Hello World'"}]Environment variables to set in the runner env
Platform properties to apply to the runner (e.g.,
{"OSFamily":"linux", "Arch":"amd64"})Remote headers to be applied to the execution request. Can be used to set platform properties containing secretsExample:
["x-buildbuddy-platform.env-overrides=SECRET_NAME=SECRET_VALUE"]Max time before run should be canceled (e.g., ”15s”, “2h”)
Specifies what to wait until before returning a RunResponse. Options:
QUEUED, STARTED, COMPLETEDWhether to use GitHub credentials configured on the executor. Only supported for bare runners
Whether to skip the automatic GitHub setup steps on the remote runner
Response
The invocation ID of the remote run
Example
CreateUserApiKey
Creates an API key (authentication token) for a given user.Endpoint
Request
BuildBuddy user ID of the user to create the API key forExample:
US1234567890Optional display name for the API key. This is not required to be uniqueExample:
My API keyOptional duration after which the API key should expire. If unset, the API key does not expireExample:
720h (30 days), 8760h (1 year)Response
The API key that was created