Get builds for a job

get

/v1/jobs/{jobName}/builds

Returns a list of builds for a specific job

Request

Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

Returns a list of URIs with the job name and build number, such as jobs/Example/builds/344, followed by the date and time, one build per line

400 Response

ERROR: Job identified by {jobIdentifier} no longer exists

403 Response

ERROR: User forbidden access to protected job
Back to Top

Examples

Two examples are shown. Both return a list of build URLs in the format @jobs/{jobIdentifier}/builds/{buildNumber} and timestamps, one per line.

You can use {jobIdentifier} and {jobName} interchangeably. Both work the same way. Builds are returned in descending order, with the most recent build listed first.

You can use the optional zone query parameter to specify the timezone in which the times are displayed. By default, the timezone is the server timezone, usually GMT.

Note:

The timestamp shown in the VB Studio UI is the timezone that is set in the browser. It may be different than the server timezone returned by the REST API.

The first example shows how to get a list of build URLs and timestamps in GMT (the default timezone when the zone parameter query isn't used) for job MyJob1, which has a job identifier of JOBID-201, by submitting a GET request on the REST resource using curl.

curl -X GET -u alex.admin https://myinstance.oracle.com/myorg/rest/myorg_bobtest_1/cibuild/v1/jobs/MyJob1/builds
Enter host password for user 'alex.admin':
jobs/JOBID-201/builds/8 [Feb 12, 2020 10:07 PM GMT]
jobs/JOBID-201/builds/7 [Feb 04, 2020 04:05 AM GMT]
jobs/JOBID-201/builds/6 [Jan 27, 2020 10:42 PM GMT]
jobs/JOBID-201/builds/5 [Jan 27, 2020 07:21 PM GMT]
jobs/JOBID-201/builds/4 [Dec 31, 1969 11:59 PM GMT]
jobs/JOBID-201/builds/3 [Jan 21, 2020 11:05 PM GMT]
jobs/JOBID-201/builds/2 [Jan 21, 2020 10:54 PM GMT]
jobs/JOBID-201/builds/1 [Jan 21, 2020 10:52 PM GMT]

The second example shows how to get a list of build URLs and timestamps in PST (by setting the optional zone query to PST) for job MyJob1, which has a job identifier of JOBID-201, by submitting a GET request on the REST resource.

curl -X GET -u alex.admin https://myinstance.oracle.com/myorg/rest/myorg_bobtest_1/cibuild/v1/jobs/MyJob/builds?zone=PST
Enter host password for user 'alex.admin':
jobs/JOBID-201/builds/8 [Feb 12, 2020 02:07 PM PST]
jobs/JOBID-201/builds/7 [Feb 03, 2020 08:05 PM PST]
jobs/JOBID-201/builds/6 [Jan 27, 2020 02:42 PM PST]
jobs/JOBID-201/builds/5 [Jan 27, 2020 11:21 AM PST]
jobs/JOBID-201/builds/4 [Dec 31, 1969 03:59 PM PST]
jobs/JOBID-201/builds/3 [Jan 21, 2020 03:05 PM PST]
jobs/JOBID-201/builds/2 [Jan 21, 2020 02:54 PM PST]
jobs/JOBID-201/builds/1 [Jan 21, 2020 02:52 PM PST]

A {jobIdentifier} is accepted in place of {jobName}.

Errors

If you searched by {jobIdentifier} and the job can't be found, you'll see this error:

ERROR: Job identified by {jobIdentifier} no longer exists

If you searched by {jobName} and the job can't be found, you'll see this error:

ERROR: Job {jobName} no longer exists

If the job is protected and you are not authorized to view it, you'll see this error:

ERROR: Not authorized
Back to Top