swagger: '2.0' info: title: Operation Manager Agent API description: Interact with deployed Cloud Computing resources via API. version: "0.1.1" # the domain of the service host: 127.0.0.1:8011 # array of all schemes that your API supports schemes: # TODO: Change to HTTPS when not on localhost! - http # will be prefixed to all paths #basePath: /omaapp consumes: - application/json produces: - application/json securityDefinitions: api_key: type: apiKey name: Authorization in: header paths: /users/: get: summary: Get the list of all the users registered. description: | Get the list of all the users registered. No authentification is required. tags: - Users responses: 200: description: An array of users schema: type: array items: $ref: '#/definitions/User' default: description: Unexpected error schema: $ref: '#/definitions/Error' post: summary: Register a new user. description: | Register a new user. Authentification is required. security: - api_key: [] parameters: - name: data in: body description: User required: true schema: $ref: '#/definitions/UserPost' tags: - Users responses: 201: description: The newly created user schema: $ref: '#/definitions/User' default: description: Unexpected error schema: $ref: '#/definitions/Error' /users/{id}/: get: summary: Get a single user. description: | Get a single user. Authentification is required. parameters: - name: id in: path description: ID of the user required: true type: integer minimum: 0 tags: - Users responses: 200: description: The user matching the given ID schema: $ref: '#/definitions/User' 404: description: No user with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' put: summary: Redefine an already existing user. description: | Redefine an already existing user. Authentification is required. security: - api_key: [] parameters: - name: id in: path description: ID of the user required: true type: integer minimum: 0 - name: data in: body description: User required: true schema: $ref: '#/definitions/UserPost' tags: - Users responses: 200: description: The updated user schema: $ref: '#/definitions/User' 404: description: No user with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' patch: summary: Modify an already existing user. description: | Modify an already existing user. Authentification is required. security: - api_key: [] parameters: - name: id in: path description: ID of the user required: true type: integer minimum: 0 - name: data in: body description: User required: true schema: $ref: '#/definitions/UserPatch' tags: - Users responses: 200: description: The updated user schema: $ref: '#/definitions/User' 404: description: No user with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' delete: summary: Delete an already existing user. description: | Delete an already existing user. Authentification is required. parameters: - name: id in: path description: ID of the user required: true type: integer minimum: 0 security: - api_key: [] tags: - Users responses: 204: description: User correctly deleted 404: description: No user with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' /ops/: get: summary: Get the list of all the ops registered. description: | Get the list of all the ops registered. No authentification is required. tags: - Ops responses: 200: description: An array of ops schema: type: array items: $ref: '#/definitions/Op' default: description: Unexpected error schema: $ref: '#/definitions/Error' post: summary: Register a new op. description: | Register a new op. Authentification is required. security: - api_key: [] parameters: - name: data in: body description: Op required: true schema: $ref: '#/definitions/OpPost' tags: - Ops responses: 201: description: The newly created op schema: $ref: '#/definitions/Op' default: description: Unexpected error schema: $ref: '#/definitions/Error' /ops/{id}/: get: summary: Get a single op. description: | Get a single op. Authentification is required. parameters: - name: id in: path description: ID of the op required: true type: integer minimum: 0 tags: - Ops responses: 200: description: The op matching the given ID schema: $ref: '#/definitions/Op' 404: description: No op with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' put: summary: Redefine an already existing op. description: | Redefine an already existing op. Authentification is required. security: - api_key: [] parameters: - name: id in: path description: ID of the op required: true type: integer minimum: 0 - name: data in: body description: Op required: true schema: $ref: '#/definitions/OpPost' tags: - Ops responses: 200: description: The updated op schema: $ref: '#/definitions/Op' 404: description: No op with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' patch: summary: Modify an already existing op. description: | Modify an already existing op. Authentification is required. security: - api_key: [] parameters: - name: id in: path description: ID of the op required: true type: integer minimum: 0 - name: data in: body description: Op required: true schema: $ref: '#/definitions/OpPatch' tags: - Ops responses: 200: description: The updated op schema: $ref: '#/definitions/Op' 404: description: No op with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' delete: summary: Delete an already existing op. description: | Delete an already existing op. Authentification is required. parameters: - name: id in: path description: ID of the op required: true type: integer minimum: 0 security: - api_key: [] tags: - Ops responses: 204: description: Op correctly deleted 404: description: No op with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' /ops/{id}/run_op/: post: summary: Run a specified op. description: | Get a single op. Authentification is required. parameters: - name: id in: path description: ID of the op required: true type: integer minimum: 0 tags: - Ops responses: 200: description: The op matching the given ID schema: $ref: '#/definitions/Op' 404: description: No op with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' /ops/get_executions/: get: summary: Get list of all executions. description: | Get list of all executions. Authentification is required. tags: - Ops responses: 200: description: The op matching the given ID schema: type: array items: $ref: '#/definitions/Execution' 404: description: No op with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' /api-token-auth/: post: summary: Get the authentification token for a user. description: | Get the authentification token for a user by providing his username and password. No authentification is required; however the credentials of the user are part of the request. parameters: - name: data in: body description: User credentials required: true schema: $ref: '#/definitions/Credentials' tags: - Users responses: 200: description: The authentification token of the user schema: $ref: '#/definitions/TokenResp' default: description: Unexpected error schema: $ref: '#/definitions/Error' definitions: User: type: object properties: id: type: integer description: Unique identifier representing a specific user username: type: string description: Name given to the user first_name: type: string description: First name of the user last_name: type: string description: Last name of the user email: type: string description: Email of the user is_staff: type: integer description: Boolean stating wether the user is a staff member or not is_superuser: type: integer description: Boolean stating wether the user is a superuser or not is_active: type: integer description: Boolean stating wether the user is active or not date_joined: type: string format: date-time description: Date and time of creation of the user UserPost: type: object required: - username - password properties: username: type: string description: Name given to the user password: type: string description: Password of the user first_name: type: string description: First name of the user last_name: type: string description: Last name of the user email: type: string description: Email of the user UserPatch: type: object properties: username: type: string description: Name given to the user password: type: string description: Password of the user first_name: type: string description: First name of the user last_name: type: string description: Last name of the user email: type: string description: Email of the user Op: type: object properties: id: type: integer description: Unique identifier representing a specific op script: type: string description: Script of the op callback_url: type: string description: Callback URL of the op status: type: string description: Status of the op info: type: string description: Formatted information about the progress of the op OpPost: type: object required: - script properties: script: type: string description: Script of the op callback_url: type: string description: Callback URL of the op OpPatch: type: object properties: script: type: string description: Script of the op callback_url: type: string description: Callback URL of the op Execution: type: object properties: op_id: type: integer description: Unique identifier representing a specific op execution_id: type: string description: Id of the execution (application specific) progress: type: number description: percentage representing the progress of the execution info: type: string description: Formatted JSON information about the progress of the op Error: type: object properties: detail: type: string TokenResp: type: object properties: token: type: string Credentials: type: object required: - username - password properties: username: description: Username of the user type: string password: description: Password of the user type: string