fog-aws 3.2.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fog/aws.rb +1 -4
  3. data/lib/fog/aws/cdn.rb +15 -2
  4. data/lib/fog/aws/models/cdn/distribution.rb +4 -4
  5. data/lib/fog/aws/models/cdn/distribution_helper.rb +2 -2
  6. data/lib/fog/aws/models/cdn/distributions.rb +4 -4
  7. data/lib/fog/aws/models/cdn/distributions_helper.rb +2 -2
  8. data/lib/fog/aws/models/cdn/invalidation.rb +2 -2
  9. data/lib/fog/aws/models/cdn/invalidations.rb +3 -3
  10. data/lib/fog/aws/models/cdn/streaming_distribution.rb +3 -3
  11. data/lib/fog/aws/models/cdn/streaming_distributions.rb +4 -4
  12. data/lib/fog/aws/parsers/cdn/distribution.rb +2 -2
  13. data/lib/fog/aws/parsers/cdn/get_distribution_list.rb +2 -2
  14. data/lib/fog/aws/parsers/cdn/get_invalidation.rb +2 -2
  15. data/lib/fog/aws/parsers/cdn/get_invalidation_list.rb +2 -2
  16. data/lib/fog/aws/parsers/cdn/get_streaming_distribution_list.rb +2 -2
  17. data/lib/fog/aws/parsers/cdn/post_invalidation.rb +2 -2
  18. data/lib/fog/aws/parsers/cdn/streaming_distribution.rb +1 -1
  19. data/lib/fog/aws/requests/cdn/delete_distribution.rb +6 -6
  20. data/lib/fog/aws/requests/cdn/delete_streaming_distribution.rb +6 -6
  21. data/lib/fog/aws/requests/cdn/get_distribution.rb +5 -5
  22. data/lib/fog/aws/requests/cdn/get_distribution_list.rb +3 -3
  23. data/lib/fog/aws/requests/cdn/get_invalidation.rb +5 -5
  24. data/lib/fog/aws/requests/cdn/get_invalidation_list.rb +4 -4
  25. data/lib/fog/aws/requests/cdn/get_streaming_distribution.rb +5 -5
  26. data/lib/fog/aws/requests/cdn/get_streaming_distribution_list.rb +3 -3
  27. data/lib/fog/aws/requests/cdn/post_distribution.rb +6 -6
  28. data/lib/fog/aws/requests/cdn/post_invalidation.rb +5 -5
  29. data/lib/fog/aws/requests/cdn/post_streaming_distribution.rb +6 -6
  30. data/lib/fog/aws/requests/cdn/put_distribution_config.rb +7 -7
  31. data/lib/fog/aws/requests/cdn/put_streaming_distribution_config.rb +7 -7
  32. data/lib/fog/aws/service_mapper.rb +2 -2
  33. data/lib/fog/aws/version.rb +1 -1
  34. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b06f370b5dc8f1261cfe6c34c5c1c0fe55b0b162a1e406a4aa8dd7d19ae6109a
4
- data.tar.gz: 1e3ea64a2e8f5772f0fe36c2c02d2d025652ece1dd5608eb164d0f97c9acaf75
3
+ metadata.gz: 6102e30cc006be40adc471fd91d1ca9547fa46ac91703737aa3dc544ee577378
4
+ data.tar.gz: c73d52ba32eb89c42ae4f4307eaea8a3a9f06583dddaa5790f78b5207cdc7129
5
5
  SHA512:
