swagger: '2.0' info: version: "1.0" title: "Hooky: A Web(hook) tasks manager" description: Hooky is a scheduler for Web(hook) taks. host: hooky-dev.elasticbeanstalk.com schemes: - http basePath: / consumes: - application/json produces: - application/json securityDefinitions: owner: type: basic admin: type: basic paths: /accounts: get: security: - admin: [] description: List of `Account` objects. parameters: - name: page in: query description: the page number for the list required: false type: integer format: int32 - name: limit in: query description: the number of items per page required: false type: integer format: in32 - name: filters in: query description: the filters to apply to the list required: false type: integer format: in32 responses: 200: description: successful operation schema: $ref: '#/definitions/Accounts' examples: application/json: list: - id: "554da1a1b09b880007000001" key: "qqcv6l0Bi2Z3Oc8ahzMMFY4ndfFYldlq" created: "2015-05-09T05:56:49Z" - id: "554da2856619de0006000001" key: "vTvZcchKq9bhExveN4qW6X42pAgB5q6i" created: "2015-05-09T06:00:37Z" - id: "554da28a6619de0006000004" key: "1Vm5rYEzwnuDVIh0OxCwWLaaFGqIoy0J" created: "2015-05-09T06:00:42Z" page: 1 pages: 1 total: 3 count: 3 hasMore: false post: security: - admin: [] description: Create a new `Account` parameters: - in: body name: body description: Fields that must me modified required: false schema: $ref: "#/definitions/NewAccount" responses: 200: description: successful operation schema: $ref: '#/definitions/Account' examples: application/json: id: "554da1a1b09b880007000001" key: "qqcv6l0Bi2Z3Oc8ahzMMFY4ndfFYldlq" created: "2015-05-09T05:56:49Z" /accounts/{account}: get: security: - admin: [] - owner: [] description: Get an `Account` object parameters: - name: account in: path description: account ID required: true type: string responses: 200: description: successful operation schema: $ref: '#/definitions/Account' patch: security: - admin: [] - owner: [] description: Modify an `Account` object parameters: - name: account in: path description: account ID required: true type: string - in: body name: body description: Fields that must me modified required: false schema: $ref: "#/definitions/NewAccount" responses: 200: description: successful operation schema: $ref: '#/definitions/Account' /accounts/{account}/applications: get: security: - admin: [] - owner: [] description: Get a list of `Application` object parameters: - name: account in: path description: account ID required: true type: string - name: page in: query description: the page number for the list required: false type: integer format: int32 - name: limit in: query description: the number of items per page required: false type: integer format: in32 - name: filters in: query description: the filters to apply to the list required: false type: integer format: in32 responses: 200: description: successful operation schema: $ref: '#/definitions/Applications' /accounts/{account}/applications/{application}: get: security: - admin: [] - owner: [] description: Get an `Application` object parameters: - name: account in: path description: account ID required: true type: string - name: application in: path description: application name required: true type: string responses: 200: description: successful operation schema: $ref: '#/definitions/Application' /accounts/{account}/applications/{application}/tasks: get: security: - admin: [] - owner: [] description: Get a list of `Task` object parameters: - name: account in: path description: account ID required: true type: string - name: application in: path description: application name required: true type: string - name: page in: query description: the page number for the list required: false type: integer format: int32 - name: limit in: query description: the number of items per page required: false type: integer format: in32 - name: filters in: query description: the filters to apply to the list required: false type: integer format: in32 responses: 200: description: successful operation schema: $ref: '#/definitions/Tasks' post: security: - admin: [] - owner: [] description: Create a `Task` object parameters: - name: account in: path description: account ID required: true type: string - name: application in: path description: application name required: true type: string - in: body name: body description: Task object that must be created required: true schema: $ref: "#/definitions/NewTask" responses: 200: description: successful operation schema: $ref: '#/definitions/Task' /accounts/{account}/applications/{application}/tasks/{task}: get: security: - admin: [] - owner: [] description: Get a `Task` object parameters: - name: account in: path description: account ID required: true type: string - name: application in: path description: application name required: true type: string - name: task in: path description: task name required: true type: string responses: 200: description: successful operation schema: $ref: '#/definitions/Task' put: security: - admin: [] - owner: [] description: Create a `Task` object parameters: - name: account in: path description: account ID required: true type: string - name: application in: path description: application name required: true type: string - name: task in: path description: task name required: true type: string - in: body name: body description: Task object that must be created required: true schema: $ref: "#/definitions/NewTask" responses: 200: description: successful operation schema: $ref: '#/definitions/Task' /accounts/{account}/applications/{application}/tasks/{task}/attempts: get: security: - admin: [] - owner: [] description: Get a list of `Attempt` object parameters: - name: account in: path description: account ID required: true type: string - name: application in: path description: application name required: true type: string - name: task in: path description: task name required: true type: string - name: page in: query description: the page number for the list required: false type: integer format: int32 - name: limit in: query description: the number of items per page required: false type: integer format: in32 - name: filters in: query description: the filters to apply to the list required: false type: integer format: in32 responses: 200: description: successful operation schema: $ref: '#/definitions/Attempts' post: security: - admin: [] - owner: [] description: Immediately trigger an `Attempt` for the scheduled `Task` parameters: - name: account in: path description: account ID required: true type: string - name: application in: path description: application name required: true type: string - name: task in: path description: task name required: true type: string responses: 200: description: successful operation schema: $ref: '#/definitions/Attempts' /accounts/{account}/applications/{application}/queues: get: security: - admin: [] - owner: [] description: Get a list of `Queue` objects parameters: - name: account in: path description: account ID required: true type: string - name: application in: path description: application name required: true type: string - name: page in: query description: the page number for the list required: false type: integer format: int32 - name: limit in: query description: the number of items per page required: false type: integer format: in32 - name: filters in: query description: the filters to apply to the list required: false type: integer format: in32 responses: 200: description: successful operation schema: $ref: '#/definitions/Queues' /accounts/{account}/applications/{application}/queues/{queue}: get: security: - admin: [] - owner: [] description: Get a `Queue` object parameters: - name: account in: path description: account ID required: true type: string - name: application in: path description: application name required: true type: string - name: queue in: path description: queue name required: true type: string responses: 200: description: successful operation schema: $ref: '#/definitions/Queue' put: security: - admin: [] - owner: [] description: Create a `Queue` object parameters: - name: account in: path description: account ID required: true type: string - name: application in: path description: application name required: true type: string - name: queue in: path description: queue name required: true type: string - in: body name: body description: Queue object that must be created required: true schema: $ref: "#/definitions/NewQueue" responses: 200: description: successful operation schema: $ref: '#/definitions/Queue' definitions: Accounts: properties: list: type: array description: List of `Account`. items: $ref: '#/definitions/Account' page: type: integer description: Current page number. pages: type: integer description: Total number of pages. total: type: integer description: Total number of `Account`. count: type: integer description: Number of `Account` in the list. hasMore: type: boolean description: Has more result? Account: properties: id: type: string description: Account ID. name: type: string description: Account name. key: type: string description: Secret key. created: type: string format: dateTime description: Date the `Account` was created. NewAccount: properties: name: type: string description: Account name. Queues: properties: list: type: array description: List of `Queue`. items: $ref: '#/definitions/Queue' page: type: integer description: Current page number. pages: type: integer description: Total number of pages. total: type: integer description: Total number of `Queue`. count: type: integer description: Number of `Queue` in the list. hasMore: type: boolean description: Has more result? Queue: properties: id: type: string description: Queue ID. account: type: string description: Account's ID. name: type: string description: Name. retry: $ref: '#/definitions/Retry' in_flight: type: integer description: Current number of attempts executed in parallel. max_in_flight: type: integer description: Maximum number of attempts executed in parallel. NewQueue: properties: retry: $ref: '#/definitions/Retry' max_in_flight: type: integer description: Maximum number of attempts executed in parallel. Applications: properties: list: type: array description: List of `Application`. items: $ref: '#/definitions/Application' page: type: integer description: Current page number. pages: type: integer description: Total number of pages. total: type: integer description: Total number of `Application`. count: type: integer description: Number of `Application` in the list. hasMore: type: boolean description: Has more result? Application: properties: id: type: string description: Application ID. account: type: string description: Account's ID. name: type: string description: Name. Tasks: properties: list: type: array description: List of `Task`. items: $ref: '#/definitions/Task' page: type: integer description: Current page number. pages: type: integer description: Total number of pages. total: type: integer description: Total number of `Task`. count: type: integer description: Number of `Task` in the list. hasMore: type: boolean description: Has more result? Task: properties: id: type: string description: Task ID. account: type: string description: Account's ID. application: type: string description: Application's name. name: type: string description: Name. queue: type: string description: The name of the parent Queue. method: type: string description: The HTTP method that will be used to execute the request. url: type: string description: The URL that will be requested. headers: $ref: '#/definitions/Headers' auth: $ref: '#/definitions/HTTPAuth' payload: type: string description: An arbitrary data that will be POSTed on the URL. schedule: type: string description: A cron specification describing the recurrency if any. retry: $ref: '#/definitions/Retry' at: type: string format: dateTime description: The date representing the next time a attempt will be executed. status: type: string description: Either `pending`, `retrying`, `canceled`, `success` or `error` executed: type: string format: dateTime description: The date of the last time a attempt was executed. active: type: boolean description: Is the task active. errors: type: integer description: The number of attempts that failed. lastError: type: string format: dateTime description: The date of the last attempt in error status. lastSuccess: type: string format: dateTime description: The date of the last attempt in success status. executions: type: integer description: The number of attempts that were executed. errorRate: type: number format: float description: The rate of errors in percent. NewTask: required: - url properties: queue: type: string description: The name of the parent Queue. method: type: string description: The HTTP method that will be used to execute the request. url: type: string description: The URL that will be requested. headers: $ref: '#/definitions/Headers' auth: $ref: '#/definitions/HTTPAuth' payload: type: string description: An arbitrary data that will be POSTed on the URL. schedule: type: string description: A cron specification describing the recurrency if any. retry: $ref: '#/definitions/Retry' Attempts: properties: list: type: array description: List of `Attempt`. items: $ref: '#/definitions/Attempt' page: type: integer description: Current page number. pages: type: integer description: Total number of pages. total: type: integer description: Total number of `Attempt`. count: type: integer description: Number of `Attempt` in the list. hasMore: type: boolean description: Has more result? Attempt: properties: id: type: string description: Attempt ID. account: type: string description: Account's ID. application: type: string description: Application's name. task: type: string description: Task's name. created: type: string format: dateTime description: The date when the Attempt was created. taskID: type: string description: The ID of the parent Task. queue: type: string description: The name of the parent Queue. method: type: string description: The HTTP method that will be used to execute the request. url: type: string description: The URL that will be requested. headers: $ref: '#/definitions/Headers' auth: $ref: '#/definitions/HTTPAuth' payload: type: string description: An arbitrary data that will be POSTed on the URL. schedule: type: string description: A cron specification describing the recurrency if any. at: type: string format: dateTime description: The date representing the next time a attempt will be executed. status: type: string description: either `pending`, `retrying`, `canceled`, `success` or `error` statusCode: type: integer description: The HTTP status code. statusMessage: type: string description: a human readable message related to the `statusCode`. HTTPAuth: type: object description: The authentication credentials to use to perform the HTTP request. properties: username: type: string description: The username to use for authentication. password: type: string description: The password to use for the authentication. Headers: type: object description: The HTTP headers that will be used schedule executing the request. additionalProperties: type: string description: Value of the header. Retry: type: object description: The parameters for the retries. properties: attempts: type: integer description: The current number of attempts we did. maxAttempts: type: integer description: The maximum number of attempts we will try. factor: type: number format: float description: The actor to increase the duration between each attempts. min: type: integer description: The minimum duration between each attempts in seconds. max: type: integer description: The maximum duration between each attempts in seconds.