From cea7b45b1c3bf22b3f24a1d18a5b86ea7b47cc48 Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Tue, 13 Dec 2016 14:07:55 +0100 Subject: [PATCH] Update strategy-api docs --- docs/api/strategies-api.md | 71 ++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/docs/api/strategies-api.md b/docs/api/strategies-api.md index 86dd87bd35..906996cbbf 100644 --- a/docs/api/strategies-api.md +++ b/docs/api/strategies-api.md @@ -12,25 +12,41 @@ Used to fetch all defined strategies and their defined paramters. "version": 1, "strategies": [ { - "name": "default", - "description": "Default on/off strategy.", - "parametersTemplate": null + "name": "default", + "description": "Default on/off strategy.", + "parameters": [] }, { - "name": "ActiveForUserWithEmail", - "description": "A comma separated list of email adresses this feature should be active for.", - "parametersTemplate": { - "emails": "string" - } + "name": "userWithId", + "description": "Active for userId specified in the comma seperated 'userIds' parameter.", + "parameters": [ + { + "name": "userIds", + "type": "list", + "description": "List of unique userIds the feature should be active for.", + "required": true + } + ] }, { - "name": "Accounts", - "description": "Enable for user accounts", - "parametersTemplate": { - "Accountname": "string" - } - } -]} + "name": "gradualRollout", + "description": "Gradual rollout to logged in users", + "parameters": [ + { + "name": "percentage", + "type": "percentage", + "description": "How many percent should the new feature be active for.", + "required": false + }, + { + "name": "group", + "type": "string", + "description": "Group key to use when hasing the userId. Makes sure that the same user get different value for different groups", + "required": false + } + ] + }, + ]} ``` ### Create strategy @@ -41,12 +57,23 @@ Used to fetch all defined strategies and their defined paramters. ```json { - "name": "ActiveForUserWithEmail", - "description": "A comma separated list of email adresses this feature should be active for.", - "parametersTemplate": { - "emails": "string" - } -} + "name": "gradualRollout", + "description": "Gradual rollout to logged in users", + "parameters": [ + { + "name": "percentage", + "type": "percentage", + "description": "How many percent should the new feature be active for.", + "required": false + }, + { + "name": "group", + "type": "string", + "description": "Group key to use when hasing the userId. Makes sure that the same user get different value for different groups", + "required": false + } + ] +}, ``` -Used to create a new Strategy. Name must be unique. \ No newline at end of file +Used to create a new Strategy. Name is required and must be unique. It is also required to have a parameters array, but it can be empty. \ No newline at end of file