6
- metadata.gz: e891f34795e0d49a960379482328fefdb413337cd9cce1064ec2768eb3bb51275d66857ee4c831e0b240c97a590955ddf46eec33cd179fb2136f7b9973e74609
7
- data.tar.gz: 763f9774a5f2ee8338077f3ed043b2fdfd864eb2fa20920c835f41ae29af28ebde7401f938114ebe69172c05152b9b70cba8d68f5f7881f7b551dd989a243cac
6
+ metadata.gz: 1567e0ebc839dedb5829b4d4292d28937cfaa93fb474a5424c4d5a7f423e2d3755e826ce853045cec540341dd7c626f5fd54c1423852f7d7e5930494286f01b2
7
+ data.tar.gz: 76deb66ad0ad18890effdef923160f0d81dfa46df074a9c6acf8d44b46901d3fb2cd53584121bfa959fe2b86e2d82f536b0754aee31d78691e30b4ebd22f12aa
@@ -5,10 +5,6 @@ require 'fog/json'
5
5
  require File.expand_path('../aws/version', __FILE__)
6
6
 
7
7
  module Fog
8
- module CDN
9
- autoload :AWS, File.expand_path('../aws/cdn', __FILE__)
10
- end
11
-
12
8
  module AWS
13
9
  extend Fog::Provider
14
10
 
@@ -20,6 +16,7 @@ module Fog
20
16
 
21
17
  # Services
22
18
  autoload :AutoScaling, File.expand_path('../aws/auto_scaling', __FILE__)
19
+ autoload :CDN, File.expand_path('../aws/cdn', __FILE__)
23
20
  autoload :CloudFormation, File.expand_path('../aws/cloud_formation', __FILE__)
24
21
  autoload :CloudWatch, File.expand_path('../aws/cloud_watch', __FILE__)
25
22
  autoload :Compute, File.expand_path('../aws/compute', __FILE__)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS < Fog::Service
2
+ module AWS
3
+ class CDN < Fog::Service
4
4
  extend Fog::AWS::CredentialFetcher::ServiceMethods
5
5
 
6
6
  requires :aws_access_key_id, :aws_secret_access_key
@@ -200,4 +200,17 @@ EOF
200
200
  end
201
201
  end
202
202
  end
203
+
204
+ # @deprecated
205
+ module CDN
206
+ # @deprecated
207
+ class AWS < Fog::AWS::CDN
208
+ # @deprecated
209
+ # @overrides Fog::Service.new (from the fog-core gem)
210
+ def self.new(*)
211
+ Fog::Logger.deprecation 'Fog::CDN::AWS is deprecated, please use Fog::AWS::CDN.'
212
+ super
213
+ end
214
+ end
215
+ end
203
216
  end
@@ -2,10 +2,10 @@ require 'fog/aws/models/cdn/invalidations'
2
2
  require 'fog/aws/models/cdn/distribution_helper'
3
3
 
4
4
  module Fog
5
- module CDN
6
- class AWS
5
+ module AWS
6
+ class CDN
7
7
  class Distribution < Fog::Model
8
- include Fog::CDN::AWS::DistributionHelper
8
+ include Fog::AWS::CDN::DistributionHelper
9
9
 
10
10
  identity :id, :aliases => 'Id'
11
11
 
@@ -33,7 +33,7 @@ module Fog
33
33
 
34
34
  def invalidations
35
35
  @invalidations ||= begin
