Skip to content

Features#

You must be authenticated to use this resource.

Create a new feature#

POST /features/

Request#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
curl -X "POST" "http://0.0.0.0:8000/features/" \
     -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...' \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d '{
            "id": "search-button",
            "enabled": true,
            "deny": false,
            "services": [],
            "version": "1.0.0"
         }'

Response#

1
{"message": "Feature created successfully."}
1
{"message": "Unauthorized."}
1
{"message": "The feature id isn't available. Please try another."}

Get all features#

GET /features/

Request#

1
2
curl "http://{host}/features/" \
     -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...'

Response#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
[
  {
    "id": "search-button",
    "version": "1.0.0",
    "enabled": true,
    "deny": false,
    "services": []
  },
  {
    "id": "footer",
    "version": "1.0.1",
    "enabled": true,
    "deny": false,
    "services": []
  },
]
1
{"message": "Unauthorized."}

Get feature by id#

GET /features/{id}

Request#

1
2
curl "http://{host}/features/search-button" \
     -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...'

Response#

1
2
3
4
5
6
7
{
  "id": "search-button",
  "version": "1.0.0",
  "enabled": true,
  "deny": false,
  "services": []
}
1
{"message": "Unauthorized."}
1
{"message": "Feature not found."}

Update feature#

PUT /features/{id}

Request#

1
2
3
4
5
6
7
8
9
curl -X "PUT" "http://0.0.0.0:8000/features/search-button" \
     -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...' \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d '{
            "enabled": true,
            "deny": false,
            "services": [1,2],
            "version": "1.0.2"
         }'

Response#

1
{"message": "Feature update successfully."}
1
{"message": "Unauthorized."}
1
{"message": "Feature not found."}

Delete feature#

DELETE /features/{id}

Request#

1
2
curl "http://0.0.0.0:8000/features/search-button" \
     -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...'

Response#

1
{"message": "Feature deleted successfully."}
1
{"message": "Unauthorized."}
1
{"message": "Feature not found."}

Feature data#

Field Type Description
id String Feature name.
version String Feature version.
enabled Bool If value is true the feature can be used by all services. If value is false only services in services list can be use this feature.
deny Bool If value is ​true ​the feature can be used by all services except the services in services list.
services Array Services list.