An environment represents the infrastructure that is the deployment target for a given phase of the delivery lifecycle. Environments in CloudBees Feature Management represent your deployment pipeline: production, staging, or testing, for example. CloudBees Feature Management supports working with multiple environments.
The default environment is production
.
You can define additional environments using this schema or using the Environments page.
Get Environments
Returns all environments under specific a application.
https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments
var request = require("request");
var options = {
method: 'GET',
url: 'https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments',
headers: {
accept: 'application/json',
authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
curl --request GET \
--url https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments \
--header 'accept: application/json' \
--header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
response = http.request(request)
puts response.read_body
import requests
url = "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments"
headers = {
'accept': "application/json",
'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments")
.get()
.addHeader("accept", "application/json")
.addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
.build();
Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments");
var request = new RestRequest(Method.GET);
request.AddHeader("accept", "application/json");
request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Environment Response
Example:
[
{
"name":"Production",
"key":"1a23bcd4e5fg6h7890i123j4",
"description":"Production Environment (default)"
}
]
Response schema type: array of objects
-
String name - Name of environment
-
String key - The environment key to be used when initializing the SDK
-
String description - Description of the environment
Create Environment
Add a new Environment
https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments
var request = require("request");
var options = {
method: 'PUT',
url: 'https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments',
headers: {
'content-type': 'application/json',
authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
},
body: {name: 'AcmeEnvironment', description: 'Acme Corp development environment'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
curl --request PUT \
--url https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments \
--header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' \
--header 'content-type: application/json' \
--data '{"name":"AcmeEnvironment","description":"Acme Corp development environment"}'
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
request.body = "{\"name\":\"AcmeEnvironment\",\"description\":\"Acme Corp development environment\"}"
response = http.request(request)
puts response.read_body
import requests
url = "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments"
payload = "{\"name\":\"AcmeEnvironment\",\"description\":\"Acme Corp development environment\"}"
headers = {
'content-type': "application/json",
'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"
}
response = requests.request("PUT", url, data=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"AcmeEnvironment\",\"description\":\"Acme Corp development environment\"}");
Request request = new Request.Builder()
.url("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments")
.put(body)
.addHeader("content-type", "application/json")
.addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
.build();
Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments");
var request = new RestRequest(Method.PUT);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6");
request.AddParameter("application/json", "{\"name\":\"AcmeEnvironment\",\"description\":\"Acme Corp development environment\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments"
payload := strings.NewReader("{\"name\":\"AcmeEnvironment\",\"description\":\"Acme Corp development environment\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Create Environment - With env key in response
Add a new Environment, returning the environment key
https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/key
var request = require("request");
var options = {
method: 'PUT',
url: 'https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/key',
headers: {
'content-type': 'application/json',
authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
},
body: {name: 'AcmeEnvironment', description: 'Acme Corp development environment'},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
curl --request PUT \
--url https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/key \
--header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' \
--header 'content-type: application/json' \
--data '{"name":"AcmeEnvironment","description":"Acme Corp development environment"}'
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
request.body = "{\"name\":\"AcmeEnvironment\",\"description\":\"Acme Corp development environment\"}"
response = http.request(request)
puts response.read_body
import requests
url = "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/key"
payload = "{\"name\":\"AcmeEnvironment\",\"description\":\"Acme Corp development environment\"}"
headers = {
'content-type': "application/json",
'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"
}
response = requests.request("PUT", url, data=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"AcmeEnvironment\",\"description\":\"Acme Corp development environment\"}");
Request request = new Request.Builder()
.url("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/key")
.put(body)
.addHeader("content-type", "application/json")
.addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
.build();
Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/key");
var request = new RestRequest(Method.PUT);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6");
request.AddParameter("application/json", "{\"name\":\"AcmeEnvironment\",\"description\":\"Acme Corp development environment\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/key"
payload := strings.NewReader("{\"name\":\"AcmeEnvironment\",\"description\":\"Acme Corp development environment\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Patch Environment
Patch an environment
https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/environmentName
var request = require("request");
var options = {
method: 'PATCH',
url: 'https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment',
headers: {
'content-type': 'application/json',
authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
},
body: [{op: 'replace', path: '/description', value: 'for qa'}],
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
curl --request PATCH \
--url https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment \
--header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6' \
--header 'content-type: application/json' \
--data '[{"op":"replace","path":"/description","value":"for qa"}]'
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
request.body = "[{\"replace\":\"add\",\"path\":\"/description\",\"value\":\"for qa\"}]"
response = http.request(request)
puts response.read_body
import requests
url = "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment"
payload = "[{\"op\":\"replace\",\"path\":\"/description\",\"value\":\"for qa\"}]"
headers = {
'content-type': "application/json",
'authorization': "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6"
}
response = requests.request("PATCH", url, data=payload, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "[{\"op\":\"replace\",\"path\":\"/description\",\"value\":\"for qa\"}]");
Request request = new Request.Builder()
.url("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment")
.patch(body)
.addHeader("content-type", "application/json")
.addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
.build();
Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment");
var request = new RestRequest(Method.PATCH);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6");
request.AddParameter("application/json", "[{\"op\":\"replace\",\"path\":\"/description\",\"value\":\"for qa\"}]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment"
payload := strings.NewReader("[{\"op\":\"replace\",\"path\":\"/description\",\"value\":\"for qa\"}]")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATH PARAMS
-
applicationId* string - The application id
-
environmentName* string - The environment name
BODY PARAMS
-
op string - The operation to be performed (one of
add
,remove
,replace
,move
,copy
,test
) -
path string - Path to the value that is to be changed. Ex:
path: description
is like sayingenvironment.description
-
value string - The value to be used within the operations.
-
from string - A string containing a JSON Pointer value.
Delete Environment
Delete an environment
https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/environmentName
var request = require("request");
var options = {
method: 'DELETE',
url: 'https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment',
headers: {authorization: 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
curl --request DELETE \
--url https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment \
--header 'authorization: Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["authorization"] = 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'
response = http.request(request)
puts response.read_body
import requests
url = "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment"
headers = {'authorization': 'Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6'}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment")
.delete(null)
.addHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
.build();
Response response = client.newCall(request).execute();
var client = new RestClient("https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment");
var request = new RestRequest(Method.DELETE);
request.AddHeader("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6");
IRestResponse response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://x-api.rollout.io/public-api/applications/1a23bcd4e5fg6h7890i123j4/environments/AcmeEnvironment"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("authorization", "Bearer b0c17g9f-79f4-69da-cc45-67db602c10d6")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATH PARAMS
-
applicationId* string - The application id
-
environmentName* string - The environment name
As a security measure, a rate limit has been implemented to one request per second, and is based on the requester IP address. Any requests at rates that exceed the rate limit will receive a |