36
- Fog::CDN::AWS::Invalidations.new(
36
+ Fog::AWS::CDN::Invalidations.new(
37
37
  :distribution => self,
38
38
  :service => service
39
39
  )
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  module DistributionHelper
5
5
  def destroy
6
6
  requires :identity, :etag, :caller_reference
@@ -2,12 +2,12 @@ require 'fog/aws/models/cdn/distribution'
2
2
  require 'fog/aws/models/cdn/distributions_helper'
3
3
 
4
4
  module Fog
5
- module CDN
6
- class AWS
5
+ module AWS
6
+ class CDN
7
7
  class Distributions < Fog::Collection
8
- include Fog::CDN::AWS::DistributionsHelper
8
+ include Fog::AWS::CDN::DistributionsHelper
9
9
 
10
- model Fog::CDN::AWS::Distribution
10
+ model Fog::AWS::CDN::Distribution
11
11
 
12
12
  attribute :marker, :aliases => 'Marker'
13
13
  attribute :max_items, :aliases => 'MaxItems'
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  module DistributionsHelper
5
5
 
6
6
  def all(options = {})
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Invalidation < Fog::Model
5
5
  identity :id, :aliases => 'Id'
6
6
 
@@ -1,8 +1,8 @@
1
1
  require 'fog/aws/models/cdn/invalidation'
2
2
 
3
3
  module Fog
4
- module CDN
5
- class AWS
4
+ module AWS
5
+ class CDN
6
6
  class Invalidations < Fog::Collection
7
7
  attribute :is_truncated, :aliases => ['IsTruncated']
8
8
  attribute :max_items, :aliases => ['MaxItems']
@@ -11,7 +11,7 @@ module Fog
11
11
 
12
12
  attribute :distribution
13
13
 
14
- model Fog::CDN::AWS::Invalidation
14
+ model Fog::AWS::CDN::Invalidation
15
15
 
16
16
  def all(options = {})
17
17
  requires :distribution
@@ -2,10 +2,10 @@ require 'fog/aws/models/cdn/invalidations'
2
2
  require 'fog/aws/models/cdn/distribution_helper'
3
3
 
4
4
  module Fog
5
- module CDN
6
- class AWS
5
+ module AWS
6
+ class CDN
7
7
  class StreamingDistribution < Fog::Model
8
- include Fog::CDN::AWS::DistributionHelper
8
+ include Fog::AWS::CDN::DistributionHelper
9
9
 
10
10
  identity :id, :aliases => 'Id'
11
11
 
@@ -2,12 +2,12 @@ require 'fog/aws/models/cdn/streaming_distribution'
2
2
  require 'fog/aws/models/cdn/distributions_helper'
3
3
 
4
4
  module Fog
5
- module CDN
6
- class AWS
5
+ module AWS
6
+ class CDN
7
7
  class StreamingDistributions < Fog::Collection
8
- include Fog::CDN::AWS::DistributionsHelper
8
+ include Fog::AWS::CDN::DistributionsHelper
9
9
 
10
- model Fog::CDN::AWS::StreamingDistribution
10
+ model Fog::AWS::CDN::StreamingDistribution
11
11
 
12
12
  attribute :marker, :aliases => 'Marker'
13
13
  attribute :max_items, :aliases => 'MaxItems'
@@ -1,7 +1,7 @@
1
1
  module Fog
2
2
  module Parsers
3
- module CDN
4
- module AWS
3
+ module AWS
4
+ module CDN
5
5
  class Distribution < Fog::Parsers::Base
6
6
  def reset
7
7
  @response = { 'DistributionConfig' => { 'CNAME' => [], 'Logging' => {}, 'TrustedSigners' => [] } }
@@ -1,7 +1,7 @@
1
1
  module Fog
2
2
  module Parsers
3
- module CDN
4
- module AWS
3
+ module AWS
4
+ module CDN
5
5
  class GetDistributionList < Fog::Parsers::Base
6
6
  def reset
7
7
  @distribution_summary = { 'CNAME' => [], 'TrustedSigners' => [] }
@@ -1,7 +1,7 @@
1
1
  module Fog
2
2
  module Parsers
3
- module CDN
4
- module AWS
3
+ module AWS
4
+ module CDN
5
5
  class GetInvalidation < Fog::Parsers::Base
6
6
  def reset
7
7
  @response = { 'InvalidationBatch' => { 'Path' => [] } }
@@ -1,7 +1,7 @@
1
1
  module Fog
2
2
  module Parsers
3
- module CDN
4
- module AWS
3
+ module AWS
4
+ module CDN
5
5
  class GetInvalidationList < Fog::Parsers::Base
6
6
  def reset
7
7
  @invalidation_summary = { }
@@ -1,7 +1,7 @@
1
1
  module Fog
2
2
  module Parsers
3
- module CDN
4
- module AWS
3
+ module AWS
4
+ module CDN
5
5
  class GetStreamingDistributionList < Fog::Parsers::Base
6
6
  def reset
7
7
  @distribution_summary = { 'CNAME' => [], 'TrustedSigners' => [] }
@@ -1,7 +1,7 @@
1
1
  module Fog
2
2
  module Parsers
3
- module CDN
4
- module AWS
3
+ module AWS
4
+ module CDN
5
5
  class PostInvalidation < Fog::Parsers::Base
6
6
  def reset
7
7
  @response = { 'InvalidationBatch' => { 'Path' => [] } }
@@ -1,7 +1,7 @@
1
1
  module Fog
2
2
  module Parsers
3
+ module AWS
3
4
  module CDN
4
- module AWS
5
5
 
6
6
  class StreamingDistribution < Fog::Parsers::Base
7
7
  def reset
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  # Delete a distribution from CloudFront.
6
6
  #
@@ -26,13 +26,13 @@ module Fog
26
26
 
27
27
  if distribution
28
28
  if distribution['ETag'] != etag
29
- Fog::CDN::AWS::Mock.error(:invalid_if_match_version)
29
+ Fog::AWS::CDN::Mock.error(:invalid_if_match_version)
30
30
  end
31
31
  unless distribution['DistributionConfig']['CallerReference']
32
- Fog::CDN::AWS::Mock.error(:illegal_update)
32
+ Fog::AWS::CDN::Mock.error(:illegal_update)
33
33
  end
34
34
  if distribution['DistributionConfig']['Enabled']
35
- Fog::CDN::AWS::Mock.error(:distribution_not_disabled)
35
+ Fog::AWS::CDN::Mock.error(:distribution_not_disabled)
36
36
  end
37
37
 
38
38
  self.data[:distributions].delete(distribution_id)
@@ -43,7 +43,7 @@ module Fog
43
43
  response.body = "x-amz-request-id: #{Fog::AWS::Mock.request_id}"
44
44
  response
45
45
  else
46
- Fog::CDN::AWS::Mock.error(:no_such_distribution)
46
+ Fog::AWS::CDN::Mock.error(:no_such_distribution)
47
47
  end
48
48
  end
49
49
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  # Delete a streaming distribution from CloudFront.
6
6
  #
@@ -26,13 +26,13 @@ module Fog
26
26
 
27
27
  if distribution
28
28
  if distribution['ETag'] != etag
29
- Fog::CDN::AWS::Mock.error(:invalid_if_match_version)
29
+ Fog::AWS::CDN::Mock.error(:invalid_if_match_version)
30
30
  end
31
31
  unless distribution['StreamingDistributionConfig']['CallerReference']
32
- Fog::CDN::AWS::Mock.error(:illegal_update)
32
+ Fog::AWS::CDN::Mock.error(:illegal_update)
33
33
  end
34
34
  if distribution['StreamingDistributionConfig']['Enabled']
35
- Fog::CDN::AWS::Mock.error(:distribution_not_disabled)
35
+ Fog::AWS::CDN::Mock.error(:distribution_not_disabled)
36
36
  end
37
37
 
38
38
  self.data[:streaming_distributions].delete(distribution_id)
@@ -42,7 +42,7 @@ module Fog
42
42
  response.body = "x-amz-request-id: #{Fog::AWS::Mock.request_id}"
43
43
  response
44
44
  else
45
- Fog::CDN::AWS::Mock.error(:no_such_streaming_distribution)
45
+ Fog::AWS::CDN::Mock.error(:no_such_streaming_distribution)
46
46
  end
47
47
  end
48
48
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  require 'fog/aws/parsers/cdn/distribution'
6
6
 
@@ -42,7 +42,7 @@ module Fog
42
42
  :expects => 200,
43
43
  :idempotent => true,
44
44
  :method => 'GET',
45
- :parser => Fog::Parsers::CDN::AWS::Distribution.new,
45
+ :parser => Fog::Parsers::AWS::CDN::Distribution.new,
46
46
  :path => "/distribution/#{distribution_id}"
47
47
  })
