Returns information about a Build.
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://js.wpengineapi.com/v1/accounts/example/apps/example/environments/example/builds/example"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <credentials>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://js.wpengineapi.com/v1/accounts/example/apps/example/environments/example/builds/example';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://js.wpengineapi.com/v1/accounts/example/apps/example/environments/example/builds/example \ --header 'Authorization: Basic <credentials>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Name of your WP Engine Headless Platform account
Name of your Headless Platform application
ID of your environment
ID of your build
Responses
Section titled “Responses”A successful response.
Build represents a single build for a given Environment.
Unlike other resources, it is mostly designed to be read by consumers instead of directly being manipulated, hence so many OUTPUT_ONLY annotations. See https://google.aip.dev/203 for more information about documenting field behavior.
object
Output only. Name of the branch from which the build was created.
The exact commit sha being built. At most 40 characters.
Output only. Time at which the Build was scheduled.
Output only. Time at which execution of the build was finished. Not set if the Build is still running.
object
A list of shell variables available in the App’s container which was used with build.
Environment variable represents a value available in the environment’s container under the specific key.
object
Environment variable value.
Output only. Time at which execution of the build was started.
Possible states for a Build.
- STATE_UNSPECIFIED: State of the build is unknown or not applicable.
- PENDING: The Build is pending, no work has yet begun.
- RUNNING: The build is in progress (started and not yet finished).
- SUCCEEDED: The Build finished successfully.
Note: this does not necessarily mean that all BuildTasks comprising this Build succeeded (for example, some tasks may have been optional.)
Note: this does not necessarily mean that this Build is currently deployed. For example, it may have been deployed at some point in the past, and since been superseded by another Build.
- FAILED: The Build has failed.
- CANCELLING: The build is being cancelled
- CANCELLED: The build was cancelled
- QUEUED: The Build is queued.
- TIMEOUT: Build timeout
Possible triggers for a Build.
- TRIGGER_UNSPECIFIED: Trigger of the build is unknown or not applicable.
- REBUILD: The Build was triggered by invoking server rebuild method.
- COMMIT: The build was triggered by commit in GitHub.
- WEBHOOK: The build was triggered by webhook system.
- INITIAL: deprecated, use FIRST_BUILD instead
- FIRST_BUILD: The first created build
Example
{ "state": "STATE_UNSPECIFIED", "trigger": "TRIGGER_UNSPECIFIED"}