Class: DTK::State::ExecutableAction
- Inherits:
-
Object
- Object
- DTK::State::ExecutableAction
- Defined in:
- lib/state/executable_action.rb,
lib/state/executable_action/attribute_type_info.rb
Defined Under Namespace
Classes: AttributeTypeInfo
Instance Attribute Summary collapse
-
#attribute_type_info ⇒ Object
readonly
Returns the value of attribute attribute_type_info.
-
#bash_script ⇒ Object
readonly
Returns the value of attribute bash_script.
-
#entrypoint ⇒ Object
readonly
Returns the value of attribute entrypoint.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params) ⇒ ExecutableAction
constructor
A new instance of ExecutableAction.
Constructor Details
#initialize(params) ⇒ ExecutableAction
Returns a new instance of ExecutableAction.
7 8 9 10 11 12 13 |
# File 'lib/state/executable_action.rb', line 7 def initialize(params) @name = params[:name] @entrypoint = params[:entrypoint] @type = params[:type] @bash_script = params[:bash_script] @attribute_type_info = AttributeTypeInfo.create_from_kube_hash(params[:attributes] || {}) end |
Instance Attribute Details
#attribute_type_info ⇒ Object (readonly)
Returns the value of attribute attribute_type_info.
5 6 7 |
# File 'lib/state/executable_action.rb', line 5 def attribute_type_info @attribute_type_info end |
#bash_script ⇒ Object (readonly)
Returns the value of attribute bash_script.
5 6 7 |
# File 'lib/state/executable_action.rb', line 5 def bash_script @bash_script end |
#entrypoint ⇒ Object (readonly)
Returns the value of attribute entrypoint.
5 6 7 |
# File 'lib/state/executable_action.rb', line 5 def entrypoint @entrypoint end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/state/executable_action.rb', line 5 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/state/executable_action.rb', line 5 def type @type end |
Class Method Details
.get(crd_assembly_namespace, crd_assembly_name, component_name, action_name, opts = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/state/executable_action.rb', line 15 def self.get(crd_assembly_namespace, crd_assembly_name, component_name, action_name, opts = {}) component_obj = Component.get(crd_assembly_namespace, crd_assembly_name, component_name, opts) actions = component_obj.component_def.executable_actions action = actions[action_name] raise Error.new("Unable to find action '#{action_name}'") unless action ExecutableAction.new( { name: action_name, entrypoint: action[:entrypoint] || '', type: action[:type] || '', bash_script: action[:bash_script] || '', attributes: action[:attributes] || {} } ) end |