cloudfront 1.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ require 'jeweler'
15
15
  Jeweler::Tasks.new do |gem|
16
16
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
17
  gem.name = "cloudfront"
18
- gem.version = '1.1'
18
+ gem.version = '1.2'
19
19
  gem.homepage = "https://github.com/Belkacem/cloudfront"
20
20
  gem.license = "MIT"
21
21
  gem.summary = %Q{A tested Cloudfront™ gem}
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "cloudfront"
8
- s.version = "1.1"
8
+ s.version = "1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Belkacem REBBOUH"]
@@ -30,7 +30,7 @@ class Cloudfront
30
30
  end
31
31
 
32
32
  def credentials_test
33
- distribution_list.status == 200
33
+ download_distribution_list.status == 200
34
34
  end
35
35
  end
36
36
 
@@ -4,10 +4,6 @@ class Cloudfront
4
4
  module Distribution
5
5
  module Distribution
6
6
  private
7
- # Creates a distribution.
8
- # @param distribution [Cloudfront::Helpers::Distribution] a distribution configuration wrapper
9
- # @param url [String] the resource url
10
- # @return [Faraday::Response] the response from cloudfront
11
7
  def distribution_create(url, distribution)
12
8
  connection.post do |request|
13
9
  request.url url
@@ -15,11 +11,6 @@ class Cloudfront
15
11
  end
16
12
  end
17
13
 
18
- # Lists all the distributions.
19
- # @param url [String] the resource url
20
- # @param max_items [int] the max items to be retrieved
21
- # @param marker [String] The distribution id from which begins the list.
22
- # @return [Faraday::Response] the response from cloudfront
23
14
  def distribution_list(url, max_items = 0, marker = "")
24
15
  connection.get do |request|
25
16
  request.url url
@@ -28,32 +19,14 @@ class Cloudfront
28
19
  end
29
20
  end
30
21
 
31
- # Gets the distribution information.
32
- # @param url [String] the resource url
33
- # @param distribution_id [String] The id of the distribution to be returned.
34
- # @return [Faraday::Response] the response from cloudfront
35
22
  def distribution_get(url, distribution_id)
36
23
  connection.get url + '/' + distribution_id
37
24
  end
38
25
 
39
- # Returns the distribution configuration.
40
- # @param url [String] the resource url
41
- # @param distribution_id [String] The id of the distribution to be returned.
42
- # @return [Faraday::Response] the response from cloudfront
43
26
  def distribution_get_config(url, distribution_id)
44
27
  connection.get url + '/' + distribution_id + '/config'
45
28
  end
46
29
 
47
- # Puts the distribution configuration.
48
- # To put a distribution config we must follow a certain process defined in
49
- # http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/PutConfig.html
50
- # and
51
- # http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide//HowToUpdateDistribution.html
52
- # @param url [String] the resource url
53
- # @param distribution_id [String] The id of the distribution.
54
- # @param distribution [Cloudfront::Helpers::Distribution] a distribution configuration wrapper
55
- # @param etag [String] The etag.
56
- # @return [Faraday::Response] the response from cloudfront
57
30
  def distribution_put_config(url, distribution_id, distribution, etag)
58
31
  connection.put do |request|
59
32
  request.url url + '/' + distribution_id + '/config'
@@ -62,10 +35,6 @@ class Cloudfront
62
35
  end
63
36
  end
64
37
 
65
- # Enables a distribution.
66
- # @param url [String] the resource url
67
- # @param distribution_id [String] The id of the distribution to be enabled.
68
- # @return [Faraday::Response] the response from cloudfront
69
38
  def distribution_enable(url, distribution_id)
70
39
  # 1. get the distribution configuration
71
40
  response = distribution_get_config(url, distribution_id)
@@ -82,10 +51,6 @@ class Cloudfront
82
51
  distribution_put_config(url, distribution_id, distribution, etag)
83
52
  end
84
53
 
85
- # Disables a distribution.
86
- # @param url [String] the resource url
87
- # @param distribution_id [String] The id of the distribution to be disabled.
88
- # @return [Faraday::Response] the response from cloudfront
89
54
  def distribution_disable(url, distribution_id)
