Class: Fog::AWS::CDN::Invalidation
- Inherits:
-
Model
- Object
- Model
- Fog::AWS::CDN::Invalidation
- Defined in:
- lib/fog/aws/models/cdn/invalidation.rb
Instance Method Summary collapse
- #destroy ⇒ Object
- #distribution ⇒ Object
-
#initialize(new_attributes = {}) ⇒ Invalidation
constructor
A new instance of Invalidation.
- #ready? ⇒ Boolean
- #save ⇒ Object
Constructor Details
#initialize(new_attributes = {}) ⇒ Invalidation
Returns a new instance of Invalidation.
12 13 14 15 |
# File 'lib/fog/aws/models/cdn/invalidation.rb', line 12 def initialize(new_attributes={}) new_attributes[:caller_reference] ||= Time.now.utc.to_i.to_s super(invalidation_to_attributes(new_attributes)) end |
Instance Method Details
#destroy ⇒ Object
34 35 36 37 |
# File 'lib/fog/aws/models/cdn/invalidation.rb', line 34 def destroy # invalidations can't be removed, but tests are requiring they do :) true end |
#distribution ⇒ Object
17 18 19 |
# File 'lib/fog/aws/models/cdn/invalidation.rb', line 17 def distribution @distribution end |
#ready? ⇒ Boolean
21 22 23 24 |
# File 'lib/fog/aws/models/cdn/invalidation.rb', line 21 def ready? requires :id, :status status == 'Completed' end |
#save ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/fog/aws/models/cdn/invalidation.rb', line 26 def save requires :paths, :caller_reference raise "Submitted invalidation cannot be submitted again" if persisted? response = service.post_invalidation(distribution.identity, paths, caller_reference) merge_attributes(invalidation_to_attributes(response.body)) true end |