48
48
  end
@@ -54,14 +54,14 @@ module Fog
54
54
 
55
55
  distribution = self.data[:distributions][distribution_id]
56
56
  unless distribution
57
- Fog::CDN::AWS::Mock.error(:no_such_distribution)
57
+ Fog::AWS::CDN::Mock.error(:no_such_distribution)
58
58
  end
59
59
 
60
60
  if distribution['Status'] == 'InProgress' && (Time.now - Time.parse(distribution['LastModifiedTime']) >= Fog::Mock.delay * 2)
61
61
  distribution['Status'] = 'Deployed'
62
62
  end
63
63
 
64
- etag = Fog::CDN::AWS::Mock.generic_id
64
+ etag = Fog::AWS::CDN::Mock.generic_id
65
65
  response.status = 200
66
66
  response.body = {
67
67
  'InProgressInvalidationBatches' => 0,
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  require 'fog/aws/parsers/cdn/get_distribution_list'
6
6
 
@@ -42,7 +42,7 @@ module Fog
42
42
  :expects => 200,
43
43
  :idempotent => true,
44
44
  :method => 'GET',
45
- :parser => Fog::Parsers::CDN::AWS::GetDistributionList.new,
45
+ :parser => Fog::Parsers::AWS::CDN::GetDistributionList.new,
46
46
  :path => "/distribution",
47
47
  :query => options
48
48
  })
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  require 'fog/aws/parsers/cdn/get_invalidation'
6
6
 