90
55
  # 1. get the distribution configuration
91
56
  response = distribution_get_config(url, distribution_id)
@@ -101,10 +66,6 @@ class Cloudfront
101
66
  distribution_put_config(url, distribution_id, distribution, etag)
102
67
  end
103
68
 
104
- # Deletes a distribution.
105
- # @param url [String] the resource url
106
- # @param distribution_id [String] The id of the distribution to be deleted.
107
- # @return [Faraday::Response] the response from cloudfront
108
69
  def distribution_delete(url, distribution_id)
109
70
  # 1. get the distribution configuration
110
71
  response = distribution_get_config(url, distribution_id)
@@ -10,34 +10,63 @@ class Cloudfront
10
10
 
11
11
  ::DOWNLOAD_DISTRIBUTION_URL = "/#{Cloudfront::Utils::Api.version}/distribution"
12
12
 
13
+ # Creates a download distribution.
14
+ # @param distribution [Cloudfront::Helpers::DownloadDistribution] a distribution configuration wrapper
15
+ # @return [Faraday::Response] the response from cloudfront
13
16
  def download_distribution_create(distribution)
14
17
  distribution_create(DOWNLOAD_DISTRIBUTION_URL, distribution)
15
18
  end
16
19
 
20
+ # Lists all the download distributions.
21
+ # @param max_items [int] the max items to be retrieved
22
+ # @param marker [String] The distribution id from which begins the list.
23
+ # @return [Faraday::Response] the response from cloudfront
17
24
  def download_distribution_list(max_items = 0, marker = "")
18
25
  distribution_list(DOWNLOAD_DISTRIBUTION_URL, max_items, marker)
19
26
  end
20
27
 
28
+ # Gets the download distribution information.
29
+ # @param distribution_id [String] The id of the distribution to be returned.
30
+ # @return [Faraday::Response] the response from cloudfront
21
31
  def download_distribution_get(distribution_id)
22
32
  distribution_get(DOWNLOAD_DISTRIBUTION_URL, distribution_id)
23
33
  end
24
34
 
35
+ # Returns the download distribution configuration.
36
+ # @param distribution_id [String] The id of the distribution to be returned.
37
+ # @return [Faraday::Response] the response from cloudfront
25
38
  def download_distribution_get_config(distribution_id)
26
39
  distribution_get_config(DOWNLOAD_DISTRIBUTION_URL, distribution_id)
27
40
  end
28
41
 
42
+ # Puts the download distribution configuration.
43
+ # To put a distribution config we must follow a certain process defined in
44
+ # http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowToUpdateDistribution.html
45
+ # @param distribution_id [String] The id of the distribution.
46
+ # @param distribution [Cloudfront::Helpers::Distribution] a distribution configuration wrapper
47
+ # @param etag [String] The etag.
48
+ # @return [Faraday::Response] the response from cloudfront
29
49
  def download_distribution_put_config(distribution_id, distribution, etag)
30
50
  distribution_put_config(DOWNLOAD_DISTRIBUTION_URL, distribution_id, distribution, etag)
31
51
  end
32
52
 
53
+ # Enables a download distribution.
54
+ # @param distribution_id [String] The id of the distribution to be enabled.
55
+ # @return [Faraday::Response] the response from cloudfront
33
56
  def download_distribution_enable(distribution_id)
34
57
  distribution_enable(DOWNLOAD_DISTRIBUTION_URL, distribution_id)
35
58
  end
36
59
 
60
+ # Disables a download distribution.
61
+ # @param distribution_id [String] The id of the distribution to be disabled.
62
+ # @return [Faraday::Response] the response from cloudfront
37
63
  def download_distribution_disable(distribution_id)
38
64
  distribution_disable(DOWNLOAD_DISTRIBUTION_URL, distribution_id)
39
65
  end
40
66
 
67
+ # Deletes a download distribution.
68
+ # @param distribution_id [String] The id of the distribution to be deleted.
69
+ # @return [Faraday::Response] the response from cloudfront
41
70
  def download_distribution_delete(distribution_id)
