Class: Waterworks::PipelineDefinition
- Inherits:
-
Object
- Object
- Waterworks::PipelineDefinition
- Defined in:
- lib/waterworks/containers/pipeline_definition.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
-
#pipeline_id ⇒ Object
Returns the value of attribute pipeline_id.
-
#pipeline_objects ⇒ Object
Returns the value of attribute pipeline_objects.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#uid ⇒ Object
Returns the value of attribute uid.
Instance Method Summary collapse
- #activate_pipeline! ⇒ Object
- #create_pipeline! ⇒ Object
- #go_baby_go! ⇒ Object
-
#initialize(uid, name, client = nil) ⇒ PipelineDefinition
constructor
A new instance of PipelineDefinition.
- #put_pipeline! ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(uid, name, client = nil) ⇒ PipelineDefinition
Returns a new instance of PipelineDefinition.
7 8 9 10 11 12 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 7 def initialize(uid, name, client = nil) @uid = uid @name = name client = Aws::DataPipeline::Client.new if client.nil? @client = client end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 5 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 5 def name @name end |
#pipeline_id ⇒ Object
Returns the value of attribute pipeline_id.
5 6 7 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 5 def pipeline_id @pipeline_id end |
#pipeline_objects ⇒ Object
Returns the value of attribute pipeline_objects.
5 6 7 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 5 def pipeline_objects @pipeline_objects end |
#tags ⇒ Object
Returns the value of attribute tags.
5 6 7 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 5 def end |
#uid ⇒ Object
Returns the value of attribute uid.
5 6 7 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 5 def uid @uid end |
Instance Method Details
#activate_pipeline! ⇒ Object
32 33 34 35 36 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 32 def activate_pipeline! @client.activate_pipeline( pipeline_id: @pipeline_id ) end |
#create_pipeline! ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 14 def create_pipeline! resp = @client.create_pipeline( name: @name, unique_id: @uid, description: @description, tags: [].flatten.map(&:to_hash) ) @pipeline_id = resp.pipeline_id resp end |
#go_baby_go! ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 38 def go_baby_go! responses = {} responses[:create] = create_pipeline! responses[:put] = put_pipeline! responses[:activate] = activate_pipeline! responses end |
#put_pipeline! ⇒ Object
25 26 27 28 29 30 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 25 def put_pipeline! @client.put_pipeline_definition( pipeline_id: @pipeline_id, pipeline_objects: @pipeline_objects.map(&:to_fhash) ) end |
#validate! ⇒ Object
46 47 48 |
# File 'lib/waterworks/containers/pipeline_definition.rb', line 46 def validate! @uid && @name && @pipeline_object.any? end |