@@ -24,7 +24,7 @@ module Fog
24
24
  :expects => 200,
25
25
  :idempotent => true,
26
26
  :method => 'GET',
27
- :parser => Fog::Parsers::CDN::AWS::GetInvalidation.new,
27
+ :parser => Fog::Parsers::AWS::CDN::GetInvalidation.new,
28
28
  :path => "/distribution/#{distribution_id}/invalidation/#{invalidation_id}"
29
29
  })
30
30
  end
@@ -34,12 +34,12 @@ module Fog
34
34
  def get_invalidation(distribution_id, invalidation_id)
35
35
  distribution = self.data[:distributions][distribution_id]
36
36
  unless distribution
37
- Fog::CDN::AWS::Mock.error(:no_such_distribution)
37
+ Fog::AWS::CDN::Mock.error(:no_such_distribution)
38
38
  end
39
39
 
40
40
  invalidation = self.data[:invalidations][distribution_id][invalidation_id]
41
41
  unless invalidation
42
- Fog::CDN::AWS::Mock.error(:no_such_invalidation)
42
+ Fog::AWS::CDN::Mock.error(:no_such_invalidation)
43
43
  end
44
44
 
45
45
  if invalidation['Status'] == 'InProgress' && (Time.now - Time.parse(invalidation['CreateTime']) >= Fog::Mock.delay * 2)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  require 'fog/aws/parsers/cdn/get_invalidation_list'
6
6
 
@@ -27,7 +27,7 @@ module Fog
27
27
  :expects => 200,
28
28
  :idempotent => true,
29
29
  :method => 'GET',
30
- :parser => Fog::Parsers::CDN::AWS::GetInvalidationList.new,
30
+ :parser => Fog::Parsers::AWS::CDN::GetInvalidationList.new,
31
31
  :path => "/distribution/#{distribution_id}/invalidation",
32
32
  :query => options
33
33
  })
@@ -38,7 +38,7 @@ module Fog
38
38
  def get_invalidation_list(distribution_id, options = {})
39
39
  distribution = self.data[:distributions][distribution_id]
40
40
  unless distribution
