akamai_api 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +13 -0
  3. data/.yardopts +4 -0
  4. data/Gemfile +16 -0
  5. data/README.md +53 -52
  6. data/Thorfile +7 -1
  7. data/akamai_api.gemspec +1 -7
  8. data/bin/akamai_api +2 -1
  9. data/cassettes/akamai_api_ccu_arl_invalidate/invalid_credentials.yml +1 -1
  10. data/cassettes/akamai_api_ccu_arl_invalidate/invalid_item.yml +1 -1
  11. data/cassettes/akamai_api_ccu_arl_invalidate/multiple_items.yml +1 -1
  12. data/cassettes/akamai_api_ccu_arl_invalidate/single_item.yml +1 -1
  13. data/cassettes/akamai_api_ccu_arl_remove/invalid_credentials.yml +1 -1
  14. data/cassettes/akamai_api_ccu_arl_remove/invalid_item.yml +2 -2
  15. data/cassettes/akamai_api_ccu_arl_remove/multiple_items.yml +1 -1
  16. data/cassettes/akamai_api_ccu_arl_remove/single_item.yml +1 -1
  17. data/cassettes/akamai_api_ccu_cpcode_invalidate/invalid_credentials.yml +1 -1
  18. data/cassettes/akamai_api_ccu_cpcode_invalidate/invalid_item.yml +1 -1
  19. data/cassettes/akamai_api_ccu_cpcode_invalidate/multiple_items.yml +1 -1
  20. data/cassettes/akamai_api_ccu_cpcode_invalidate/single_item.yml +1 -1
  21. data/cassettes/akamai_api_ccu_cpcode_remove/invalid_credentials.yml +1 -1
  22. data/cassettes/akamai_api_ccu_cpcode_remove/invalid_item.yml +1 -1
  23. data/cassettes/akamai_api_ccu_cpcode_remove/multiple_items.yml +1 -1
  24. data/cassettes/akamai_api_ccu_cpcode_remove/single_item.yml +1 -1
  25. data/cassettes/akamai_api_eccu_all_ids/invalid_credentials.yml +68 -0
  26. data/cassettes/akamai_api_eccu_all_ids/successful.yml +72 -0
  27. data/cassettes/akamai_api_eccu_destroy/invalid_credentials.yml +69 -0
  28. data/cassettes/akamai_api_eccu_destroy/not_found_request.yml +55 -0
  29. data/cassettes/akamai_api_eccu_destroy/successful.yml +57 -0
  30. data/cassettes/akamai_api_eccu_find/invalid_credentials.yml +69 -0
  31. data/cassettes/akamai_api_eccu_find/not_found_request.yml +55 -0
  32. data/cassettes/akamai_api_eccu_find/successful.yml +70 -0
  33. data/cassettes/akamai_api_eccu_find/successful_without_content.yml +70 -0
  34. data/cassettes/akamai_api_eccu_publish/invalid_credentials.yml +5 -5
  35. data/cassettes/akamai_api_eccu_publish/invalid_domain.yml +7 -7
  36. data/cassettes/akamai_api_eccu_publish/successful.yml +8 -8
  37. data/cassettes/akamai_api_eccu_update_email/invalid_credentials.yml +69 -0
  38. data/cassettes/akamai_api_eccu_update_email/not_found_request.yml +55 -0
  39. data/cassettes/akamai_api_eccu_update_email/successful.yml +57 -0
  40. data/cassettes/akamai_api_eccu_update_notes/invalid_credentials.yml +70 -0
  41. data/cassettes/akamai_api_eccu_update_notes/not_found_request.yml +56 -0
  42. data/cassettes/akamai_api_eccu_update_notes/successful.yml +58 -0
  43. data/features/ccu_arl_invalidate.feature +5 -9
  44. data/features/ccu_arl_remove.feature +5 -9
  45. data/features/ccu_cpcode_invalidate.feature +2 -6
  46. data/features/ccu_cpcode_remove.feature +2 -6
  47. data/features/ccu_purge_status.feature +2 -2
  48. data/features/eccu_publish.feature +6 -42
  49. data/features/step_definitions/file_named_with_content_steps.rb +3 -0
  50. data/features/support/env.rb +12 -3
  51. data/lib/akamai_api/ccu/base_response.rb +27 -0
  52. data/lib/akamai_api/ccu/error.rb +38 -0
  53. data/lib/akamai_api/ccu/purge/request.rb +58 -11
  54. data/lib/akamai_api/ccu/purge/response.rb +15 -9
  55. data/lib/akamai_api/ccu/purge.rb +14 -3
  56. data/lib/akamai_api/ccu/purge_status/not_found.rb +18 -0
  57. data/lib/akamai_api/ccu/purge_status/request.rb +41 -7
  58. data/lib/akamai_api/ccu/purge_status/response.rb +49 -3
  59. data/lib/akamai_api/ccu/purge_status.rb +17 -9
  60. data/lib/akamai_api/ccu/status/request.rb +20 -7
  61. data/lib/akamai_api/ccu/status/response.rb +8 -2
  62. data/lib/akamai_api/ccu/status.rb +13 -2
  63. data/lib/akamai_api/ccu/unrecognized_option.rb +6 -0
  64. data/lib/akamai_api/ccu.rb +132 -23
  65. data/lib/akamai_api/cli/app.rb +15 -13
  66. data/lib/akamai_api/cli/ccu/arl.rb +10 -4
  67. data/lib/akamai_api/cli/ccu/base.rb +11 -3
  68. data/lib/akamai_api/cli/ccu/cp_code.rb +10 -4
  69. data/lib/akamai_api/cli/ccu/purge_renderer.rb +1 -1
  70. data/lib/akamai_api/cli/ccu/status_renderer.rb +46 -26
  71. data/lib/akamai_api/cli/ccu.rb +2 -4
  72. data/lib/akamai_api/cli/command.rb +60 -25
  73. data/lib/akamai_api/cli/eccu/base.rb +59 -0
  74. data/lib/akamai_api/cli/eccu/entry_renderer.rb +5 -3
  75. data/lib/akamai_api/cli/eccu.rb +2 -56
  76. data/lib/akamai_api/cli.rb +2 -6
  77. data/lib/akamai_api/eccu/base_edit_request.rb +51 -0
  78. data/lib/akamai_api/eccu/base_request.rb +32 -0
  79. data/lib/akamai_api/eccu/destroy_request.rb +30 -0
  80. data/lib/akamai_api/eccu/find_request.rb +45 -0
  81. data/lib/akamai_api/eccu/find_response.rb +110 -0
  82. data/lib/akamai_api/eccu/invalid_domain.rb +7 -0
  83. data/lib/akamai_api/eccu/list_request.rb +21 -0
  84. data/lib/akamai_api/eccu/not_found.rb +6 -0
  85. data/lib/akamai_api/eccu/publish_request.rb +75 -0
  86. data/lib/akamai_api/eccu/soap_body.rb +99 -0
  87. data/lib/akamai_api/eccu/update_attribute_request.rb +62 -0
  88. data/lib/akamai_api/eccu.rb +19 -0
  89. data/lib/akamai_api/eccu_request.rb +39 -117
  90. data/lib/akamai_api/error.rb +5 -0
  91. data/lib/akamai_api/unauthorized.rb +6 -0
  92. data/lib/akamai_api/version.rb +1 -1
  93. data/lib/akamai_api.rb +18 -4
  94. data/spec/features/ccu/purge_request_spec.rb +10 -12
  95. data/spec/features/ccu/purge_status_request_spec.rb +5 -5
  96. data/spec/features/ccu/status_request_spec.rb +3 -3
  97. data/spec/features/eccu/destroy_spec.rb +28 -0
  98. data/spec/features/eccu/find_request_spec.rb +34 -0
  99. data/spec/features/eccu/list_request_spec.rb +22 -0
  100. data/spec/features/eccu/publish_request_spec.rb +29 -0
  101. data/spec/features/eccu/update_email_spec.rb +28 -0
  102. data/spec/features/eccu/update_notes_spec.rb +28 -0
  103. data/spec/lib/akamai_api/ccu/{response_spec.rb → base_response_spec.rb} +2 -2
  104. data/spec/lib/akamai_api/ccu/purge/request_spec.rb +26 -20
  105. data/spec/lib/akamai_api/ccu/purge/response_spec.rb +16 -26
  106. data/spec/lib/akamai_api/ccu/purge_status/not_found_response_spec.rb +34 -34
  107. data/spec/lib/akamai_api/ccu/purge_status/request_spec.rb +24 -12
  108. data/spec/lib/akamai_api/ccu/purge_status/{successful_response_spec.rb → response_spec.rb} +8 -8
  109. data/spec/lib/akamai_api/ccu/status/request_spec.rb +6 -6
  110. data/spec/lib/akamai_api/ccu/status/response_spec.rb +2 -2
  111. data/spec/lib/akamai_api/ccu_spec.rb +7 -7
  112. data/spec/lib/akamai_api/cli/ccu/status_renderer_spec.rb +5 -17
  113. data/spec/lib/akamai_api/eccu/destroy_request_spec.rb +75 -0
  114. data/spec/lib/akamai_api/eccu/find_request_spec.rb +74 -0
  115. data/spec/lib/akamai_api/eccu/find_response_spec.rb +159 -0
  116. data/spec/lib/akamai_api/eccu/list_request_spec.rb +43 -0
  117. data/spec/lib/akamai_api/eccu/publish_request_spec.rb +133 -0
  118. data/spec/lib/akamai_api/eccu/soap_body_spec.rb +46 -0
  119. data/spec/lib/akamai_api/eccu/update_attribute_request_spec.rb +86 -0
  120. data/spec/lib/akamai_api/eccu_request_spec.rb +149 -158
  121. data/spec/spec_helper.rb +11 -3
  122. metadata +90 -104
  123. data/lib/akamai_api/ccu/purge_status/not_found_response.rb +0 -9
  124. data/lib/akamai_api/ccu/purge_status/successful_response.rb +0 -25
  125. data/lib/akamai_api/ccu/response.rb +0 -18
  126. data/lib/akamai_api/soap_body.rb +0 -40
  127. data/spec/lib/akamai_api/soap_body_spec.rb +0 -48
  128. data/spec/support/savon_backports.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da5bb7a0452b3d4b21385faf7458834c366add6c
