Environment Variables
This chapter focuses on environment variables.
Get all environment variables
A GET
to /environment-variables
returns all environment variables.
HTTP request
GET /api/rest/latest/environment-variables?page=0&size=20 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
number of the page to retrieve (optional) |
|
size of the page to retrieve (optional) |
|
which attributes of the returned entities should be sorted on (optional) |
|
which fields of the elements should be returned (optional) |
|
which type of the element should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 864
{
"_embedded" : {
"environment-variables" : [ {
"_type" : "environment-variable",
"id" : 1,
"name" : "Vivaldi",
"options" : [ ],
"input_type" : "PLAIN_TEXT",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/environment-variables/1"
}
}
}, {
"_type" : "environment-variable",
"id" : 2,
"name" : "Brave",
"options" : [ ],
"input_type" : "PLAIN_TEXT",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/environment-variables/2"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/environment-variables?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the list of elements for that page |
|
|
the page size for that query |
|
|
total number of elements |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |
Get environment variable
A GET
to /environment-variables/{id}
returns the environment variable with the given ID.
Path parameters
Parameter | Description |
---|---|
|
the id of the environment-variable |
HTTP request
GET /api/rest/latest/environment-variables/3 HTTP/1.1
Accept: application/json
Host: localhost:8080
Request parameters
Parameter | Description |
---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 239
{
"_type" : "environment-variable",
"id" : 3,
"name" : "Edge",
"options" : [ ],
"input_type" : "PLAIN_TEXT",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/environment-variables/3"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the id of the entity |
|
|
the type of the entity |
|
|
name of the environment-variable |
|
|
the type of environment-variable |
|
|
all the options of the environment-variable |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this environment-variable |
Create environment variable
A POST
to /environment-variables
creates a new environment variable.
HTTP request
POST /api/rest/latest/environment-variables HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 221
Host: localhost:8080
{
"_type" : "environment_variable",
"name" : "create_ev_browser",
"input_type" : "DROPDOWN_LIST",
"options" : [ {
"label" : "Chrome",
"position" : 0
}, {
"label" : "Opera",
"position" : 1
} ]
}
Request fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
the type of the environment variable: DROPDOWN_LIST, PLAIN_TEXT, INTERPRETED_TEXT |
|
|
the name of the environment variable |
|
|
an array of environment variable options (for DROPDOWN_LIST) |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 353
{
"_type" : "environment-variable",
"id" : 4,
"name" : "create_ev_browser",
"options" : [ {
"label" : "Chrome",
"position" : 0
}, {
"label" : "Opera",
"position" : 1
} ],
"input_type" : "DROPDOWN_LIST",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/environment-variables/4"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
id of the entity |
|
|
the type of the environment variable: DROPDOWN_LIST, PLAIN_TEXT, INTERPRETED_TEXT |
|
|
the name of the environment variable |
|
|
the array of environment variable options (for DROPDOWN_LIST) |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this environment-variable |
Delete environment variable
A DELETE
to /environment-variables/{ids}
deletes the environment variable(s) with the given id(s).
HTTP request
DELETE /api/rest/latest/environment-variables/2,3 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
a list id of the environment-variables to delete |
HTTP response
HTTP/1.1 204 No Content
Modify environment variable name
A PATCH
to /environment-variables/{id}
modifies the name of the environment variable with the given id.
HTTP request
PATCH /api/rest/latest/environment-variables/5 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 32
Host: localhost:8080
{
"name" : "updated_browser"
}
Path parameters
Parameter | Description |
---|---|
|
the id of the environment variable |
Request fields
Path | Type | Description |
---|---|---|
|
|
the updated name of the environment variable |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 303
{
"_type" : "environment-variable",
"id" : 5,
"name" : "updated_browser",
"options" : [ {
"label" : "Firefox",
"position" : 0
} ],
"input_type" : "DROPDOWN_LIST",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/environment-variables/5"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
id of the entity |
|
|
the type of the environment variable: DROPDOWN_LIST, PLAIN_TEXT, INTERPRETED_TEXT |
|
|
the name of the environment variable |
|
|
an array of environment variable options |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this environment-variables |
Create environment variable option
A POST
to /environment-variables/{id}/options
adds option to the environment variable with the given id .
HTTP request
POST /api/rest/latest/environment-variables/7/options HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 23
Host: localhost:8080
{
"label" : "Opera"
}
Path parameters
Parameter | Description |
---|---|
|
the id of the environment-variable |
Request fields
Path | Type | Description |
---|---|---|
|
|
the label of the environment variable option |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 393
{
"_type" : "environment-variable",
"id" : 7,
"name" : "browser",
"options" : [ {
"label" : "Chrome",
"position" : 1
}, {
"label" : "Safari",
"position" : 2
}, {
"label" : "Opera",
"position" : 3
} ],
"input_type" : "DROPDOWN_LIST",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/environment-variables/7"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
the id of the environment variable |
|
|
the input type of the environment variable |
|
|
the name of the environment variable |
|
|
the environment variable’s options |
|
|
related links |
Links
Relation | Description |
---|---|
|
link to this environment variable |
Modify environment variable option
A PATCH
to /environment-variables/{id}/options/{optionLabel}
modifies the option with given original label.
HTTP request
PATCH /api/rest/latest/environment-variables/6/options/Firefox HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 44
Host: localhost:8080
{
"label" : "Safari",
"position" : "0"
}
Path parameters
Parameter | Description |
---|---|
|
the id of the environment variable to update |
|
the label of the environment variable option to update |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 296
{
"_type" : "environment-variable",
"id" : 6,
"name" : "evBrowser",
"options" : [ {
"label" : "Safari",
"position" : 0
} ],
"input_type" : "DROPDOWN_LIST",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/environment-variables/6"
}
}
}
Response fields
Path | Type | Description |
---|---|---|
|
|
the type of the entity |
|
|
id of the entity |
|
|
the type of the environment variable: DROPDOWN_LIST, PLAIN_TEXT, INTERPRETED_TEXT |
|
|
the name of the environment variable |
|
|
an array of environment variable options |
|
|
related links |
|
|
the name of the option |
|
|
the position of the option in the dropdown list of the environment variable |
Links
Relation | Description |
---|---|
|
link to this environment variable |
HTTP request
DELETE /api/rest/latest/environment-variables/2,3 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
a list id of the environment-variables to delete |
HTTP response
HTTP/1.1 204 No Content
Delete environment variable option
A DELETE
to /environment-variables/{id}/options/{optionsLabel}
deletes the environment variable option(s) with the given id and the given options label.
HTTP request
DELETE /api/rest/latest/environment-variables/2/options/opt2 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Path parameters
Parameter | Description |
---|---|
|
id of the entity |
|
a list of the environment variable options to delete |
HTTP response
HTTP/1.1 204 No Content