Module: Cloudfront::Invalidation::Invalidations
- Included in:
- Cloudfront
- Defined in:
- lib/cloudfront/invalidation/invalidations.rb
Constant Summary collapse
- INVALIDATION_URL =
"/#{Cloudfront::Utils::Api.version}/distribution/%s/invalidation"
Instance Method Summary collapse
-
#invalidation_get(distribution_id, invalidation_id) ⇒ Faraday::Response
gets the invalidation information.
-
#invalidation_list(distribution_id, max_items = 0, marker = "") ⇒ Faraday::Response
Lists all the invalidations.
-
#invalidation_send(distribution_id, files, caller_reference = nil) ⇒ Faraday::Response
Invalidates files.
Instance Method Details
#invalidation_get(distribution_id, invalidation_id) ⇒ Faraday::Response
gets the invalidation information.
39 40 41 |
# File 'lib/cloudfront/invalidation/invalidations.rb', line 39 def invalidation_get(distribution_id, invalidation_id) connection.get INVALIDATION_URL % distribution_id + '/' + invalidation_id end |
#invalidation_list(distribution_id, max_items = 0, marker = "") ⇒ Faraday::Response
Lists all the invalidations.
27 28 29 30 31 32 33 |
# File 'lib/cloudfront/invalidation/invalidations.rb', line 27 def invalidation_list(distribution_id, max_items = 0, marker = "") connection.get do |request| request.url INVALIDATION_URL % distribution_id request.params['Marker'] = marker unless marker.nil? || marker.strip.empty? request.params['MaxItems'] = max_items if max_items > 0 end end |
#invalidation_send(distribution_id, files, caller_reference = nil) ⇒ Faraday::Response
Invalidates files
15 16 17 18 19 20 |
# File 'lib/cloudfront/invalidation/invalidations.rb', line 15 def invalidation_send(distribution_id, files, caller_reference = nil) connection.post do |request| request.url INVALIDATION_URL % distribution_id request.body = invalidation_body(files, caller_reference) end end |