From 22136f31a647902e3ff28b5302a7eafa4924696e Mon Sep 17 00:00:00 2001 From: Pieter Michels Date: Sun, 6 Feb 2011 10:08:37 +0100 Subject: [PATCH 1/5] Version bump to 2.4.3 --- VERSION.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.yml b/VERSION.yml index 406d992..a3896db 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,5 +1,5 @@ --- :major: 2 :minor: 4 -:patch: 2 +:patch: 3 :build: From ecf10da8ad75ecbc71aeab42697daac1b70a604b Mon Sep 17 00:00:00 2001 From: Pieter Michels Date: Sun, 6 Feb 2011 12:07:04 +0100 Subject: [PATCH 2/5] adding invalidation for cloudfront files --- lib/acf/acf_interface.rb | 25 +++++++++++++++++++++++++ lib/awsbase/awsbase.rb | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/lib/acf/acf_interface.rb b/lib/acf/acf_interface.rb index 9777125..011b569 100644 --- a/lib/acf/acf_interface.rb +++ b/lib/acf/acf_interface.rb @@ -208,6 +208,31 @@ def list_streaming_distributions request_hash = generate_request('GET', 'streaming-distribution') request_cache_or_info :list_streaming_distributions, request_hash, AcfStreamingDistributionListParser, @@bench end + + # Invalidate list of files + # + # acf.invalidate_files( 'distribution_id', + # ['path/to/file1', 'path/to/file2'], + # nil) + def invalidate_files(distribution_id, files=[], caller_reference='') + caller_reference ||= generate_call_reference + + files_str = '' + files.to_a.each { |file_path| files_str += "\n #{file_path}" } + + body = <<-EOXML + + + #{files_str.lstrip} + #{caller_reference} + + EOXML + + p body + + request_hash = generate_request('POST', "distribution/#{distribution_id}/invalidation", body.strip) + merge_headers(request_info(request_hash, AcfDistributionParser.new)) + end # Create a new distribution. # Returns the just created distribution or Aws::AwsError exception. diff --git a/lib/awsbase/awsbase.rb b/lib/awsbase/awsbase.rb index 4067279..06620bf 100644 --- a/lib/awsbase/awsbase.rb +++ b/lib/awsbase/awsbase.rb @@ -221,8 +221,8 @@ def generate_request2(aws_access_key, aws_secret_key, action, api_version, lib_p request = Net::HTTP::Get.new("#{service}?#{service_params}") end - #puts "\n\n --------------- QUERY REQUEST TO AWS -------------- \n\n" - #puts "#{@params[:service]}?#{service_params}\n\n" + puts "\n\n --------------- QUERY REQUEST TO AWS -------------- \n\n" + puts "#{@params[:service]}?#{service_params}\n\n" # prepare output hash {:request => request, From d64ac059e8ecc247d762abdcfad69c9e119a60d8 Mon Sep 17 00:00:00 2001 From: Pieter Michels Date: Sun, 6 Feb 2011 20:05:52 +0100 Subject: [PATCH 3/5] added invalidation method --- lib/acf/acf_interface.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/acf/acf_interface.rb b/lib/acf/acf_interface.rb index 011b569..049052a 100644 --- a/lib/acf/acf_interface.rb +++ b/lib/acf/acf_interface.rb @@ -210,11 +210,13 @@ def list_streaming_distributions end # Invalidate list of files + # Returns the just created Invalidation or Aws::AwsError exception. # - # acf.invalidate_files( 'distribution_id', + # acf.invalidate_files( 'distribution-id', # ['path/to/file1', 'path/to/file2'], - # nil) - def invalidate_files(distribution_id, files=[], caller_reference='') + # 'some-id-string') + # + def invalidate_files(distribution_id, files=[], caller_reference=nil) caller_reference ||= generate_call_reference files_str = '' @@ -228,8 +230,6 @@ def invalidate_files(distribution_id, files=[], caller_reference='') EOXML - p body - request_hash = generate_request('POST', "distribution/#{distribution_id}/invalidation", body.strip) merge_headers(request_info(request_hash, AcfDistributionParser.new)) end From 3d8750303a35ffac2287c8b1dbb58cc8f4808ece Mon Sep 17 00:00:00 2001 From: Pieter Michels Date: Sun, 6 Feb 2011 20:16:45 +0100 Subject: [PATCH 4/5] adding info to readme --- README.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.markdown b/README.markdown index eb48290..abb84d1 100644 --- a/README.markdown +++ b/README.markdown @@ -1,3 +1,6 @@ +# Forked from appoxy +Added invalidation method for Cloudfront + # Appoxy AWS Library A Ruby gem for all Amazon Web Services. From d447daf1734d5f3994fd4d56dbd24a6a155135d9 Mon Sep 17 00:00:00 2001 From: Pieter Michels Date: Sun, 6 Feb 2011 20:18:41 +0100 Subject: [PATCH 5/5] modifying gemspec --- aws.gemspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aws.gemspec b/aws.gemspec index a66a8ee..4dfe903 100644 --- a/aws.gemspec +++ b/aws.gemspec @@ -1,15 +1,15 @@ # Generated by jeweler # DO NOT EDIT THIS FILE DIRECTLY -# Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec' +# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{aws} - s.version = "2.4.2" + s.version = "2.4.3" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Travis Reeder", "Chad Arimura", "RightScale"] - s.date = %q{2011-01-21} + s.date = %q{2011-02-06} s.description = %q{AWS Ruby Library for interfacing with Amazon Web Services including EC2, S3, SQS, SimpleDB and most of their other services as well. By http://www.appoxy.com} s.email = %q{travis@appoxy.com} s.extra_rdoc_files = [