42
71
  distribution_delete(DOWNLOAD_DISTRIBUTION_URL, distribution_id)
43
72
  end
@@ -10,34 +10,64 @@ class Cloudfront
10
10
 
11
11
  ::STREAMING_DISTRIBUTION_URL = "/#{Cloudfront::Utils::Api.version}/streaming-distribution"
12
12
 
13
+ # Creates a streaming distribution.
14
+ # @param distribution [Cloudfront::Helpers::DownloadDistribution] a distribution configuration wrapper
15
+ # @return [Faraday::Response] the response from cloudfront
13
16
  def streaming_distribution_create(distribution)
14
17
  distribution_create(STREAMING_DISTRIBUTION_URL, distribution)
15
18
  end
16
19
 
20
+ # Lists all the streaming distributions.
21
+ # @param max_items [int] the max items to be retrieved
22
+ # @param marker [String] The distribution id from which begins the list.
23
+ # @return [Faraday::Response] the response from cloudfront
17
24
  def streaming_distribution_list(max_items = 0, marker = "")
18
25
  distribution_list(STREAMING_DISTRIBUTION_URL, max_items, marker)
19
26
  end
20
27
 
28
+ # Gets the streaming distribution information.
29
+ # @param distribution_id [String] The id of the distribution to be returned.
30
+ # @return [Faraday::Response] the response from cloudfront
21
31
  def streaming_distribution_get(distribution_id)
22
32
  distribution_get(STREAMING_DISTRIBUTION_URL, distribution_id)
23
33
  end
24
34
 
35
+ # Returns the streaming distribution configuration.
36
+ # @param distribution_id [String] The id of the distribution to be returned.
37
+ # @return [Faraday::Response] the response from cloudfront
25
38
  def streaming_distribution_get_config(distribution_id)
26
39
  distribution_get_config(STREAMING_DISTRIBUTION_URL, distribution_id)
27
40
  end
28
41
 
42
+
43
+ # Puts the streaming distribution configuration.
44
+ # To put a distribution config we must follow a certain process defined in
45
+ # http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowToUpdateDistribution.html
46
+ # @param distribution_id [String] The id of the distribution.
47
+ # @param distribution [Cloudfront::Helpers::Distribution] a distribution configuration wrapper
48
+ # @param etag [String] The etag.
49
+ # @return [Faraday::Response] the response from cloudfront
29
50
  def streaming_distribution_put_config(distribution_id, distribution, etag)
30
51
  distribution_put_config(STREAMING_DISTRIBUTION_URL, distribution_id, distribution, etag)
31
52
  end
32
53
 
54
+ # Enables a streaming distribution.
55
+ # @param distribution_id [String] The id of the distribution to be enabled.
56
+ # @return [Faraday::Response] the response from cloudfront
33
57
  def streaming_distribution_enable(distribution_id)
34
58
  distribution_enable(STREAMING_DISTRIBUTION_URL, distribution_id)
35
59
  end
36
60
 
61
+ # Disables a streaming distribution.
62
+ # @param distribution_id [String] The id of the distribution to be disabled.
63
+ # @return [Faraday::Response] the response from cloudfront
37
64
  def streaming_distribution_disable(distribution_id)
38
65
  distribution_disable(STREAMING_DISTRIBUTION_URL, distribution_id)
39
66
  end
40
67
 
68
+ # Deletes a streaming distribution.
69
+ # @param distribution_id [String] The id of the distribution to be deleted.
70
+ # @return [Faraday::Response] the response from cloudfront
41
71
  def streaming_distribution_delete(distribution_id)
42
72
  distribution_delete(STREAMING_DISTRIBUTION_URL, distribution_id)
43
73
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudfront
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.1'
4
+ version: '1.2'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -277,7 +277,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
277
277
  version: '0'
278
278
  segments:
279
279
  - 0
280
- hash: 1341546795153992287
280
+ hash: -1728956242891598010
281
281
  required_rubygems_version: !ruby/object:Gem::Requirement
282
282
  none: false
283
283
  requirements: