Class: Fog::AWS::DataPipeline::Pipeline

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/data_pipeline/pipeline.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Pipeline

Returns a new instance of Pipeline.



16
17
18
19
20
21
22
23
24
25
# File 'lib/fog/aws/models/data_pipeline/pipeline.rb', line 16

def initialize(attributes={})
  # Extract the 'fields' portion of a response to attributes
  if attributes.include?('fields')
    string_fields = attributes['fields'].select { |f| f.include?('stringValue') }
    field_attributes = Hash[string_fields.map { |f| [f['key'][/^@(.+)$/, 1], f['stringValue']] }]
    merge_attributes(field_attributes)
  end

  super
end

Instance Method Details

#activateObject



37
38
39
40
41
42
43
# File 'lib/fog/aws/models/data_pipeline/pipeline.rb', line 37

def activate
  requires :id

  service.activate_pipeline(id)

  true
end

#destroyObject



53
54
55
56
57
58
59
# File 'lib/fog/aws/models/data_pipeline/pipeline.rb', line 53

def destroy
  requires :id

  service.delete_pipeline(id)

  true
end

#put(objects) ⇒ Object



45
46
47
48
49
50
51
# File 'lib/fog/aws/models/data_pipeline/pipeline.rb', line 45

def put(objects)
  requires :id

  service.put_pipeline_definition(id, objects)

  true
end

#saveObject



27
28
29
30
31
32
33
34
35
# File 'lib/fog/aws/models/data_pipeline/pipeline.rb', line 27

def save
  requires :name
  requires :unique_id

  data = service.create_pipeline(unique_id, name, nil, tags)
  merge_attributes(data)

  true
end