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.
- checksums.yaml +4 -4
- data/lib/fog/aws.rb +1 -4
- data/lib/fog/aws/cdn.rb +15 -2
- data/lib/fog/aws/models/cdn/distribution.rb +4 -4
- data/lib/fog/aws/models/cdn/distribution_helper.rb +2 -2
- data/lib/fog/aws/models/cdn/distributions.rb +4 -4
- data/lib/fog/aws/models/cdn/distributions_helper.rb +2 -2
- data/lib/fog/aws/models/cdn/invalidation.rb +2 -2
- data/lib/fog/aws/models/cdn/invalidations.rb +3 -3
- data/lib/fog/aws/models/cdn/streaming_distribution.rb +3 -3
- data/lib/fog/aws/models/cdn/streaming_distributions.rb +4 -4
- data/lib/fog/aws/parsers/cdn/distribution.rb +2 -2
- data/lib/fog/aws/parsers/cdn/get_distribution_list.rb +2 -2
- data/lib/fog/aws/parsers/cdn/get_invalidation.rb +2 -2
- data/lib/fog/aws/parsers/cdn/get_invalidation_list.rb +2 -2
- data/lib/fog/aws/parsers/cdn/get_streaming_distribution_list.rb +2 -2
- data/lib/fog/aws/parsers/cdn/post_invalidation.rb +2 -2
- data/lib/fog/aws/parsers/cdn/streaming_distribution.rb +1 -1
- data/lib/fog/aws/requests/cdn/delete_distribution.rb +6 -6
- data/lib/fog/aws/requests/cdn/delete_streaming_distribution.rb +6 -6
- data/lib/fog/aws/requests/cdn/get_distribution.rb +5 -5
- data/lib/fog/aws/requests/cdn/get_distribution_list.rb +3 -3
- data/lib/fog/aws/requests/cdn/get_invalidation.rb +5 -5
- data/lib/fog/aws/requests/cdn/get_invalidation_list.rb +4 -4
- data/lib/fog/aws/requests/cdn/get_streaming_distribution.rb +5 -5
- data/lib/fog/aws/requests/cdn/get_streaming_distribution_list.rb +3 -3
- data/lib/fog/aws/requests/cdn/post_distribution.rb +6 -6
- data/lib/fog/aws/requests/cdn/post_invalidation.rb +5 -5
- data/lib/fog/aws/requests/cdn/post_streaming_distribution.rb +6 -6
- data/lib/fog/aws/requests/cdn/put_distribution_config.rb +7 -7
- data/lib/fog/aws/requests/cdn/put_streaming_distribution_config.rb +7 -7
- data/lib/fog/aws/service_mapper.rb +2 -2
- data/lib/fog/aws/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6102e30cc006be40adc471fd91d1ca9547fa46ac91703737aa3dc544ee577378
|
4
|
+
data.tar.gz: c73d52ba32eb89c42ae4f4307eaea8a3a9f06583dddaa5790f78b5207cdc7129
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1567e0ebc839dedb5829b4d4292d28937cfaa93fb474a5424c4d5a7f423e2d3755e826ce853045cec540341dd7c626f5fd54c1423852f7d7e5930494286f01b2
|
7
|
+
data.tar.gz: 76deb66ad0ad18890effdef923160f0d81dfa46df074a9c6acf8d44b46901d3fb2cd53584121bfa959fe2b86e2d82f536b0754aee31d78691e30b4ebd22f12aa
|
data/lib/fog/aws.rb
CHANGED
@@ -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__)
|
data/lib/fog/aws/cdn.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
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
|
6
|
-
class
|
5
|
+
module AWS
|
6
|
+
class CDN
|
7
7
|
class Distribution < Fog::Model
|
8
|
-
include Fog::CDN::
|
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::
|
36
|
+
Fog::AWS::CDN::Invalidations.new(
|
37
37
|
:distribution => self,
|
38
38
|
:service => service
|
39
39
|
)
|
@@ -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
|
6
|
-
class
|
5
|
+
module AWS
|
6
|
+
class CDN
|
7
7
|
class Distributions < Fog::Collection
|
8
|
-
include Fog::CDN::
|
8
|
+
include Fog::AWS::CDN::DistributionsHelper
|
9
9
|
|
10
|
-
model Fog::CDN::
|
10
|
+
model Fog::AWS::CDN::Distribution
|
11
11
|
|
12
12
|
attribute :marker, :aliases => 'Marker'
|
13
13
|
attribute :max_items, :aliases => 'MaxItems'
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'fog/aws/models/cdn/invalidation'
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
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::
|
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
|
6
|
-
class
|
5
|
+
module AWS
|
6
|
+
class CDN
|
7
7
|
class StreamingDistribution < Fog::Model
|
8
|
-
include Fog::CDN::
|
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
|
6
|
-
class
|
5
|
+
module AWS
|
6
|
+
class CDN
|
7
7
|
class StreamingDistributions < Fog::Collection
|
8
|
-
include Fog::CDN::
|
8
|
+
include Fog::AWS::CDN::DistributionsHelper
|
9
9
|
|
10
|
-
model Fog::CDN::
|
10
|
+
model Fog::AWS::CDN::StreamingDistribution
|
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
|
3
|
-
class
|
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::
|
29
|
+
Fog::AWS::CDN::Mock.error(:invalid_if_match_version)
|
30
30
|
end
|
31
31
|
unless distribution['DistributionConfig']['CallerReference']
|
32
|
-
Fog::CDN::
|
32
|
+
Fog::AWS::CDN::Mock.error(:illegal_update)
|
33
33
|
end
|
34
34
|
if distribution['DistributionConfig']['Enabled']
|
35
|
-
Fog::CDN::
|
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::
|
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
|
3
|
-
class
|
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::
|
29
|
+
Fog::AWS::CDN::Mock.error(:invalid_if_match_version)
|
30
30
|
end
|
31
31
|
unless distribution['StreamingDistributionConfig']['CallerReference']
|
32
|
-
Fog::CDN::
|
32
|
+
Fog::AWS::CDN::Mock.error(:illegal_update)
|
33
33
|
end
|
34
34
|
if distribution['StreamingDistributionConfig']['Enabled']
|
35
|
-
Fog::CDN::
|
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::
|
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
|
3
|
-
class
|
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::
|
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::
|
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::
|
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
|
3
|
-
class
|
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::
|
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
|
3
|
-
class
|
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::
|
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::
|
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::
|
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
|
3
|
-
class
|
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::
|
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::
|
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
|
3
|
-
class
|
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::
|
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::
|
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::
|
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
|
3
|
-
class
|
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::
|
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
|
3
|
-
class
|
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::
|
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::
|
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::
|
99
|
+
dist_id = Fog::AWS::CDN::Mock.distribution_id
|
100
100
|
|
101
101
|
distribution = {
|
102
|
-
'DomainName' => Fog::CDN::
|
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
|
3
|
-
class
|
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::
|
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::
|
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::
|
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
|
3
|
-
class
|
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::
|
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::
|
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::
|
86
|
+
dist_id = Fog::AWS::CDN::Mock.distribution_id
|
87
87
|
|
88
88
|
distribution = {
|
89
|
-
'DomainName' => Fog::CDN::
|
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
|
3
|
-
class
|
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::
|
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::
|
95
|
+
Fog::AWS::CDN::Mock.error(:invalid_if_match_version)
|
96
96
|
end
|
97
97
|
unless distribution['DistributionConfig']['CallerReference']
|
98
|
-
Fog::CDN::
|
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::
|
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::
|
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
|
3
|
-
class
|
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::
|
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::
|
84
|
+
Fog::AWS::CDN::Mock.error(:invalid_if_match_version)
|
85
85
|
end
|
86
86
|
unless distribution['StreamingDistributionConfig']['CallerReference']
|
87
|
-
Fog::CDN::
|
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::
|
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::
|
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
|
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
|
data/lib/fog/aws/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2018-09-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|