4
- data.tar.gz: 55bc7df2f48e4941cd70050941b283524a744e56
3
+ metadata.gz: cf0e390a75e4360e9ed155a456bbcb8c56d6ac20
4
+ data.tar.gz: 27a3d66cb0f02ad1f709866256208f37a8ba3d51
5
5
  SHA512:
6
- metadata.gz: b940d0dee60736afadcc0313ea2adb660c0ddbb1527e52b648b4acf34f381996ea82bdd6271e162034239d466ed151e9913aedaaf881c6b5287e85f4cb3f48b7
7
- data.tar.gz: e976472d6fac76144147d48747a9414f1a485c2b70981d157ad1cf186d1f19cd36091ec2534fe48bf3038f639bdde0c08201e2a069876d09dd9394d4550ebec8
6
+ metadata.gz: 351490cd8497f8abb51379f8aaaecca6751a3abfcf50feaa8fd0978df8618f19b52b7a4021dbfab1c594fbaf692c2c56c04d6c86139f1bd5f8a0cea41befa3b8
7
+ data.tar.gz: bac0791728d4d40d7b511b66bafa2bb218281c426e0542ddd940e0374cd46d02696a021cadfda9d83b9c5d9d519b8e683acaec45a0038ad794b0856f6f4380ef
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ bundler_args: --without development
2
+ language: ruby
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.0.0
6
+ - 2.1.1
7
+ - jruby-19mode
8
+ matrix:
9
+ fast_finish: true
10
+ script:
11
+ - bundle exec thor spec
12
+ - bundle exec thor features
13
+ after_script: bundle exec thor coveralls
data/.yardopts ADDED
@@ -0,0 +1,4 @@
1
+ --protected
2
+ --no-private
3
+ -
4
+ LICENSE.txt
data/Gemfile CHANGED
@@ -2,3 +2,19 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in akamai_api.gemspec
4
4
  gemspec