41
- Fog::CDN::AWS::Mock.error(:no_such_distribution)
41
+ Fog::AWS::CDN::Mock.error(:no_such_distribution)
42
42
  end
43
43
 
44
44
  invalidations = (self.data[:invalidations][distribution_id] || {}).values
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  require 'fog/aws/parsers/cdn/streaming_distribution'
6
6
 
@@ -35,7 +35,7 @@ module Fog
35
35
  :expects => 200,
36
36
  :idempotent => true,
37
37
  :method => 'GET',
38
- :parser => Fog::Parsers::CDN::AWS::StreamingDistribution.new,
38
+ :parser => Fog::Parsers::AWS::CDN::StreamingDistribution.new,
39
39
  :path => "/streaming-distribution/#{distribution_id}"
40
40
  })
41
41
  end
@@ -47,14 +47,14 @@ module Fog
47
47
 
48
48
  distribution = self.data[:streaming_distributions][distribution_id]
49
49
  unless distribution
50
- Fog::CDN::AWS::Mock.error(:no_such_streaming_distribution)
50
+ Fog::AWS::CDN::Mock.error(:no_such_streaming_distribution)
51
51
  end
52
52
 
53
53
  if distribution['Status'] == 'InProgress' && (Time.now - Time.parse(distribution['LastModifiedTime']) >= Fog::Mock.delay * 2)
54
54
  distribution['Status'] = 'Deployed'
55
55
  end
56
56
 
57
- etag = Fog::CDN::AWS::Mock.generic_id
57
+ etag = Fog::AWS::CDN::Mock.generic_id
58
58
  response.status = 200
59
59
  response.body = distribution.reject { |k,v| k == 'ETag' }
60
60
 
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  require 'fog/aws/parsers/cdn/get_streaming_distribution_list'
6
6
 
@@ -42,7 +42,7 @@ module Fog
42
42
  :expects => 200,
43
43
  :idempotent => true,
44
44
  :method => 'GET',
45
- :parser => Fog::Parsers::CDN::AWS::GetStreamingDistributionList.new,
45
+ :parser => Fog::Parsers::AWS::CDN::GetStreamingDistributionList.new,
46
46
  :path => "/streaming-distribution",
47
47
  :query => options
48
48
  })
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  require 'fog/aws/parsers/cdn/distribution'
6
6
 
@@ -77,7 +77,7 @@ module Fog
77
77
  :headers => { 'Content-Type' => 'text/xml' },
78
78
  :idempotent => true,
79
79
  :method => 'POST',
80
- :parser => Fog::Parsers::CDN::AWS::Distribution.new,
80
+ :parser => Fog::Parsers::AWS::CDN::Distribution.new,
81
81
  :path => "/distribution"
82
82
  })
83
83
  end
@@ -88,7 +88,7 @@ module Fog
88
88
 
89
89
  def post_distribution(options = {})
90
90
  if self.data[:distributions].values.any? { |d| (d['CNAME'] & (options['CNAME']||[])).empty? }
91
- Fog::CDN::AWS::Mock.error(:invalid_argument, 'CNAME is already in use')
91
+ Fog::AWS::CDN::Mock.error(:invalid_argument, 'CNAME is already in use')
92
92
  end
93
93
 
94
94
  response = Excon::Response.new
@@ -96,10 +96,10 @@ module Fog
96
96
  response.status = 201
97
97
  options['CallerReference'] = Time.now.to_i.to_s
98
98
 
99
- dist_id = Fog::CDN::AWS::Mock.distribution_id
99
+ dist_id = Fog::AWS::CDN::Mock.distribution_id
100
100
 
