User story #3280
closed
User story #3000: Build a REST API to manage all actions in Rudder (CRUD on Nodes, Groups, Directives and Rules)
Rest API : Rules
Added by Vincent MEMBRÉ almost 12 years ago.
Updated over 9 years ago.
Description
We need to build a Rest API to manage rules.
We should be able to :
- List Rules
- See a Rule Details
- Add a Rule
- Delete a Rule
- Modify a Rule :
- Modify name
- Modify descriptions
- Modify targeted groups
- Modify Directive used
- Activate Rule
- Desactivate Rule
- Clone Rule
- Description updated (diff)
We should also be able to clone and to activate/desactivate Rule
Here is an example of Rule API:
- Change Rule name
- /api/rules/{id}/rename/{name}
- Short description
- /api/rules/{id}/description/short/{description}
- Long description
- /api/rules/{id}/description/long/{description}
- List Groups
- Add Group
- /api/rules/{id}/groups/add/{groupId}
- Remove Group
- /api/rules/{id}/groups/remove/{groupId}
- List Directives
- /api/rules/{id}/directives
- Add Directive
- /api/rules/{id}/directives/add/{groupId}
- Remove Directive
- /api/rules/{id}/directives/remove/{groupId}
- Activate Rule
- /api/rules/{id}/on
- /api/rules/activate/{id}
- Desactivate Rule
- /api/rules/{id}/off
- /api/rules/desactivate/{id}
I propose having a standard response for all the REST API looking like this :
{
Called function:{
"id": Target id,
"status": Answer Status (Ok or Error),
"message": The answer or an error message
}
}
A first version of the API containing only:
- List Rules
- GET
- /api/rules
- Answer: list of availables Rules with following format :
"rule":{
"id": id
"displayName": name
}
- Voir le détail d'une Rule
- GET
- /api/rules/id
- Answer: rule information, based on the following format :
"rule":{
"id": id,
"displayName": name,
"serial":serial,
"shortDescription": short,
"longDescription": long,
"directiveIds": list of Directives id,
"targets": list of target groups,
"isEnabled": boolean,
"isSystem": boolean
}
- Delete Rule
- DELETE
- /api/rules/delete/id
- Answer: The rule has been deleted
- Clone Rule
- Put
- /api/rules/clone/id
- Answer: The new created Rule details (on the same format than the rule details)
- Enable Rule
- Put
- /api/rules/enable/id
- Answer : The Rule has been enabled
- Disable Rule
- Put
- /api/rules/disable/id
- Answer: The rule has been disabled
- Status changed from New to In progress
- Category changed from 11 to API
- Status changed from In progress to 10
- Assignee changed from Vincent MEMBRÉ to Jonathan CLARKE
Going to functionnal review for this first version.
- Target version changed from 2.6.0~beta1 to 2.6.0~rc1
- Target version changed from 2.6.0~rc1 to 2.7.0~beta1
- Status changed from 10 to Pending technical review
- Assignee changed from Jonathan CLARKE to François ARMAND
- Status changed from Pending technical review to Pending release
- % Done changed from 0 to 100
- Status changed from Pending release to Released
- Tracker changed from Enhancement to User story
Also available in: Atom
PDF