Class: ZAWS::Command::CloudTrail
- Inherits:
-
Thor
- Object
- Thor
- ZAWS::Command::CloudTrail
- Defined in:
- lib/zaws/command/cloud_trail.rb
Instance Attribute Summary collapse
-
#aws ⇒ Object
Returns the value of attribute aws.
-
#out ⇒ Object
Returns the value of attribute out.
-
#print_exit_code ⇒ Object
Returns the value of attribute print_exit_code.
Instance Method Summary collapse
- #declare(name) ⇒ Object
-
#initialize(*args) ⇒ CloudTrail
constructor
A new instance of CloudTrail.
- #view ⇒ Object
Constructor Details
#initialize(*args) ⇒ CloudTrail
Returns a new instance of CloudTrail.
12 13 14 15 16 17 18 19 |
# File 'lib/zaws/command/cloud_trail.rb', line 12 def initialize(*args) super shellout=ZAWS::Helper::Shell.new awscli = ZAWS::AWSCLI.new(shellout) @aws = ZAWS::AWS.new(shellout,awscli) @out = $stdout @print_exit_code = false end |
Instance Attribute Details
#aws ⇒ Object
Returns the value of attribute aws.
8 9 10 |
# File 'lib/zaws/command/cloud_trail.rb', line 8 def aws @aws end |
#out ⇒ Object
Returns the value of attribute out.
9 10 11 |
# File 'lib/zaws/command/cloud_trail.rb', line 9 def out @out end |
#print_exit_code ⇒ Object
Returns the value of attribute print_exit_code.
10 11 12 |
# File 'lib/zaws/command/cloud_trail.rb', line 10 def print_exit_code @print_exit_code end |
Instance Method Details
#declare(name) ⇒ Object
36 37 38 |
# File 'lib/zaws/command/cloud_trail.rb', line 36 def declare(name) @aws.cloud_trail.declare(name,[:region],[:bucket] ? [:bucket] : "zaws-cloudtrail-#{name}") end |
#view ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/zaws/command/cloud_trail.rb', line 26 def view if [:bucket] @aws.cloud_trail.get_cloud_trail_by_bucket([:region], [:bucket], [:raw], [:verbose]?$stdout:nil) else @aws.cloud_trail.get_cloud_trail_by_name([:region], [:trailName] ? [:trailName] : 'default', [:raw], [:verbose]?@out:nil) end end |