101
101
  distribution = {
102
- 'DomainName' => Fog::CDN::AWS::Mock.domain_name,
102
+ 'DomainName' => Fog::AWS::CDN::Mock.domain_name,
103
103
  'Id' => dist_id,
104
104
  'Status' => 'InProgress',
105
105
  'LastModifiedTime' => Time.now.utc.iso8601,
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  require 'fog/aws/parsers/cdn/post_invalidation'
6
6
 
@@ -35,7 +35,7 @@ module Fog
35
35
  :headers => {'Content-Type' => 'text/xml'},
36
36
  :idempotent => true,
37
37
  :method => 'POST',
38
- :parser => Fog::Parsers::CDN::AWS::PostInvalidation.new,
38
+ :parser => Fog::Parsers::AWS::CDN::PostInvalidation.new,
39
39
  :path => "/distribution/#{distribution_id}/invalidation"
40
40
  })
41
41
  end
@@ -45,7 +45,7 @@ module Fog
45
45
  def post_invalidation(distribution_id, paths, caller_reference = Time.now.to_i.to_s)
46
46
  distribution = self.data[:distributions][distribution_id]
47
47
  if distribution
48
- invalidation_id = Fog::CDN::AWS::Mock.distribution_id
48
+ invalidation_id = Fog::AWS::CDN::Mock.distribution_id
49
49
  invalidation = {
50
50
  'Id' => invalidation_id,
51
51
  'Status' => 'InProgress',
@@ -66,7 +66,7 @@ module Fog
66
66
  response.body = invalidation
67
67
  response
68
68
  else
69
- Fog::CDN::AWS::Mock.error(:no_such_distribution)
69
+ Fog::AWS::CDN::Mock.error(:no_such_distribution)
70
70
  end
71
71
  end
72
72
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  require 'fog/aws/parsers/cdn/streaming_distribution'
6
6
 
@@ -64,7 +64,7 @@ module Fog
64
64
  :headers => { 'Content-Type' => 'text/xml' },
65
65
  :idempotent => true,
66
66
  :method => 'POST',
67
- :parser => Fog::Parsers::CDN::AWS::StreamingDistribution.new,
67
+ :parser => Fog::Parsers::AWS::CDN::StreamingDistribution.new,
68
68
  :path => "/streaming-distribution"
69
69
  })
70
70
  end
@@ -75,7 +75,7 @@ module Fog
75
75
 
76
76
  def post_streaming_distribution(options = {})
77
77
  if self.data[:streaming_distributions].values.any? { |d| (d['CNAME'] & (options['CNAME']||[])).empty? }
78
- Fog::CDN::AWS::Mock.error(:invalid_argument, 'CNAME is already in use')
78
+ Fog::AWS::CDN::Mock.error(:invalid_argument, 'CNAME is already in use')
79
79
  end
80
80
 
81
81
  response = Excon::Response.new
@@ -83,10 +83,10 @@ module Fog
83
83
  response.status = 201
84
84
  options['CallerReference'] = Time.now.to_i.to_s
85
85
 
86
- dist_id = Fog::CDN::AWS::Mock.distribution_id
86
+ dist_id = Fog::AWS::CDN::Mock.distribution_id
87
87
 
88
88
  distribution = {
89
- 'DomainName' => Fog::CDN::AWS::Mock.domain_name,
89
+ 'DomainName' => Fog::AWS::CDN::Mock.domain_name,
90
90
  'Id' => dist_id,
91
91
  'Status' => 'InProgress',
92
92
  'LastModifiedTime' => Time.now.utc.iso8601,
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  require 'fog/aws/parsers/cdn/distribution'
6
6
 
@@ -80,7 +80,7 @@ module Fog
80
80
  },
81
81
  :idempotent => true,
82
82
  :method => 'PUT',
83
- :parser => Fog::Parsers::CDN::AWS::Distribution.new,
83
+ :parser => Fog::Parsers::AWS::CDN::Distribution.new,
84
84
  :path => "/distribution/#{distribution_id}/config"
85
85
  })
86
86
  end
@@ -92,10 +92,10 @@ module Fog
92
92
 
93
93
  if distribution
94
94
  if distribution['ETag'] != etag