5
+
6
+ group :test do
7
+ gem 'rspec', '>= 3.0.0'
8
+ gem 'cucumber'
9
+ gem 'aruba'
10
+ gem 'webmock'
11
+ gem 'vcr'
12
+ gem 'coveralls'
13
+ end
14
+
15
+ group :development do
16
+ gem 'guard-rspec'
17
+ gem 'guard-cucumber'
18
+ gem 'yard'
19
+ gem 'redcarpet'
20
+ end
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # AkamaiApi
2
+ [![Gem Version](https://badge.fury.io/rb/akamai_api.svg)](http://badge.fury.io/rb/akamai_api) [![Build Status](https://travis-ci.org/mikamai/akamai_api.svg?branch=master)](https://travis-ci.org/mikamai/akamai_api) [![Code Climate](https://codeclimate.com/github/mikamai/akamai_api.png)](https://codeclimate.com/github/mikamai/akamai_api) [![Coverage Status](https://img.shields.io/coveralls/mikamai/akamai_api.svg)](https://coveralls.io/r/mikamai/akamai_api?branch=master) [![Dependency Status](https://gemnasium.com/mikamai/akamai_api.svg)](https://gemnasium.com/mikamai/akamai_api)
2
3
 
3
4
  __Now with CCU REST support!__
4
5
 
@@ -24,8 +25,8 @@ After gem installation you will have a CLI utility to execute operations on Akam
24
25
  When using the CLI you can work with both CCU and ECCU.
25
26
 
26
27
  ```
27
- akamai_api ccu # CCU Interface
28
- akamai_api eccu # ECCU Interface
28
+ akamai_api CCU # CCU Interface
29
+ akamai_api ECCU # ECCU Interface
29
30
  akamai_api help [TASK] # Describe available tasks or one specific task
30
31
  ```
31
32
  Use *akamai_api help* to view the help of the CLI.
@@ -35,18 +36,18 @@ Use *akamai_api help* to view the help of the CLI.
35
36
  In the CCU interface you can work with CP Codes and ARLs.
36
37
 
37
38
  ```
38
- akamai_api ccu cpcode # CP Code CCU actions
39
- akamai_api ccu help [COMMAND] # Describe subcommands or one specific subcommand
40
- akamai_api ccu arl # ARL CCU actions
41
- akamai_api ccu status [progress_uri] # Show the CCU queue status if no progress_uri is given, or show a CCU Purge request status if a progress uri is given
39
+ akamai_api CCU cpcode # CP Code CCU actions
40
+ akamai_api CCU help [COMMAND] # Describe subcommands or one specific subcommand
41
+ akamai_api CCU arl # ARL CCU actions
42
+ akamai_api CCU status [progress_uri] # Show the CCU queue status if no progress_uri is given, or show a CCU Purge request status if a progress uri is given
42
43
  ```
43
44
 
44
45
  ### CP Code
45
46
 
46
47
  ```
47
- akamai_api ccu cpcode help [COMMAND] # Describe subcommands or one specific subcommand
48
- akamai_api ccu cpcode invalidate CPCODE1 CPCODE2 ... # Purge CP Code(s) marking their cache as expired
49
- akamai_api ccu cpcode remove CPCODE1 CPCODE2 ... # Purge CP Code(s) removing them from the cache
48
+ akamai_api CCU cpcode help [COMMAND] # Describe subcommands or one specific subcommand
49
+ akamai_api CCU cpcode invalidate CPCODE1 CPCODE2 ... # Purge CP Code(s) marking their cache as expired
50
+ akamai_api CCU cpcode remove CPCODE1 CPCODE2 ... # Purge CP Code(s) removing them from the cache
50
51
  ```
51
52
 
52
53
  When removing or invalidating a CP Code you can provide the following optional arguments:
@@ -56,9 +57,9 @@ When removing or invalidating a CP Code you can provide the following optional a
56
57
  ### ARL
57
58
 
58
59
  ```
59
- akamai_api ccu arl help [COMMAND] # Describe subcommands or one specific subcommand
60
- akamai_api ccu arl invalidate http://john.com/a.txt http://www.smith.com/b.txt ... # Purge ARL(s) marking their cache as expired
61
- akamai_api ccu arl remove http://john.com/a.txt http://www.smith.com/b.txt ... # Purge ARL(s) removing them from the cache
60
+ akamai_api CCU arl help [COMMAND] # Describe subcommands or one specific subcommand
61
+ akamai_api CCU arl invalidate http://john.com/a.txt http://www.smith.com/b.txt ... # Purge ARL(s) marking their cache as expired
62
+ akamai_api CCU arl remove http://john.com/a.txt http://www.smith.com/b.txt ... # Purge ARL(s) removing them from the cache
62
63
  ```
63
64
 
64
65
  When removing or invalidating an ARL you can provide the following optional arguments:
@@ -70,7 +71,7 @@ When removing or invalidating an ARL you can provide the following optional argu
70
71
  If you don't provide a `progress_uri` this command will print the CCU queue status. E.g.
71
72
 
72
73
  ```bash
73
- $ akamai_api ccu status
74
+ $ akamai_api CCU status
74
75
  ------------
75
76
  Status has been successfully received:
76
77
  * Result: 200 - The queue may take a minute to reflect new or removed requests.
@@ -82,7 +83,7 @@ Status has been successfully received:
82
83
  When you provide a `progress_uri` or a `purge_id` this command will print the CCU request status. E.g.
83
84
 
84
85
  ```bash
85
- $ akamai_api ccu status 12345678-1234-5678-1234-123456789012 # or you can pass /ccu/v2/purges/12345678-1234-5678-1234-123456789012
86
+ $ akamai_api CCU status 12345678-1234-5678-1234-123456789012 # or you can pass /CCU/v2/purges/12345678-1234-5678-1234-123456789012
86
87
  ------------
87
88
  Status has been successfully received:
88
89
  * Result: 200 - Done
@@ -97,30 +98,30 @@ Status has been successfully received:
97
98
  In the ECCU interface you can see the requestes already published and publish your own requests.
98
99
 
99
100
  ```
100
- akamai_api eccu help [COMMAND] # Describe subcommands or one specific subcommand
101
- akamai_api eccu last_request # Print the last request made to ECCU
102
- akamai_api eccu publish_xml path/to/request.xml john.com # Publish a request made in XML for the specified Digital Property (usually the Host Header)
103
- akamai_api eccu requests # Print the list of the last requests made to ECCU
101
+ akamai_api ECCU help [COMMAND] # Describe subcommands or one specific subcommand
102
+ akamai_api ECCU last_request # Print the last request made to ECCU
103
+ akamai_api ECCU publish_xml path/to/request.xml john.com # Publish a request made in XML for the specified Digital Property (usually the Host Header)
104
+ akamai_api ECCU requests # Print the list of the last requests made to ECCU
104
105
  ```
105
106
 
106
107
  ### Viewing Requests
107
108
 
108
- You can see the requests published on ECCU using *akamai_api eccu requests*
109
+ You can see the requests published on ECCU using *akamai_api ECCU requests*
109
110
  For each request you will see all its details (code, status, etc.) except the file content.
110
111
  To view the file content add the --content (-c) option.
111
112
 
112
- To see only the last request you can use *akamai_api eccu last_request*.
113
+ To see only the last request you can use *akamai_api ECCU last_request*.
113
114
 
114
115
  ### Publishing Requests in XML
115
116
 
116
- To publish requests made in XML (ECCU Request Format) you can use *akamai_api eccu publish_xml*.
117
+ To publish requests made in XML (ECCU Request Format) you can use *akamai_api ECCU publish_xml*.
117
118
 
118
119
  ```
119
120
  Usage:
120
121
  akamai_api publish_xml path/to/request.xml john.com
121
122
 
122
123
  Options:
123
- -pt, [--property-type=type] # Type of enlisted properties
124
+ -P, [--property-type=type] # Type of enlisted properties
124
125
  # Default: hostheader
125
126
  [--no-exact-match] # Do not do an exact match on property names
126
127
  -e, [--emails=foo@foo.com bar@bar.com] # Email(s) to use to send notification on status change
@@ -141,28 +142,28 @@ AkamaiApi.config.merge! :auth => ['user', 'pass']
141
142
  ```
142
143
 
143
144
  - CpCode: model representing a CP Code. Use the ::all method to retrieve the list of available CpCode.
144
- - Ccu : CCU interface. Use the ::purge method to purge a list of resources.
145
- - EccuRequest: model representing an ECCU request.
145
+ - CCU : CCU interface. Use the ::purge method to purge a list of resources.
146
+ - ECCURequest: model representing an ECCU request.
146
147
 
147
- ## Ccu
148
+ ## CCU
148
149
 
149
150
  ### ::status
150
151
 
151
- When no argument is given, this command will return a [`AkamaiApi::Ccu::Status::Response`](lib/akamai_api/ccu/status/response.rb) object describing the status of the Akamai CCU queue. E.g.
152
+ When no argument is given, this command will return a [`AkamaiApi::CCU::Status::Response`](lib/akamai_api/CCU/status/response.rb) object describing the status of the Akamai CCU queue. E.g.
152
153
 
153
154
  ```ruby
154
- AkamaiApi::Ccu.status
155
- # => #<AkamaiApi::Ccu::Status::Response:0x00000101167978 @raw={"supportId"=>"12345678901234567890-123456789", "httpStatus"=>200, "detail"=>"The queue may take a minute to reflect new or removed requests.", "queueLength"=>0}>
155
+ AkamaiApi::CCU.status
156
+ # => #<AkamaiApi::CCU::Status::Response:0x00000101167978 @raw={"supportId"=>"12345678901234567890-123456789", "httpStatus"=>200, "detail"=>"The queue may take a minute to reflect new or removed requests.", "queueLength"=>0}>
156
157
  ```
157
158
 
158
159
  When you pass a `progress_uri` or a `purge_id`, this command will check the given Akamai CCU request. E.g.
159
160
 
160
161
  ```ruby
161
- AkamaiApi::Ccu.status '/ccu/v2/purges/foobarbaz' # you can pass only 'foobarbaz' (the purge request id) as argument
162
- # => #<AkamaiApi::Ccu::PurgeStatus::SuccessfulResponse:0x000001014da088
162
+ AkamaiApi::CCU.status '/CCU/v2/purges/foobarbaz' # you can pass only 'foobarbaz' (the purge request id) as argument
163
+ # => #<AkamaiApi::CCU::PurgeStatus::SuccessfulResponse:0x000001014da088
163
164
  # @raw=
164
165
  # {"originalEstimatedSeconds"=>480,
165
- # "progressUri"=>"/ccu/v2/purges/12345678-1234-5678-1234-123456789012",
166
+ # "progressUri"=>"/CCU/v2/purges/12345678-1234-5678-1234-123456789012",
166
167
  # "originalQueueLength"=>6,
167
168
  # "purgeId"=>"12345678-1234-5678-1234-123456789012",
168
169
  # "supportId"=>"12345678901234567890-123456789",
@@ -174,12 +175,12 @@ AkamaiApi::Ccu.status '/ccu/v2/purges/foobarbaz' # you can pass only 'foobarbaz'
174
175
  # "pingAfterSeconds"=>60}>
175
176
  ```
176
177
 
177
- It will return a [`AkamaiApi::Ccu::PurgeStatus::SuccessfulResponse`](lib/akamai_api/ccu/purge_status/successful_response.rb) object when a purge request is found, or a [`Akamai::Ccu::PurgeStatus::NotFoundResponse`](lib/akamai_api/ccu/purge_status/not_found_response.rb) when no request can be found.
178
+ It will return a [`AkamaiApi::CCU::PurgeStatus::SuccessfulResponse`](lib/akamai_api/CCU/purge_status/successful_response.rb) object when a purge request is found, or a [`Akamai::CCU::PurgeStatus::NotFoundResponse`](lib/akamai_api/CCU/purge_status/not_found_response.rb) when no request can be found.
178
179
 
179
180
  ### ::purge
180
181
 
181
182
  ```ruby
182
- module AkamaiApi::Ccu
183
+ module AkamaiApi::CCU
183
184
  def purge action, type, items, args = {}
184
185
  ...
185
186
  end
@@ -191,13 +192,13 @@ end
191
192
  - `items`: the list of the resources to clean
192
193
  - `args`: additional options (domain)
193
194
 
194
- It will return a [`AkamaiApi::Ccu::Purge::Response`](lib/akamai_api/ccu/purge/response.rb) object that you can use to retrieve the `progress_uri` (or the `purge_id`) of the request.
195
+ It will return a [`AkamaiApi::CCU::Purge::Response`](lib/akamai_api/CCU/purge/response.rb) object that you can use to retrieve the `progress_uri` (or the `purge_id`) of the request.
195
196
 
196
197
  E.g.
197
198
 
198
199
  ```ruby
199
- AkamaiApi::Ccu.purge :remove, :arl, ['http://www.foo.com/a.txt'], :domain => 'staging'
200
- # => #<AkamaiApi::Ccu::Purge::Response:0x00000101bf2848
200
+ AkamaiApi::CCU.purge :remove, :arl, ['http://www.foo.com/a.txt'], :domain => 'staging'
201
+ # => #<AkamaiApi::CCU::Purge::Response:0x00000101bf2848
201
202
  # @raw=
202
203
  # {"describedBy"=>"foo",
203
204
  # "title"=>"bar",
@@ -207,35 +208,35 @@ AkamaiApi::Ccu.purge :remove, :arl, ['http://www.foo.com/a.txt'], :domain => 'st
207
208
  # "detail"=>"baz",
208
209
  # "httpStatus"=>201,
209
210
  # "estimatedSeconds"=>90,
210
- # "progressUri"=>"/ccu/v2/purges/1234"}>
211
+ # "progressUri"=>"/CCU/v2/purges/1234"}>
211
212
  ```
212
213
 
213
214
  ### Purge Helpers
214
215
 
215
216
  ```ruby
216
- ccu = AkamaiApi::Ccu
217
+ CCU = AkamaiApi::CCU
217
218
 
218
- ccu.invalidate_cpcode cpcodes # => wrapper to call .purge :invalidate, :cpcode
219
- ccu.invalidate_arl arls # => wrapper to call .purge :invalidate, :arl
220
- ccu.invalidate :arl, arls # => wrapper to call .purge :invalidate
219
+ CCU.invalidate_cpcode cpcodes # => wrapper to call .purge :invalidate, :cpcode
220
+ CCU.invalidate_arl arls # => wrapper to call .purge :invalidate, :arl
221
+ CCU.invalidate :arl, arls # => wrapper to call .purge :invalidate
221
222
 
222
- ccu.remove_cpcodes cpcodes # => wrapper to call .purge :remove, :cpcode
223
- ccu.remove_arl arls # => wrapper to call .purge :remove, :arl
224
- ccu.remove :arl # => wrapper to call .purge :remove
223
+ CCU.remove_cpcodes cpcodes # => wrapper to call .purge :remove, :cpcode
224
+ CCU.remove_arl arls # => wrapper to call .purge :remove, :arl
225
+ CCU.remove :arl # => wrapper to call .purge :remove
225
226
  ```
226
227
 
227
- ## EccuRequest
228
+ ## ECCURequest
228
229
 
229
- An EccuRequest is an object representing an ECCU Request. To see all the published requests use the `::all` method.
230
+ An ECCURequest is an object representing an ECCU Request. To see all the published requests use the `::all` method.
230
231
  To retrieve only the last request, you can use the `::last` method.
231
232
  The following code should be self explaining about both class methods and instance methods:
232
233
 
233
234
  ```ruby
234
- all_requests_ids = EccuRequest.all_ids # => Returns all available requests ids
235
- first_request = EccuRequest.find all_requests_ids.first # => Return the EccuRequest model with the specified code
235
+ all_requests_ids = ECCURequest.all_ids # => Returns all available requests ids
236
+ first_request = ECCURequest.find all_requests_ids.first # => Return the ECCURequest model with the specified code
236
237
 
237
- all_requests = EccuRequest.all # => Returns all available requests
238
- last_request = EccuRequest.last # => Return the last available request
238
+ all_requests = ECCURequest.all # => Returns all available requests
239
+ last_request = ECCURequest.last # => Return the last available request
239
240
 
240
241
  last_request.update_notes! 'My new note' # => Invoke the ECCU service to change the notes field
241
242
  last_request.update_email! 'foo@foo.com' # => Invoke the ECCU service to change the email to be notified on status change
@@ -245,8 +246,8 @@ The following code should be self explaining about both class methods and instan
245
246
  Use the ::publish method to publish an ECCU Request:
246
247
 
247
248
  ```ruby
248
- AkamaiApi::EccuRequest.publish 'example.com', my_content, args
249
- AkamaiApi::EccuRequest.publish_file 'example.com', 'path/to/file.xml', args
249
+ AkamaiApi::ECCURequest.publish 'example.com', my_content, args
250
+ AkamaiApi::ECCURequest.publish_file 'example.com', 'path/to/file.xml', args
250
251
  ```
251
252
 
252
253
  You can specify the following optional arguments in args: file_name, notes, version, emails, property_type, property_exact_match
data/Thorfile CHANGED
@@ -32,4 +32,10 @@ class Default < Thor
32
32
  def features
33
33
  exec "cucumber"
34
34
  end
35
- end
35
+
36
+ desc "coveralls", "Push coveralls stats"
37
+ def coveralls
38
+ require 'coveralls'
39
+ Coveralls.push!
40
+ end
41
+ end
data/akamai_api.gemspec CHANGED
@@ -20,12 +20,6 @@ Gem::Specification.new do |gem|
20
20
  gem.add_dependency 'httparty', '~> 0.13.1'
21
21
  gem.add_dependency 'activesupport', '>= 2.3.9', '< 5.0'
22
22
  gem.add_dependency 'thor', '>= 0.14.0', '< 2.0'
23
- gem.add_dependency 'savon', '~> 2.3.0'
23
+ gem.add_dependency 'savon', '~> 2.5.0'
24
24
  gem.add_dependency 'builder', '~> 3.0'
25
-
26
- gem.add_development_dependency 'guard-rspec'
27
- gem.add_development_dependency 'guard-cucumber'
28
- gem.add_development_dependency 'aruba'
29
- gem.add_development_dependency 'webmock'
30
- gem.add_development_dependency 'vcr'
31
25
  end
data/bin/akamai_api CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+ require 'active_support'
2
3
  require 'active_support/core_ext'
3
4
  require 'akamai_api'
4
5
  require 'akamai_api/cli'
5
6
 
6
- AkamaiApi::Cli::App.start
7
+ AkamaiApi::CLI::App.start
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://foo:bar@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"arl","action":"invalidate","objects":["http://www.foo.com/bar.txt"]}'
8
+ string: '{"type":"arl","action":"invalidate","domain":"production","objects":["http://www.foo.bar/t.txt"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"arl","action":"invalidate","objects":["http://www.foo.com/bar.txt"]}'
8
+ string: '{"type":"arl","action":"invalidate","domain":"production","objects":["http://www.foo.bar/t.txt"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"arl","action":"invalidate","objects":["http://www.foo.com/bar.txt","http://www.foo.com/baz.txt"]}'
8
+ string: '{"type":"arl","action":"invalidate","domain":"production","objects":["http://www.foo.com/bar.txt","http://www.foo.com/baz.txt"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"arl","action":"invalidate","objects":["http://www.foo.com/bar.txt"]}'
8
+ string: '{"type":"arl","action":"invalidate","domain":"production","objects":["http://www.foo.bar/t.txt"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://foo:bar@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"arl","action":"remove","objects":["http://www.foo.com/bar.txt"]}'
8
+ string: '{"type":"arl","action":"remove","domain":"production","objects":["http://www.foo.bar/t.txt"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"arl","action":"remove","objects":["http://www.foo.com/bar.txt"]}'
8
+ string: '{"type":"arl","action":"remove","domain":"production","objects":["http://www.foo.bar/t.txt"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -29,7 +29,7 @@ http_interactions:
29
29
  body:
30
30
  encoding: UTF-8
31
31
  string: '{"supportId": "12345678901234567890-123456789", "title": "unauthorized
32
- arl", "httpStatus": 403, "detail": "http://www.foo.com/bar.txt", "describedBy":
32
+ arl", "httpStatus": 403, "detail": "http://www.foo.bar/t.txt", "describedBy":
33
33
  "https://api.ccu.akamai.com/ccu/v2/errors/unauthorized-arl"}'
34
34
  http_version:
35
35
  recorded_at: Thu, 15 May 2014 06:51:12 GMT
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"arl","action":"remove","objects":["http://www.foo.com/bar.txt","http://www.foo.com/baz.txt"]}'
8
+ string: '{"type":"arl","action":"remove","domain":"production","objects":["http://www.foo.com/bar.txt","http://www.foo.com/baz.txt"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"arl","action":"remove","objects":["http://www.foo.com/bar.txt"]}'
8
+ string: '{"type":"arl","action":"remove","domain":"production","objects":["http://www.foo.bar/t.txt"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://foo:bar@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"cpcode","action":"invalidate","objects":["12345"]}'
8
+ string: '{"type":"cpcode","action":"invalidate","domain":"production","objects":["12345"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"cpcode","action":"invalidate","objects":["12345"]}'
8
+ string: '{"type":"cpcode","action":"invalidate","domain":"production","objects":["12345"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"cpcode","action":"invalidate","objects":["12345","12346"]}'
8
+ string: '{"type":"cpcode","action":"invalidate","domain":"production","objects":["12345","12346"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"cpcode","action":"invalidate","objects":["http://www.foo.com/bar.txt"]}'
8
+ string: '{"type":"cpcode","action":"invalidate","domain":"production","objects":["12345"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://foo:bar@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"cpcode","action":"remove","objects":["12345"]}'
8
+ string: '{"type":"cpcode","action":"remove","domain":"production","objects":["12345"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"cpcode","action":"remove","objects":["12345"]}'
8
+ string: '{"type":"cpcode","action":"remove","domain":"production","objects":["12345"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"cpcode","action":"remove","objects":["12345","12346"]}'
8
+ string: '{"type":"cpcode","action":"remove","domain":"production","objects":["12345","12346"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://USERNAME:PASSWORD@api.ccu.akamai.com/ccu/v2/queues/default/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: '{"type":"cpcode","action":"remove","objects":["http://www.foo.com/bar.txt"]}'
8
+ string: '{"type":"cpcode","action":"remove","domain":"production","objects":["12345"]}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/json
@@ -0,0 +1,68 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://USERNAME:PASSWORD@control.akamai.com/webservices/services/PublishECCU
6
+ body:
7
+ encoding: UTF-8
8
+ string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
9
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:akapubeccudt="https://control.akamai.com/2003/Sep/PublishECCU.xsd"
10
+ xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="https://control.akamai.com/AWS.xsd"
11
+ xmlns:ins1="https://control.akamai.com/Publish.xsd"><env:Body><akapubeccudt:getIds></akapubeccudt:getIds></env:Body></env:Envelope>
12
+ headers:
13
+ Soapaction:
14
+ - '"getIds"'
15
+ Content-Type:
16
+ - text/xml;charset=UTF-8
17
+ Content-Length:
18
+ - '457'
19
+ Accept-Encoding:
20
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
21
+ Accept:
22
+ - '*/*'
23
+ User-Agent:
24
+ - Ruby
25
+ response:
26
+ status:
27
+ code: 401
28
+ message: Unauthorized
29
+ headers:
30
+ Server:
31
+ - Apache
32
+ Www-Authenticate:
33
+ - Basic realm="Luna Control Center Web Services (use your Luna username and
34
+ password)"
35
+ Content-Length:
36
+ - '401'
37
+ Content-Type:
38
+ - text/html; charset=iso-8859-1
39
+ Expires:
40
+ - Mon, 26 May 2014 10:47:34 GMT
41
+ Cache-Control:
42
+ - max-age=0, no-cache, no-store
43
+ Pragma:
44
+ - no-cache
45
+ Date:
46
+ - Mon, 26 May 2014 10:47:34 GMT
47
+ Connection:
48
+ - close
49
+ X-Frame-Options:
50
+ - SAMEORIGIN
51
+ body:
52
+ encoding: UTF-8
53
+ string: |
54
+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
55
+ <html><head>
56
+ <title>401 Authorization Required</title>
57
+ </head><body>
58
+ <h1>Authorization Required</h1>
59
+ <p>This server could not verify that you
60
+ are authorized to access the document
61
+ requested. Either you supplied the wrong
62
+ credentials (e.g., bad password), or your
63
+ browser doesn't understand how to supply
64
+ the credentials required.</p>
65
+ </body></html>
66
+ http_version:
67
+ recorded_at: Mon, 26 May 2014 10:47:34 GMT
68
+ recorded_with: VCR 2.9.0