Files
metasploit-gs/documentation/api/v1/exploit_api_doc.rb
T
James Barnett e3c913e104 First pass for Exploit API doc
Also fixed a few formatting issues in other docs
2018-05-02 14:47:17 -05:00

52 lines
1.4 KiB
Ruby

require 'swagger/blocks'
module ExploitApiDoc
include Swagger::Blocks
swagger_path '/api/v1/exploits' do
# Swagger documentation for /api/v1/exploits POST
operation :post do
key :description, 'Create an exploit entry.'
key :tags, [ 'exploit' ]
parameter do
key :in, :body
key :name, :body
key :description, 'The attributes to assign to the exploit.'
key :required, true
schema do
property :timestamp, type: :string, format: :date_time
property :module, type: :string
property :workspace, required: true, type: :string
property :port, type: :integer, format: :int32
property :proto, type: :string, enum: ['tcp','udp']
property :service, '$ref' => :Service
property :host, '$ref' => :Host
property :vuln, '$ref' => :Vuln
property :refs do
key :required, true
key :type, :array
items do
key :type, :string
end
end
property :exploit_report_attempt do
key :type, :string
key :enum, ['attempt', 'failure', 'success']
end
end
end
response 200 do
key :description, 'Successful operation.'
schema do
key :type, :object
key :'$ref', :Session
end
end
end
end
end