95
- Fog::CDN::AWS::Mock.error(:invalid_if_match_version)
95
+ Fog::AWS::CDN::Mock.error(:invalid_if_match_version)
96
96
  end
97
97
  unless distribution['DistributionConfig']['CallerReference']
98
- Fog::CDN::AWS::Mock.error(:illegal_update)
98
+ Fog::AWS::CDN::Mock.error(:illegal_update)
99
99
  end
100
100
 
101
101
  distribution['DistributionConfig'].merge!(options)
@@ -103,11 +103,11 @@ module Fog
103
103
 
104
104
  response = Excon::Response.new
105
105
  response.status = 200
106
- response.headers['ETag'] = Fog::CDN::AWS::Mock.generic_id
106
+ response.headers['ETag'] = Fog::AWS::CDN::Mock.generic_id
107
107
  response.body = distribution.merge({ 'LastModifiedTime' => Time.now.utc.iso8601 }).reject{ |k,v| k == 'ETag' }
108
108
  response
109
109
  else
110
- Fog::CDN::AWS::Mock.error(:no_such_distribution)
110
+ Fog::AWS::CDN::Mock.error(:no_such_distribution)
111
111
  end
112
112
  end
113
113
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module CDN
3
- class AWS
2
+ module AWS
3
+ class CDN
4
4
  class Real
5
5
  require 'fog/aws/parsers/cdn/streaming_distribution'
6
6
 
@@ -69,7 +69,7 @@ module Fog
69
69
  },
70
70
  :idempotent => true,
71
71
  :method => 'PUT',
72
- :parser => Fog::Parsers::CDN::AWS::StreamingDistribution.new,
72
+ :parser => Fog::Parsers::AWS::CDN::StreamingDistribution.new,
73
73
  :path => "/streaming-distribution/#{distribution_id}/config"
74
74
  })
75
75
  end
@@ -81,10 +81,10 @@ module Fog
81
81
 
82
82
  if distribution
83
83
  if distribution['ETag'] != etag
84
- Fog::CDN::AWS::Mock.error(:invalid_if_match_version)
84
+ Fog::AWS::CDN::Mock.error(:invalid_if_match_version)
85
85
  end
86
86
  unless distribution['StreamingDistributionConfig']['CallerReference']
87
- Fog::CDN::AWS::Mock.error(:illegal_update)
87
+ Fog::AWS::CDN::Mock.error(:illegal_update)
88
88
  end
89
89
 
90
90
  distribution['StreamingDistributionConfig'].merge!(options)
@@ -92,11 +92,11 @@ module Fog
92
92
 
93
93
  response = Excon::Response.new
94
94
  response.status = 200
95
- response.headers['ETag'] = Fog::CDN::AWS::Mock.generic_id
95
+ response.headers['ETag'] = Fog::AWS::CDN::Mock.generic_id
96
96
  response.body = distribution.merge({ 'LastModifiedTime' => Time.now.utc.iso8601 }).reject{ |k,v| k == 'ETag' }
97
97
  response
98
98
  else
99
- Fog::CDN::AWS::Mock.error(:no_such_streaming_distribution)
99
+ Fog::AWS::CDN::Mock.error(:no_such_streaming_distribution)
100
100
  end
101
101
  end
102
102
  end
@@ -14,7 +14,7 @@ module Fog
14
14
  when :beanstalk
15
15
  Fog::AWS::ElasticBeanstalk
16
16
  when :cdn
17
- Fog::CDN::AWS
17
+ Fog::AWS::CDN
18
18
  when :cloud_formation
19
19
  Fog::AWS::CloudFormation
20
20
  when :cloud_watch
@@ -126,4 +126,4 @@ module Fog
126
126
  end
127
127
  end
128
128
  end
129
- end
129
+ end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AWS
3
- VERSION = "3.2.0"
3
+ VERSION = "3.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-09-17 00:00:00.000000000 Z
12
+ date: 2018-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler