swagger: '2.0' info: title: Appliance Registry API description: Store appliances with the Appliance Registry API. version: "0.1.13" # the domain of the service host: 127.0.0.1:8003 # 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: /arapp consumes: - application/json produces: - application/json securityDefinitions: api_key: type: apiKey name: Authorization in: header paths: /actions/: get: summary: Get the list of all the actions registered. description: | Get the list of all the actions registered. No authentification is required. tags: - Actions responses: 200: description: An array of actions schema: type: array items: $ref: '#/definitions/Action' default: description: Unexpected error schema: $ref: '#/definitions/Error' post: summary: Add a new action. description: | Add a new action. Authentification is required. security: - api_key: [] parameters: - name: data in: body description: Action required: true schema: $ref: '#/definitions/ActionPost' tags: - Actions responses: 201: description: The newly created action schema: $ref: '#/definitions/Action' default: description: Unexpected error schema: $ref: '#/definitions/Error' /actions/{name}/: get: summary: Get a single action. description: | Get a single action. Authentification is not required. parameters: - name: name in: path description: Name of the action required: true type: string tags: - Actions responses: 200: description: The action matching the given name schema: $ref: '#/definitions/Action' 404: description: No action with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' put: summary: Redefine an already existing action. description: | Redefine an already existing action. Authentification is required. security: - api_key: [] parameters: - name: name in: path description: Name of the action required: true type: string - name: data in: body description: Action required: true schema: $ref: '#/definitions/ActionPost' tags: - Actions responses: 200: description: The updated action schema: $ref: '#/definitions/Action' 404: description: No action with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' patch: summary: Modify an already existing action. description: | Modify an already existing action. Authentification is required. security: - api_key: [] parameters: - name: name in: path description: Name of the action required: true type: string - name: data in: body description: Action required: true schema: $ref: '#/definitions/ActionPatch' tags: - Actions responses: 200: description: The updated action schema: $ref: '#/definitions/Action' 404: description: No action with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' delete: summary: Delete an already existing action. description: | Delete an already existing action. Authentification is required. parameters: - name: name in: path description: Name of the action required: true type: string security: - api_key: [] tags: - Actions responses: 204: description: Action correctly deleted 404: description: No action with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' /sites/: get: summary: Get the list of all the sites registered. description: | Get the list of all the sites registered. No authentification is required. tags: - Sites responses: 200: description: An array of sites schema: type: array items: $ref: '#/definitions/Site' default: description: Unexpected error schema: $ref: '#/definitions/Error' post: summary: Add a new site. description: | Add a new site. Authentification is required. security: - api_key: [] parameters: - name: data in: body description: Site required: true schema: $ref: '#/definitions/SitePost' tags: - Sites responses: 201: description: The newly created site schema: $ref: '#/definitions/Site' default: description: Unexpected error schema: $ref: '#/definitions/Error' /sites/{name}/: get: summary: Get a single site. description: | Get a single site. Authentification is not required. parameters: - name: name in: path description: Name of the site required: true type: string tags: - Sites responses: 200: description: The site matching the given name schema: $ref: '#/definitions/Site' 404: description: No site with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' put: summary: Redefine an already existing site. description: | Redefine an already existing site. Authentification is required. security: - api_key: [] parameters: - name: name in: path description: Name of the site required: true type: string - name: data in: body description: Site required: true schema: $ref: '#/definitions/SitePost' tags: - Sites responses: 200: description: The updated site schema: $ref: '#/definitions/Site' 404: description: No site with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' patch: summary: Modify an already existing site. description: | Modify an already existing site. Authentification is required. security: - api_key: [] parameters: - name: name in: path description: Name of the site required: true type: string - name: data in: body description: Site required: true schema: $ref: '#/definitions/SitePatch' tags: - Sites responses: 200: description: The updated site schema: $ref: '#/definitions/Site' 404: description: No site with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' delete: summary: Delete an already existing site. description: | Delete an already existing site. Authentification is required. parameters: - name: name in: path description: Name of the site required: true type: string security: - api_key: [] tags: - Sites responses: 204: description: Site correctly deleted 404: description: No site with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' /scripts/: get: summary: Get the list of all the scripts registered. description: | Get the list of all the scripts registered. No authentification is required. tags: - Scripts responses: 200: description: An array of scripts schema: type: array items: $ref: '#/definitions/Script' default: description: Unexpected error schema: $ref: '#/definitions/Error' post: summary: Add a new script. description: | Add a new script. Authentification is required. security: - api_key: [] parameters: - name: data in: body description: Script required: true schema: $ref: '#/definitions/ScriptPost' tags: - Scripts responses: 201: description: The newly created script schema: $ref: '#/definitions/Script' default: description: Unexpected error schema: $ref: '#/definitions/Error' /scripts/{id}/: get: summary: Get a single script. description: | Get a single script. Authentification is not required. parameters: - name: id in: path description: Id of the script required: true type: integer minimum: 0 tags: - Scripts responses: 200: description: The script matching the given ID schema: $ref: '#/definitions/Script' 404: description: No script with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' put: summary: Redefine an already existing script. description: | Redefine an already existing script. Authentification is required. security: - api_key: [] parameters: - name: id in: path description: Id of the script required: true type: integer minimum: 0 - name: data in: body description: Script required: true schema: $ref: '#/definitions/ScriptPost' tags: - Scripts responses: 200: description: The updated script schema: $ref: '#/definitions/Script' 404: description: No script with the given Id schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' patch: summary: Modify an already existing script. description: | Modify an already existing script. Authentification is required. security: - api_key: [] parameters: - name: id in: path description: Id of the script required: true type: integer minimum: 0 - name: data in: body description: Script required: true schema: $ref: '#/definitions/ScriptPatch' tags: - Scripts responses: 200: description: The updated script schema: $ref: '#/definitions/Script' 404: description: No script with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' delete: summary: Delete an already existing script. description: | Delete an already existing script. Authentification is required. parameters: - name: id in: path description: Id of the script required: true type: integer minimum: 0 security: - api_key: [] tags: - Scripts responses: 204: description: Script correctly deleted 404: description: No script with the given ID schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' /scripts/{appliance}/{action}/: get: summary: Get the script corresponding to an appliance and an action. description: | Get the script corresponding to an appliance and an action. Authentification is not required. parameters: - name: appliance in: path description: Name of the appliance required: true type: string - name: action in: path description: Name of the action required: true type: string tags: - Scripts responses: 200: description: The script matching schema: $ref: '#/definitions/Script' 404: description: Unexisting appliance or no script with this name for this appliance schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' /appliances/: get: summary: Get the list of all the appliances registered. description: | Get the list of all the appliances registered. No authentification is required. tags: - Appliances responses: 200: description: An array of appliances schema: type: array items: $ref: '#/definitions/Appliance' default: description: Unexpected error schema: $ref: '#/definitions/Error' post: summary: Add a new appliances. description: | Add a new appliances. Authentification is required. security: - api_key: [] parameters: - name: data in: body description: Appliance required: true schema: $ref: '#/definitions/AppliancePost' tags: - Appliances responses: 201: description: The newly created appliance schema: $ref: '#/definitions/Appliance' default: description: Unexpected error schema: $ref: '#/definitions/Error' /appliances/{name}/: get: summary: Get a single appliance. description: | Get a single appliance. Authentification is not required. parameters: - name: name in: path description: Name of the appliance required: true type: string tags: - Appliances responses: 200: description: The appliance matching the given name schema: $ref: '#/definitions/Appliance' 404: description: No appliance with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' put: summary: Redefine an already existing appliance. description: | Redefine an already existing appliance. Authentification is required. security: - api_key: [] parameters: - name: name in: path description: Name of the appliance required: true type: string - name: data in: body description: Appliance required: true schema: $ref: '#/definitions/AppliancePost' tags: - Appliances responses: 200: description: The updated appliance schema: $ref: '#/definitions/Appliance' 404: description: No appliance with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' patch: summary: Modify an already existing appliance. description: | Modify an already existing appliance. Authentification is required. security: - api_key: [] parameters: - name: name in: path description: Name of the appliance required: true type: string - name: data in: body description: Appliance required: true schema: $ref: '#/definitions/AppliancePatch' tags: - Appliances responses: 200: description: The updated appliance schema: $ref: '#/definitions/Appliance' 404: description: No appliance with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' delete: summary: Delete an already existing appliance. description: | Delete an already existing appliance. Authentification is required. parameters: - name: name in: path description: Name of the appliance required: true type: string security: - api_key: [] tags: - Appliances responses: 204: description: Appliance correctly deleted 404: description: No appliance with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' /appliances_impl/: get: summary: Get the list of all the appliance implementations registered. description: | Get the list of all the appliance implementations registered. No authentification is required. tags: - Appliance Implementations responses: 200: description: An array of appliance implementations schema: type: array items: $ref: '#/definitions/ApplianceImplementation' default: description: Unexpected error schema: $ref: '#/definitions/Error' post: summary: Add a new appliance implementation. description: | Add a new appliance implementation. Authentification is required. security: - api_key: [] parameters: - name: data in: body description: ApplianceImplementation required: true schema: $ref: '#/definitions/ApplianceImplementationPost' tags: - Appliance Implementations responses: 201: description: The newly created appliance implementation schema: $ref: '#/definitions/ApplianceImplementation' default: description: Unexpected error schema: $ref: '#/definitions/Error' /appliances_impl/{name}/: get: summary: Get a single appliance implementation. description: | Get a single appliance implementation. Authentification is not required. parameters: - name: name in: path description: Name of the appliance implementation required: true type: string tags: - Appliance Implementations responses: 200: description: The appliance implementation matching the given name schema: $ref: '#/definitions/ApplianceImplementation' 404: description: No appliance implementation with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' put: summary: Redefine an already existing appliance implementation. description: | Redefine an already existing appliance implementation. Authentification is required. security: - api_key: [] parameters: - name: name in: path description: Name of the appliance implementation required: true type: string - name: data in: body description: ApplianceImplementation required: true schema: $ref: '#/definitions/ApplianceImplementationPost' tags: - Appliances responses: 200: description: The updated appliance implementation schema: $ref: '#/definitions/ApplianceImplementation' 404: description: No appliance implementation with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' patch: summary: Modify an already existing appliance implementation. description: | Modify an already existing appliance implementation. Authentification is required. security: - api_key: [] parameters: - name: name in: path description: Name of the appliance implementation required: true type: string - name: data in: body description: Appliance implementation required: true schema: $ref: '#/definitions/ApplianceImplementationPatch' tags: - Appliance Implementations responses: 200: description: The updated appliance implementation schema: $ref: '#/definitions/ApplianceImplementation' 404: description: No appliance implementation with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' delete: summary: Delete an already existing appliance implementation. description: | Delete an already existing appliance implementation. Authentification is required. parameters: - name: name in: path description: Name of the appliance implementation required: true type: string security: - api_key: [] tags: - Appliance Implementations responses: 204: description: Appliance implementation correctly deleted 404: description: No appliance implementation with the given name schema: $ref: '#/definitions/Error' default: description: Unexpected error schema: $ref: '#/definitions/Error' /users/: get: summary: Get the list of all the users. description: | Get the list of all the users. 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' /users/{id}/: get: summary: Get a single user. description: | Get a single user. No 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' /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: Appliance: type: object properties: name: type: string description: Name of the appliance logo_url: type: string description: URL to a logo image description: type: string description: Description of the appliance implementations: type: array items: type: string description: Names of appliance implementations AppliancePost: type: object required: - name properties: name: type: string description: Name of the appliance logo_url: type: string description: URL to a logo image description: type: string description: Description of the appliance AppliancePatch: type: object properties: name: type: string description: Name of the appliance logo_url: type: string description: URL to a logo image description: type: string description: Description of the appliance ApplianceImplementation: type: object properties: name: type: string description: Name of the appliance implementation logo_url: type: string description: URL to a logo image image_name: type: string description: Name of the image that will be used by the appliance implementation site: type: string description: Name of the site to use appliance: type: string description: Name of the appliance scripts: type: array items: type: integer description: IDs of script objects ApplianceImplementationPost: type: object required: - name - image_name - site - appliance properties: name: type: string description: Name of the appliance implementation logo_url: type: string description: URL to a logo image image_name: type: string description: Name of the image that will be used by the appliance implementation site: type: string description: Name of the site to use appliance: type: string description: Name of the appliance ApplianceImplementationPatch: type: object properties: name: type: string description: Name of the appliance implementation logo_url: type: string description: URL to a logo image image_name: type: string description: Name of the image that will be used by the appliance implementation site: type: string description: Name of the site to use appliance: type: string description: Name of the appliance Action: type: object properties: name: type: string description: Name of the action scripts: type: array items: type: integer description: IDs of script objects ActionPost: type: object required: - name properties: name: type: string description: Name of the action ActionPatch: type: object properties: name: type: string description: Name of the action Site: type: object properties: name: type: string description: Name of the site type: type: string description: Type of the site (e.g. openstack) contact_url: type: string description: Contact URL of the site appliances: type: array items: type: string description: Names of appliances objects SitePost: type: object required: - name - type - contact_url properties: name: type: string description: Name of the site type: type: string description: Type of the site (e.g. openstack) contact_url: type: string description: Contact URL of the site SitePatch: type: object properties: name: type: string description: Name of the site type: type: string description: Type of the site (e.g. openstack) contact_url: type: string description: Contact URL of the site Script: type: object properties: id: type: integer description: Unique identifier representing a specific script code: type: string description: Actual code of the script appliance: type: string description: Name of the associated appliance action: type: string description: Name of the associated action ScriptPost: type: object required: - code - appliance - action properties: code: type: string description: Actual code of the script appliance: type: string description: Name of the associated appliance action: type: string description: Name of the associated action ScriptPatch: type: object properties: code: type: string description: Actual code of the script appliance: type: string description: Name of the associated appliance action: type: string description: Name of the associated action User: type: object properties: id: type: integer description: Unique identifier representing a specific user username: type: string description: Name given to the user. operation_definitions: type: array description: Array of IDs of all the process descriptions created by the user items: type: integer definition: type: string description: JSON-formatted string containing all the information required to start the process 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