Class: Fog::AWS::CDN::Invalidations
- Inherits:
-
Collection
- Object
- Collection
- Fog::AWS::CDN::Invalidations
- Defined in:
- lib/fog/aws/models/cdn/invalidations.rb
Instance Method Summary collapse
Instance Method Details
#all(options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fog/aws/models/cdn/invalidations.rb', line 16 def all( = {}) requires :distribution [:max_items] ||= max_items .delete_if {|key, value| value.nil?} data = service.get_invalidation_list(distribution.identity, ).body merge_attributes(data.reject {|key, value| !['IsTruncated', 'MaxItems', 'NextMarker', 'Marker'].include?(key)}) load(data['InvalidationSummary']) end |
#get(invalidation_id) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/fog/aws/models/cdn/invalidations.rb', line 28 def get(invalidation_id) requires :distribution data = service.get_invalidation(distribution.identity, invalidation_id).body if data invalidation = new(data) else nil end rescue Excon::Errors::NotFound nil end |
#new(attributes = {}) ⇒ Object
42 43 44 45 |
# File 'lib/fog/aws/models/cdn/invalidations.rb', line 42 def new(attributes = {}) requires :distribution super({ :distribution => distribution }.merge!(attributes)) end |