-
-
Notifications
You must be signed in to change notification settings - Fork 656
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
7,797 additions
and
5,820 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
--- | ||
id: tags | ||
title: /api/admin/tags | ||
--- | ||
|
||
> In order to access the admin API endpoints you need to identify yourself. If you are using the `insecure` authentication method, you may use [basic authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) to identify yourself. | ||
### Create a new tag | ||
|
||
`POST https://unleash.host.com/api/admin/tags` | ||
|
||
Creates a new tag without connecting it to any other object, can be helpful to build an autocomplete list. | ||
|
||
**Body** | ||
|
||
```json | ||
{ | ||
"value": "MyTag", | ||
"type": "simple" | ||
} | ||
``` | ||
|
||
### Notes | ||
|
||
- `type` must exist in tag-types | ||
|
||
### List tags | ||
|
||
`GET https://unleash.host.com/api/admin/tags` | ||
|
||
This endpoint is the one all admin UIs should use to fetch all available tags from the _unleash_server_. The response returns all tags. | ||
|
||
**Example response:** | ||
|
||
```json | ||
{ | ||
"version": 1, | ||
"tags": [ | ||
{ | ||
"id": 5, | ||
"value": "Team-Red", | ||
"type": "simple" | ||
}, | ||
{ | ||
"id": 9, | ||
"value": "Team-Green", | ||
"type": "simple" | ||
}, | ||
{ | ||
"id": 19, | ||
"value": "DecemberExperiment", | ||
"type": "simple" | ||
}, | ||
{ | ||
"id": 25, | ||
"value": "#team-alert-channel", | ||
"type": "slack" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### List tags by type | ||
|
||
`GET: https://unleash.host.com/api/admin/tags/:type` | ||
|
||
Lists all tags of `:type`. If none exist, returns the empty list | ||
|
||
**Example response to query for https://unleash.host.com/api/admin/tags/simple** | ||
|
||
```json | ||
{ | ||
"version": 1, | ||
"tags": [ | ||
{ | ||
"id": 5, | ||
"value": "Team-Red", | ||
"type": "simple" | ||
}, | ||
{ | ||
"id": 9, | ||
"value": "Team-Green", | ||
"type": "simple" | ||
}, | ||
{ | ||
"id": 19, | ||
"value": "DecemberExperiment", | ||
"type": "simple" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Fetching Tag types | ||
|
||
`GET: https://unleash.host.com/api/admin/tag-types` | ||
|
||
Used to fetch all types the server knows about. This endpoint is the one all admin UI should use to fetch all available tag types from the _unleash-server_. The response returns all tag types. Any server will have _at least_ one configured tag type (the `simple` type). A tag type will be a map of `type`, `description`, `icon` | ||
|
||
**Example response:** | ||
|
||
```json | ||
{ | ||
"version": 1, | ||
"tagTypes": [ | ||
{ | ||
"name": "simple", | ||
"description": "Arbitrary tags. Used to simplify filtering of features", | ||
"icon": "#" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Get a single tag type | ||
|
||
`GET: https://unleash.host.com/api/admin/tag-types/simple` | ||
|
||
Used to fetch details about a specific tag-type. This is mostly provded to make it easy to debug the API and should not be used by the client implementations. | ||
|
||
**Example response:** | ||
|
||
```json | ||
{ | ||
"version": 1, | ||
"tagType": { | ||
"name": "simple", | ||
"description": "Some description", | ||
"icon": "Some icon", | ||
"createdAt": "2021-01-07T10:00:00Z" | ||
} | ||
} | ||
``` | ||
|
||
### Create a new tag type | ||
|
||
`POST: https://unleash.host.com/api/admin/tag-types` | ||
|
||
Used to register a new tag type. This endpoint should be used to inform the server about a new type of tags. | ||
|
||
**Body:** | ||
|
||
```json | ||
{ | ||
"name": "tagtype", | ||
"description": "Purpose of tag type", | ||
"icon": "Either an URL to icon or a simple prefix string for tag" | ||
} | ||
``` | ||
|
||
**Notes:** | ||
|
||
- if `name` is not unique, will return 409 CONFLICT, if you'd like to update an existing tag through admin-api look at [Update tag type](#Update-tag-type). | ||
|
||
Returns 201-CREATED if the tag type was created successfully | ||
|
||
### Update tag type | ||
|
||
`PUT: https://unleash.host.com/api/admin/tag-types/:typeName` | ||
|
||
**Body:** | ||
|
||
```json | ||
{ | ||
"description": "New description", | ||
"icon": "New icon" | ||
} | ||
``` | ||
|
||
### Deleting a tag type | ||
|
||
`DELETE: https://unleash.host.com/api/admin/tag-types/:typeName` | ||
|
||
Returns 200 if the type was not in use and the type was deleted. If the type was in use, will return a _409 CONFLICT_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
id: tags | ||
title: Tagging Features | ||
--- | ||
|
||
> This feature was introduced in Unleash vx.y.z | ||
Do you want to filter your features to avoid having to see all features belonging to other teams than your own? Do you want to write a plugin that only gets notified about changes to features that your plugin knows how to handle? | ||
|
||
### Say hello to Typed tags | ||
|
||
Unleash supports tagging features with an arbitrary number of tags. This eases filtering the list of tags to only those features that are tagged with the tag you're interested in. | ||
|
||
#### How does it work? | ||
|
||
Unleash will allow users to tag any feature with any number of tags. When viewing a feature, the UI will/may display all tags connected to that feature. | ||
|
||
When adding a new tag, a dropdown will show you which type of tag you're about to add. Our first type; `simple` are meant to be used for filtering features. Show only features that have a tag of `MyTeam`. | ||
|
||
#### Tag types | ||
|
||
Types can be anything, and their purpose is to add some semantics to the tag itself. | ||
|
||
Some tag types will be defined by plugins (e.g. the slack plugin can define the slack-type, to make it easy to specify which slack channels to post updates for a specific feature toggle to). | ||
|
||
Other tags can be defined by the user to give semantic logic to the management of the UI. It could be that you want to use tag functionality to specify which products a feature toggle belongs to, or to which teams. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
TAG_FEATURE: 'tag-feature', | ||
UNTAG_FEATURE: 'untag-feature', | ||
CREATE_TAG: 'create-tag', | ||
DELETE_TAG: 'delete-tag', | ||
CREATE_TAG_TYPE: 'create-tag-type', | ||
DELETE_TAG_TYPE: 'delete-tag-type', | ||
UPDATE_TAG_TYPE: 'update-tag-type', | ||
}; |
Oops, something went wrong.