2018-05-02 16:40:56 +00:00
|
|
|
require 'swagger/blocks'
|
|
|
|
|
|
|
|
module DbExportApiDoc
|
|
|
|
include Swagger::Blocks
|
|
|
|
|
|
|
|
swagger_path '/api/v1/db-export' do
|
2018-05-02 19:47:17 +00:00
|
|
|
# Swagger documentation for /api/v1/db-export GET
|
2018-05-02 16:40:56 +00:00
|
|
|
operation :get do
|
2018-05-02 19:47:17 +00:00
|
|
|
key :description, 'Create a backup of the database as a file that can be re-imported to restore data.'
|
2018-05-02 16:40:56 +00:00
|
|
|
key :tags, [ 'db_export' ]
|
|
|
|
|
2018-05-08 17:38:04 +00:00
|
|
|
parameter :workspace
|
|
|
|
|
2018-05-02 16:40:56 +00:00
|
|
|
parameter do
|
|
|
|
key :in, :query
|
|
|
|
key :name, :path
|
|
|
|
key :required, true
|
|
|
|
key :description, 'The location to store the export file.'
|
|
|
|
end
|
|
|
|
|
|
|
|
parameter do
|
|
|
|
key :in, :query
|
|
|
|
key :name, :format
|
|
|
|
key :required, true
|
|
|
|
key :description, 'The file format to export as. Valid values are \'xml\' and \'pwdump\''
|
|
|
|
end
|
|
|
|
|
|
|
|
response 200 do
|
|
|
|
key :description, 'A JSON object containing the Base64 encoded backup file.'
|
|
|
|
schema do
|
2018-07-25 23:01:05 +00:00
|
|
|
property :data do
|
|
|
|
property :db_export_file do
|
|
|
|
key :type, :string
|
|
|
|
end
|
2018-05-02 16:40:56 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2018-07-26 02:46:33 +00:00
|
|
|
|
2018-08-14 18:35:59 +00:00
|
|
|
response 401 do
|
|
|
|
key :description, 'Authenticate to access this resource.'
|
|
|
|
schema do
|
|
|
|
key :'$ref', :AuthErrorModel
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-07-26 02:46:33 +00:00
|
|
|
response 500 do
|
|
|
|
key :description, 'An error occurred during the operation. See the message for more details.'
|
|
|
|
schema do
|
|
|
|
key :'$ref', :ErrorModel
|
|
|
|
end
|
|
|
|
end
|
2018-05-02 16:40:56 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|