Class: Qurd::Action Abstract
- Inherits:
-
Object
- Object
- Qurd::Action
- Extended by:
- Forwardable, Mixins::AwsClients, Mixins::Configuration
- Includes:
- Mixins::AwsClients, Mixins::Configuration
- Defined in:
- lib/qurd/action.rb,
lib/qurd/action/chef.rb,
lib/qurd/action/dummy.rb,
lib/qurd/action/route53.rb
Overview
Subclass and override #launch, #launch_error, #terminate, #terminate_error, and #test, optionally override class method #Qurd#Qurd::Action#Qurd::Action.configure and instance methods #run_before and #run_after
Defined Under Namespace
Classes: Chef, Dummy, InvalidMessage, Route53
Instance Attribute Summary collapse
- #aws_credentials ⇒ Aws::Credentials readonly
- #chef_client ⇒ Chef::ApiClient
- #chef_node ⇒ Chef::Node
-
#context ⇒ Cabin::Context
readonly
The logging context.
- #failed? ⇒ Boolean readonly
- #instance ⇒ Struct readonly
- #instance_id ⇒ String readonly
- #instance_name ⇒ String readonly
-
#message ⇒ Object
readonly
Returns the value of attribute message.
- #name ⇒ String readonly
- #region ⇒ String readonly
Class Method Summary collapse
-
.configure(_action) ⇒ Object
Optionally configure the plugin
launch,launch_error,terminate,terminate_error, ortest.
Instance Method Summary collapse
-
#failed!(e) ⇒ Aws::Credentials
Log an action failure, setting the Qurd::Message.
-
#initialize(message) ⇒ Action
constructor
Run the plugin for a given Message.
- #inspect ⇒ Object
-
#launch ⇒ Object
(also: #launch_error, #terminate, #terminate_error, #test)
Run the plugin.
-
#run_after ⇒ Object
Executed after the processor runs the plugins for an action.
-
#run_before ⇒ Object
Executed before the processor runs the plugins for an action.
Methods included from Mixins::Configuration
qurd_config, qurd_configuration, qurd_logger, qurd_logger!
Methods included from Mixins::AwsClients
Constructor Details
Instance Attribute Details
#aws_credentials ⇒ Aws::Credentials (readonly)
26 |
# File 'lib/qurd/action.rb', line 26 def_delegator :@message, :aws_credentials, :aws_credentials |
#chef_client ⇒ Chef::ApiClient
29 |
# File 'lib/qurd/action.rb', line 29 def_delegator :@message, :chef_client, :chef_client |
#chef_node ⇒ Chef::Node
33 |
# File 'lib/qurd/action.rb', line 33 def_delegator :@message, :chef_node, :chef_node |
#context ⇒ Cabin::Context (readonly)
The logging context
64 65 66 |
# File 'lib/qurd/action.rb', line 64 def context @context end |
#failed? ⇒ Boolean (readonly)
42 |
# File 'lib/qurd/action.rb', line 42 def_delegator :@message, :failed?, :failed? |
#instance ⇒ Struct (readonly)
51 |
# File 'lib/qurd/action.rb', line 51 def_delegator :@message, :instance, :instance |
#instance_id ⇒ String (readonly)
45 |
# File 'lib/qurd/action.rb', line 45 def_delegator :@message, :instance_id, :instance_id |
#instance_name ⇒ String (readonly)
48 |
# File 'lib/qurd/action.rb', line 48 def_delegator :@message, :instance_name, :instance_name |
#message ⇒ Object (readonly)
Returns the value of attribute message.
64 |
# File 'lib/qurd/action.rb', line 64 attr_reader :context, :message |
#name ⇒ String (readonly)
54 |
# File 'lib/qurd/action.rb', line 54 def_delegator :@message, :name, :name |
#region ⇒ String (readonly)
57 |
# File 'lib/qurd/action.rb', line 57 def_delegator :@message, :region, :region |
Class Method Details
.configure(_action) ⇒ Object
Optionally configure the plugin launch, launch_error, terminate, terminate_error, or test
69 70 71 |
# File 'lib/qurd/action.rb', line 69 def self.configure(_action) qurd_logger.debug('Nothing to do') end |
Instance Method Details
#failed!(e) ⇒ Aws::Credentials
Log an action failure, setting the Qurd::Message
39 |
# File 'lib/qurd/action.rb', line 39 def_delegator :@message, :failed!, :failed! |
#inspect ⇒ Object
108 109 110 111 112 113 114 115 116 |
# File 'lib/qurd/action.rb', line 108 def inspect format('<%s:%x instance_id:%s message_id:%s context:%s>', self.class, object_id, .instance_id, ., context.inspect ) end |
#launch ⇒ Object Also known as: launch_error, terminate, terminate_error, test
Run the plugin
94 95 96 |
# File 'lib/qurd/action.rb', line 94 def launch qurd_logger!("Override the abstract method #{__method__}") end |
#run_after ⇒ Object
Executed after the processor runs the plugins for an action
104 105 106 |
# File 'lib/qurd/action.rb', line 104 def run_after qurd_logger.debug('Nothing to do') end |
#run_before ⇒ Object
Executed before the processor runs the plugins for an action
89 90 91 |
# File 'lib/qurd/action.rb', line 89 def run_before qurd_logger.debug('Nothing to do') end |