summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2018-03-18 17:39:17 -0600
committermo <mo.khan@gmail.com>2018-03-18 17:39:17 -0600
commit8461526558c70eb0e8134432876655883a1f446b (patch)
tree728d63b42fa7a0254423086e1703a9a3173fd6d4
parente496812f1aa71d2fc98cf01f8efc032e2171b4a2 (diff)
add event types command.
-rw-r--r--lib/ats/amp4e/events.rb4
-rw-r--r--lib/ats/cli/amp4e/application.rb4
-rw-r--r--lib/ats/cli/amp4e/events.rb5
3 files changed, 11 insertions, 2 deletions
diff --git a/lib/ats/amp4e/events.rb b/lib/ats/amp4e/events.rb
index 4e06e21..eae98ae 100644
--- a/lib/ats/amp4e/events.rb
+++ b/lib/ats/amp4e/events.rb
@@ -10,6 +10,10 @@ module ATS
def list
api.get("events")
end
+
+ def types
+ api.get("event_types")
+ end
end
end
end
diff --git a/lib/ats/cli/amp4e/application.rb b/lib/ats/cli/amp4e/application.rb
index e1ed61a..327f13e 100644
--- a/lib/ats/cli/amp4e/application.rb
+++ b/lib/ats/cli/amp4e/application.rb
@@ -4,10 +4,10 @@ module ATS
class Application < Thor
class_option :profile, default: :default, required: false
- desc 'computers SUBCOMMAND ...ARGS', 'interact with the Threat Grid API'
+ desc 'computers SUBCOMMAND ...ARGS', 'interact with the AMP4E API'
subcommand :computers, ATS::CLI::AMP4E::Computers
- desc 'events SUBCOMMAND ...ARGS', 'interact with the Threat Grid API'
+ desc 'events SUBCOMMAND ...ARGS', 'interact with the AMP4E API'
subcommand :events, ATS::CLI::AMP4E::Events
end
end
diff --git a/lib/ats/cli/amp4e/events.rb b/lib/ats/cli/amp4e/events.rb
index aed9d85..75ee68f 100644
--- a/lib/ats/cli/amp4e/events.rb
+++ b/lib/ats/cli/amp4e/events.rb
@@ -8,6 +8,11 @@ module ATS
def list
print_json api.events.list
end
+
+ desc 'types', 'list'
+ def types
+ print_json api.events.types
+ end
end
end
end