The host is responsible to keep track of features and defines if features are enabled or disabled. Clients register new features on the host by using simple HTTP calls. The host is made to handle multiple environments at the same time, so features can be enabled for one instance and disabled for another.
Retrieves all the environments.
// Response when using GET
[
{
"name": "environment", // string
"hosts": [
'0.0.0.0',
'some-domain'
], // array<string>
"features": [
{
"name": "feature_name_1", // string
"enabled": true // boolean
},
{
"name": "feature_name_2", // string
"enabled": true // boolean
},
],
}
// ...
]
Retrieves all the feature toggles for the given environment.
// Response when using GET
{
"name": "environment", // string
"hosts": [
'0.0.0.0',
'some-domain'
], // array<string>
"features": [
{
"name": "feature_name_1", // string
"enabled": true // boolean
},
{
"name": "feature_name_2", // string
"enabled": true // boolean
},
],
}
Will return a 404 status if the environment does not exist.
Creates a new environment. Will return a 201 status if the creation was succesfull.
// Request
{
"name": "environment_name", // string
"hosts": [
"0.0.0.0",
"www.host.com"
] // the IP/domain(s) of the environment
}
Will return a 409 status if the environment is already exists.
Retrieves information about the feature toggle.
// Response when using GET
{
"name": "feature_name", // string
"enabled": true // boolean
}
Will return a 404 status if the environment is not defined.
Will return a 404 status if the feature is not defined.
Defines a new feature toggle with a default value. Will return a 201 status if the creation was succesfull.
// Request
{
"name": "feature_name", // string
"enabled": true // boolean
}
Will return a 404 status if the environment is not defined.
Will return a 409 status if the feature is already defined.
Updates an existing feature toggle with a new value and/or description. The state and description will only be updated if the keys are present in the payload. Will return a 200 status if the update was succesfull.
// Request
{
"enabled": true, // boolean
"description": "FooBar" // string|null
}
Will return a 404 status if the environment is not defined.
Will return a 404 status if the feature is not defined.
Removes an existing feature toggle. Will return a 200 status if the deletion was succesfull.
Will return a 404 status if the feature or environment is not defined.