swagger: '2.0' info: description: 'Manage your databases using our API' version: '1.0.0' title: 'DBaaS' termsOfService: '#' contact: email: 'info@liara.ir' host: 'api.iran.liara.ir' schemes: - 'https' consumes: - Databaselication/json produces: - Databaselication/json securityDefinitions: jwt: type: apiKey name: Authorization in: header description: >- Enter the token with the `Bearer: ` prefix, e.g. "Bearer abcde12345". # security: - jwt: [] paths: '/v1/databases/{database-id}': delete: tags: - 'Databases' summary: 'Delete a database' description: 'delete a database that user owns' parameters: - in: path name: database-id required: true type: string responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database not found' get: tags: - 'Databases' summary: 'Get a database' description: 'get a database that user owns' parameters: - in: path name: database-id required: true type: string responses: 200: description: 'Successful operation' schema: $ref: '#/definitions/DB-details' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database not found' '/v1/databases': get: tags: - 'Databases' summary: 'Get all databases' description: 'get all databases that user owns' responses: 200: description: 'Successful operation' schema: $ref: '#/definitions/DBs-details' 400: description: 'Bad request' 401: description: 'Missing authentication' post: tags: - 'Databases' summary: 'Create a database' description: 'create a database that user owns' parameters: - in: body name: Create a databases required: true schema: $ref: '#/definitions/Create-databases' responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 409: description: 'Conflict' '/v1/databases/{database-id}/actions/scale': post: tags: - 'Databases' summary: 'Power on or power off a database' description: 'power on or power off a database that user owns' parameters: - in: path name: database-id required: true type: string - in: body name: scale description: '1 for power on or 0 for power off' required: true schema: type: object required: - scale properties: scale: type: number enum: [0, 1] responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database not found' '/v1/databases/{database-id}/resize': post: tags: - 'Databases' summary: 'Resize a database' description: 'resize a database that user owns' parameters: - in: path name: database-id required: true type: string - in: body name: resize required: true schema: type: object required: - scale - planID properties: disk: type: boolean planID: type: string responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database not found' '/v1/databases/{database-id}/backups': get: tags: - 'Backups' summary: 'Get all backups' description: 'get all backups that user owns' parameters: - in: path name: database-id required: true type: string responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database not found' post: tags: - 'Backups' summary: 'Backup a database' description: 'backup a database that user owns' parameters: - in: path name: database-id required: true type: string responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database not found' '/v1/databases/{database-id}/backups/{backups-name}/download': post: tags: - 'Backups' summary: 'Download a backup' description: 'download a backup that user owns' parameters: - in: path name: database-id required: true type: string - in: path name: backups-name required: true type: string responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database not found' '/v1/databases/{database-id}/control-panel/{status}': post: tags: - 'Databases' summary: 'Change control-panel status' description: 'change control-panel status that user owns' parameters: - in: path name: database-id required: true type: string - in: path name: status required: true type: string enum: [enable, disable] responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database not found' 409: description: 'Conflict' '/v1/databases/{database-id}/public-network/{status}': patch: tags: - 'Databases' summary: 'Change public network status' description: 'change public network status that user owns' parameters: - in: path name: database-id required: true type: string - in: path name: status required: true type: string enum: [enable, disable] responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database not found' 409: description: 'Conflict' '/v1/databases/{database-id}/metrics/cpu?since={since}': get: tags: - 'Reports' summary: 'Get cpu reports of database' description: 'get cpu reports of database that user owns' parameters: - in: path name: database-id description: 'The name of your database' type: string required: true - in: path name: since description: 'The since of your cpu reports' type: number required: true responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database does not exists.' '/v1/databases/{database-id}/metrics/memory?since={since}': get: tags: - 'Reports' summary: 'Get memory reports of database' description: 'get memory reports of database that user owns' parameters: - in: path name: database-id description: 'The name of your database' type: string required: true - in: path name: since description: 'The since of your memory reports' type: number required: true responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database does not exists.' '/v1/databases/{database-id}/metrics/network-receive?since={since}': get: tags: - 'Reports' summary: 'Get network-receive reports of database' description: 'get network-receive reports of database that user owns' parameters: - in: path name: database-id description: 'The name of your database' type: string required: true - in: path name: since description: 'The since of your network-receive reports' type: number required: true responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database does not exists.' '/v1/databases/{database-id}/metrics/network-transmit?since={since}': get: tags: - 'Reports' summary: 'Get network-transmit reports of database' description: 'get network-transmit reports of database that user owns' parameters: - in: path name: database-id description: 'The name of your database' type: string required: true - in: path name: since description: 'The since of your network-transmit reports' type: number required: true responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database does not exists.' '/v1/databases/{database-id}/metrics/summary': get: tags: - 'Reports' summary: 'Get summary reports of database' description: 'get summary reports of database that user owns' parameters: - in: path name: database-id description: 'The name of your database' type: string required: true responses: 200: description: 'Successful operation' 400: description: 'Bad request' 401: description: 'Missing authentication' 404: description: 'Database does not exists.' definitions: Create-databases: properties: hostname: type: string description: 'The hostname of databases that you want to create' publicNetwork: type: boolean description: 'The publicNetwork of databases that you want to create' type: type: string description: 'The type of databases that you want to create' planID: type: string description: 'The planID of databases that you want to create' version: type: string description: 'The version of databases that you want to create' DB-details: properties: database: type: object properties: _id: type: string description: The ID of the database type: type: string description: The type of the database planID: type: string description: The plan ID status: type: string description: The status of the database scale: type: integer description: The scale of the database hostname: type: string description: The hostname of the database publicNetwork: type: boolean description: Indicates if the database is on a public network version: type: string description: The database version volumeSize: type: integer description: The size of the database volume metaData: type: object properties: standaloneReplicaSet: type: boolean description: Indicates if the database uses a standalone replica set privateNetwork: type: boolean description: Indicates if the database is on a private network created_at: type: string description: The creation timestamp of the database node: type: object properties: _id: type: string description: The ID of the database node host: type: string description: The host of the database node port: type: integer description: The port number for the database connection root_password: type: string description: The root password for the database internalPort: type: integer description: The internal port of the database id: type: string description: The unique ID of the database hourlyPrice: type: number description: The hourly price of the database username: type: string description: The username associated with the database DBs-details: properties: databases: type: array items: type: object properties: _id: type: string description: The ID of the database type: type: string description: The type of the database planID: type: string description: The plan ID status: type: string description: The status of the database scale: type: integer description: The scale of the database hostname: type: string description: The hostname of the database publicNetwork: type: boolean description: Indicates if the database is on a public network created_at: type: string description: The creation timestamp of the database internalPort: type: integer description: The internal port of the database id: type: string description: The unique ID of the database externalDocs: description: 'Find out more about DBaaS' url: 'http://liara.ir'