The public REST API exposed by CloudBees Previews
Endpoints
Environments
POST /api/v1/namespaces/{namespace}/environments
- Operation Id
-
createEnvironment
Create Environment
GET /api/v1/namespaces/{namespace}/environments/{name}
- Operation Id
-
getEnvironment
Get an Environment
GET /api/v1/namespaces/{namespace}/environments/{name}/log
- Operation Id
-
getEnvironmentLogs
Get the logs of an Environment
GET /api/v1/environments
- Operation Id
-
listEnvironments
List Environments
Parameters
Query Parameters
Name | Description | Required | Default | Pattern |
---|---|---|---|---|
labels |
Filters Environments by labels. Values must have the form <LABEL>=<VALUE>. Multiple values can be comma-separated and are treated as conjunction. Common labels include: 'repo-host', 'repo-namespace', 'repo-name', 'pr-number', 'commit-sha', 'context'. |
- |
null |
|
check |
If specified, the HTTP response status reflects a check on the environment search result: When set to 'ready' the server responds with 429 unless there is an environment that matches the search criteria and is ready, indicating that the client should retry the request. When a matching environment fails or terminates, the server responds with 412, indicating that the client should stop polling and fail. For disambiguation, this parameter can only be used in conjunction with the 'labels' parameter. This parameter allows you to synchronize an automated task (as a CI job) with an asynchronously created/updated environment. It works particularly well with `curl --retry 20` or `wget --tries 20 --retry-on-http-error=429`. |
- |
null |
Responses
Code | Message | Datatype |
---|---|---|
200 |
Return a list of environments |
|
400 |
Bad request |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
412 |
Environment failed. This response is returned only if the check parameter was set to 'ready' in order to indicate that polling should be stopped. |
|
429 |
Environment did not match or its final state is not known yet. The request should be retried in that case. This response is returned only if the 'check' parameter was specified. This allows you to use `curl --retry` or `wget --tries` for polling until an environment is created/updated and reaches a desired state. |
Models
Environment
Represents the desired and current state of an Environment. It is the external representation of an Environment CRD.
Field Name | Required | Type | Description | Format |
---|---|---|---|---|
metadata |
X |
Metadata |
||
spec |
X |
EnvironmentSpec |
||
status |
EnvironmentStatus |
EnvironmentList
A list of Environments.
Field Name | Required | Type | Description | Format |
---|---|---|---|---|
items |
X |
List of Environment |
EnvironmentPhase
The phase the Environment is currently in.
Field Name | Required | Type | Description | Format |
---|
EnvironmentSpec
Represents the desired state of an Environment
Field Name | Required | Type | Description | Format |
---|---|---|---|---|
gitSource |
GitSource |
|||
ttl |
String |
|||
context |
X |
String |
EnvironmentStatus
Represents an Environment's current status
Field Name | Required | Type | Description | Format |
---|---|---|---|---|
phase |
X |
EnvironmentPhase |
||
error |
Error |
|||
urls |
List of EnvironmentURL |
EnvironmentURL
An ingress URL of an Environment
Field Name | Required | Type | Description | Format |
---|---|---|---|---|
url |
X |
String |
An ingress URL the enviroment exposes |