Class: DTK::State::Workflow
- Inherits:
-
Object
- Object
- DTK::State::Workflow
- Defined in:
- lib/state/workflow.rb
Constant Summary collapse
- WORKFLOW_CRD_VERSION =
ENV["WORKFLOW_CRD_VERSION"]
Instance Attribute Summary collapse
-
#assembly ⇒ Object
readonly
Returns the value of attribute assembly.
-
#attribute_type_info ⇒ Object
readonly
Returns the value of attribute attribute_type_info.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#references ⇒ Object
readonly
Returns the value of attribute references.
-
#workflow ⇒ Object
readonly
Returns the value of attribute workflow.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(namespace, name, crd_content) ⇒ Workflow
constructor
A new instance of Workflow.
Constructor Details
#initialize(namespace, name, crd_content) ⇒ Workflow
Returns a new instance of Workflow.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/state/workflow.rb', line 9 def initialize(namespace, name, crd_content) @name = name @namespace = namespace @references = crd_content.references @assembly = @references.assembly @workflow = crd_content.spec.workflow || {} @attribute_type_info = ::DTK::State::WorkflowInstance::AttributeTypeInfo.create_from_kube_hash(crd_content.spec.attributes.to_h || {}) end |
Instance Attribute Details
#assembly ⇒ Object (readonly)
Returns the value of attribute assembly.
7 8 9 |
# File 'lib/state/workflow.rb', line 7 def assembly @assembly end |
#attribute_type_info ⇒ Object (readonly)
Returns the value of attribute attribute_type_info.
7 8 9 |
# File 'lib/state/workflow.rb', line 7 def attribute_type_info @attribute_type_info end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/state/workflow.rb', line 7 def name @name end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
7 8 9 |
# File 'lib/state/workflow.rb', line 7 def namespace @namespace end |
#references ⇒ Object (readonly)
Returns the value of attribute references.
7 8 9 |
# File 'lib/state/workflow.rb', line 7 def references @references end |
#workflow ⇒ Object (readonly)
Returns the value of attribute workflow.
7 8 9 |
# File 'lib/state/workflow.rb', line 7 def workflow @workflow end |
Class Method Details
.get(namespace, name, opts = {}) ⇒ Object
20 21 22 23 24 |
# File 'lib/state/workflow.rb', line 20 def self.get(namespace, name, opts = {}) opts[:apiVersion] = WORKFLOW_CRD_VERSION workflow = ::DTK::CrdClient.get_kubeclient(opts).get_workflow(name, namespace) Workflow.new(namespace, name, workflow) end |