First pass at Event API doc
parent
249db505c8
commit
a11c7220b6
|
@ -0,0 +1,48 @@
|
|||
require 'swagger/blocks'
|
||||
|
||||
module EventApiDoc
|
||||
include Swagger::Blocks
|
||||
|
||||
# Swagger documentation for Event model
|
||||
swagger_schema :Event do
|
||||
key :required, [:id, :name]
|
||||
property :id, type: :integer, format: :int32
|
||||
property :created_at, type: :string, format: :date_time
|
||||
property :updated_at, type: :string, format: :date_time
|
||||
property :workspace_id, type: :integer, format: :int32
|
||||
property :name, type: :string
|
||||
property :critical, type: :string
|
||||
property :seen, type: :string
|
||||
property :username, type: :string
|
||||
property :info do
|
||||
key :type, :object
|
||||
property :revision, type: :string
|
||||
end
|
||||
end
|
||||
|
||||
swagger_path '/api/v1/events' do
|
||||
# Swagger documentation for /api/v1/events POST
|
||||
operation :post do
|
||||
key :description, 'Create a host.'
|
||||
key :tags, [ 'event' ]
|
||||
|
||||
parameter do
|
||||
key :in, :body
|
||||
key :name, :body
|
||||
key :description, 'The attributes to assign to the host'
|
||||
key :required, true
|
||||
schema do
|
||||
key :'$ref', :Event
|
||||
end
|
||||
end
|
||||
|
||||
response 200 do
|
||||
key :description, 'Successful operation'
|
||||
schema do
|
||||
key :type, :object
|
||||
key :'$ref', :Event
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -8,7 +8,7 @@ module RootApiDoc
|
|||
info do
|
||||
key :version, '1.0.0'
|
||||
key :title, 'Metasploit API'
|
||||
key :description, 'An API for interacting with Metasploit\'s data models'
|
||||
key :description, 'An API for interacting with Metasploit\'s data models.'
|
||||
license do
|
||||
key :name, 'BSD-3-clause'
|
||||
end
|
||||
|
@ -24,6 +24,7 @@ module RootApiDoc
|
|||
#################################
|
||||
tag name: 'credential', description: 'Credential operations.'
|
||||
tag name: 'db_export', description: 'Endpoint for generating and retrieving a database backup.'
|
||||
tag name: 'event', description: 'Event operations.'
|
||||
tag name: 'exploit', description: 'Exploit operations.'
|
||||
tag name: 'host', description: 'Host operations.'
|
||||
tag name: 'loot', description: 'Loot operations.'
|
||||
|
|
|
@ -2,6 +2,7 @@ require 'swagger/blocks'
|
|||
load 'documentation/api/v1/root_api_doc.rb'
|
||||
load 'documentation/api/v1/credential_api_doc.rb'
|
||||
load 'documentation/api/v1/db_export_api_doc.rb'
|
||||
load 'documentation/api/v1/event_api_doc.rb'
|
||||
load 'documentation/api/v1/exploit_api_doc.rb'
|
||||
load 'documentation/api/v1/host_api_doc.rb'
|
||||
load 'documentation/api/v1/loot_api_doc.rb'
|
||||
|
@ -39,6 +40,7 @@ module ApiDocsServlet
|
|||
RootApiDoc,
|
||||
CredentialApiDoc,
|
||||
DbExportApiDoc,
|
||||
EventApiDoc,
|
||||
ExploitApiDoc,
|
||||
HostApiDoc,
|
||||
LootApiDoc,
|
||||
|
|
Loading…
Reference in New Issue