This patch splits out the Task layer and the API layer. This will better allow us to build more logic into the task layer, and better allow the APIs to be more flexible. This sets the foundations for future additions to task definitions, async task processing, and an overhaul of the config system for the service. - Task model and logic moved to 'tasks' app - TaskViews are now DelegateAPIs - stage email templates have been moved to the tasks app - better define Task model indexes - rename task/action stage pre_approve to prepare - rename task/action stage post_approve to approve - Added new TaskManager class for handling tasks - Removed redundant ip_address value on Task model - Remove redundant UserSetPassword view - Added custom exception handling for the API - Add new exception types - Simplified error responses by raising exceptions - standardized task API response codes on 202 unless task is completed - Use 503 Service Unavailable for service issues - Various task_types changed: - create_project to create_project_and_user - invite_user to invite_user_to_project - reset_password to reset_user_password - edit_user to edit_user_roles - update_email to update_user_email - reissuing task token now deletes old task tokens Story: 2004489 Change-Id: I33381c1c65b28b69f6ffeb3d73b50be95ee30ba7
2.0 KiB
Admin Logic Version 1 API reference
This is the reference for Adjutant when it is using the default configuration. Different deployments may exclude certain DelegateAPIs or include their own additional ones.
The core functionality of Adjutant is built around the concept of tasks and actions.
Actions are both concepts in the database and code that can execute whatever logic is necessary at each stage.
Tasks can bundle a number of actions and have 3 main steps.
- A user submits a request to the specified endpoint.
- An admin approves the request, or it is automatically approved. At this point the admin can also update invalid data inside the task.
- If necessary a user will be emailed a token and will submit additional data (ie passwords or a confirmation) to finish the task.
Depending on the task and the data provided some steps may be skipped.
Authentication
The 'X-Auth-Token' header value should be provided for authentication with a valid Keystone token.
HTTP Status Codes
- 200
- 200: task-view
- 202
- 400
- 401
- 403
- 404
- 405
- 409
- 500
- 503
Service Discovery
Version Discovery Endpoint
Unauthenticated.
JSON containing details of the currently available versions (just v1 for now)
Normal response code: 200
Version One Details Endpoint
Unauthenticated.
Details V1 version details.
Normal response code: 200
Additional API Documentation
While in debug mode the service will supply online browsable documentation via Django REST Swagger.
This is viewable at: ../docs