Files
metasploit-gs/documentation/api/v1/nmap_api_doc.rb
T

48 lines
1.3 KiB
Ruby
Raw Normal View History

2018-05-02 15:44:07 -05:00
require 'swagger/blocks'
module NmapApiDoc
include Swagger::Blocks
swagger_path '/api/v1/nmaps' do
2018-05-22 14:57:21 -05:00
# Swagger documentation for /api/v1/nmaps POST
2018-05-02 15:44:07 -05:00
operation :post do
key :description, 'Upload an Nmap XML file to be processed into corresponding Metasploit data objects.'
key :tags, [ 'nmap' ]
parameter do
key :in, :body
key :name, :body
key :required, true
schema do
2018-05-22 14:57:21 -05:00
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_EXAMPLE
2018-05-02 15:44:07 -05:00
property :filename, type: :string, required: true, description: 'The name of the file you are uploading.'
property :data, type: :string, required: true, description: 'The Base64 encoded contents of the Nmap XML file.'
end
end
response 200 do
key :description, 'A JSON object containing the Base64 encoded backup file.'
schema do
property :db_export_file do
key :type, :string
end
end
end
2018-07-25 21:46:33 -05:00
2018-08-14 13:35:59 -05:00
response 401 do
2018-08-15 15:26:35 -05:00
key :description, RootApiDoc::DEFAULT_RESPONSE_401
2018-08-14 13:35:59 -05:00
schema do
key :'$ref', :AuthErrorModel
end
end
2018-07-25 21:46:33 -05:00
response 500 do
2018-08-15 15:26:35 -05:00
key :description, RootApiDoc::DEFAULT_RESPONSE_500
2018-07-25 21:46:33 -05:00
schema do
key :'$ref', :ErrorModel
end
end
2018-05-02 15:44:07 -05:00
end
end
end