Lists previously created Builds for specified environment ID.
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://js.wpengineapi.com/v1/accounts/example/apps/example/environments/example/builds"
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';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 \ --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
Query Parameters
Section titled “Query Parameters”The maximum number of Build to return. The service may return fewer than this value. If unspecified, no more than 10 environments will be returned. The maximum value is 200, values above 200 will be coerced to 200.
A page token, returned from the previous ListBuilds call.
Provide this to retrieve the next page.
Default sorting order (empty string) is ascending for created_at.
The order can be ascending or descending. If we do not specify
the order, we will get the result in ascending order.
Format: “”, “column”, “column order”.
Only list builds that are newer than start_time.
Only list builds that are older than end_time.
Responses
Section titled “Responses”A successful response.
Response including listed Builds.
object
A list of Builds.
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 states 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
A token which can be sent as page_token to retrieve the next page.
Unset if there are no more pages.
Total number of builds in the entire list of Builds.
Example
{ "builds": [ { "state": "STATE_UNSPECIFIED", "trigger": "TRIGGER_UNSPECIFIED" } ]}