akamai_api 0.4.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +2 -6
- data/Gemfile +1 -0
- data/README.md +6 -11
- data/akamai_api.gemspec +1 -0
- data/cassettes/akamai_api_ccu_arl_invalidate/invalid_credentials.yml +32 -21
- data/cassettes/akamai_api_ccu_arl_invalidate/invalid_item.yml +2 -2
- data/cassettes/akamai_api_ccu_arl_invalidate/multiple_items.yml +4 -5
- data/cassettes/akamai_api_ccu_arl_invalidate/single_item.yml +4 -5
- data/cassettes/akamai_api_ccu_arl_remove/invalid_credentials.yml +30 -19
- data/cassettes/akamai_api_ccu_arl_remove/invalid_item.yml +1 -1
- data/cassettes/akamai_api_ccu_arl_remove/multiple_items.yml +1 -1
- data/cassettes/akamai_api_ccu_arl_remove/single_item.yml +1 -1
- data/cassettes/akamai_api_ccu_cpcode_invalidate/invalid_credentials.yml +31 -20
- data/cassettes/akamai_api_ccu_cpcode_invalidate/invalid_item.yml +1 -1
- data/cassettes/akamai_api_ccu_cpcode_invalidate/multiple_items.yml +1 -1
- data/cassettes/akamai_api_ccu_cpcode_invalidate/single_item.yml +1 -1
- data/cassettes/akamai_api_ccu_cpcode_remove/invalid_credentials.yml +31 -20
- data/cassettes/akamai_api_ccu_cpcode_remove/invalid_item.yml +1 -1
- data/cassettes/akamai_api_ccu_cpcode_remove/multiple_items.yml +1 -1
- data/cassettes/akamai_api_ccu_cpcode_remove/single_item.yml +1 -1
- data/cassettes/akamai_api_ccu_purge_status/completed_request.yml +4 -1
- data/cassettes/akamai_api_ccu_purge_status/enqueued_request.yml +1 -1
- data/cassettes/akamai_api_ccu_purge_status/invalid_credentials.yml +4 -1
- data/cassettes/akamai_api_ccu_purge_status/not_found_request.yml +4 -1
- data/cassettes/akamai_api_ccu_status/invalid_credentials.yml +1 -1
- data/cassettes/akamai_api_ccu_status/valid_credentials.yml +1 -1
- data/cassettes/akamai_api_eccu_all_ids/invalid_credentials.yml +3 -1
- data/cassettes/akamai_api_eccu_all_ids/successful.yml +3 -1
- data/cassettes/akamai_api_eccu_destroy/invalid_credentials.yml +10 -8
- data/cassettes/akamai_api_eccu_destroy/not_found_request.yml +3 -1
- data/cassettes/akamai_api_eccu_destroy/successful.yml +4 -2
- data/cassettes/akamai_api_eccu_find/invalid_credentials.yml +9 -7
- data/cassettes/akamai_api_eccu_find/not_found_request.yml +3 -1
- data/cassettes/akamai_api_eccu_find/successful.yml +4 -2
- data/cassettes/akamai_api_eccu_find/successful_without_content.yml +4 -2
- data/cassettes/akamai_api_eccu_last_request/invalid_credentials.yml +1 -1
- data/cassettes/akamai_api_eccu_last_request/valid_credentials.yml +6 -2
- data/cassettes/akamai_api_eccu_publish/invalid_credentials.yml +12 -10
- data/cassettes/akamai_api_eccu_publish/invalid_domain.yml +4 -2
- data/cassettes/akamai_api_eccu_publish/successful.yml +7 -3
- data/cassettes/akamai_api_eccu_requests/invalid_credentials.yml +3 -1
- data/cassettes/akamai_api_eccu_requests/valid_credentials.yml +15 -5
- data/cassettes/akamai_api_eccu_update_email/invalid_credentials.yml +11 -9
- data/cassettes/akamai_api_eccu_update_email/not_found_request.yml +3 -1
- data/cassettes/akamai_api_eccu_update_email/successful.yml +4 -2
- data/cassettes/akamai_api_eccu_update_notes/invalid_credentials.yml +11 -9
- data/cassettes/akamai_api_eccu_update_notes/not_found_request.yml +3 -1
- data/cassettes/akamai_api_eccu_update_notes/successful.yml +4 -2
- data/features/ccu_arl_invalidate.feature +1 -25
- data/features/support/env.rb +7 -2
- data/lib/akamai_api.rb +8 -2
- data/lib/akamai_api/ccu/purge/request.rb +52 -12
- data/lib/akamai_api/cli/ccu/arl.rb +8 -23
- data/lib/akamai_api/cli/ccu/purge_renderer.rb +5 -8
- data/lib/akamai_api/cli/command.rb +14 -29
- data/lib/akamai_api/version.rb +1 -1
- data/spec/features/ccu/purge_request_spec.rb +5 -2
- data/spec/lib/akamai_api/ccu/purge/request_spec.rb +29 -46
- data/spec/lib/akamai_api/ccu_spec.rb +0 -18
- data/spec/spec_helper.rb +8 -2
- metadata +17 -10
- data/spec/features/ccu/purge_status_request_spec.rb +0 -31
- data/spec/features/ccu/status_request_spec.rb +0 -17
- data/spec/lib/akamai_api/cli/ccu/arl_spec.rb +0 -40
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: |-
|
@@ -20,13 +20,15 @@ http_interactions:
|
|
20
20
|
Content-Type:
|
21
21
|
- text/xml;charset=UTF-8
|
22
22
|
Content-Length:
|
23
|
-
- '
|
23
|
+
- '1270'
|
24
24
|
Accept-Encoding:
|
25
25
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
26
26
|
Accept:
|
27
27
|
- '*/*'
|
28
28
|
User-Agent:
|
29
29
|
- Ruby
|
30
|
+
Authorization:
|
31
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
30
32
|
response:
|
31
33
|
status:
|
32
34
|
code: 500
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: |-
|
@@ -20,13 +20,15 @@ http_interactions:
|
|
20
20
|
Content-Type:
|
21
21
|
- text/xml;charset=UTF-8
|
22
22
|
Content-Length:
|
23
|
-
- '
|
23
|
+
- '1264'
|
24
24
|
Accept-Encoding:
|
25
25
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
26
26
|
Accept:
|
27
27
|
- '*/*'
|
28
28
|
User-Agent:
|
29
29
|
- Ruby
|
30
|
+
Authorization:
|
31
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
30
32
|
response:
|
31
33
|
status:
|
32
34
|
code: 200
|
@@ -60,7 +62,7 @@ http_interactions:
|
|
60
62
|
recorded_at: Tue, 20 May 2014 16:49:29 GMT
|
61
63
|
- request:
|
62
64
|
method: post
|
63
|
-
uri: https://
|
65
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
64
66
|
body:
|
65
67
|
encoding: UTF-8
|
66
68
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -81,6 +83,8 @@ http_interactions:
|
|
81
83
|
- '*/*'
|
82
84
|
User-Agent:
|
83
85
|
- Ruby
|
86
|
+
Authorization:
|
87
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
84
88
|
response:
|
85
89
|
status:
|
86
90
|
code: 200
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -22,6 +22,8 @@ http_interactions:
|
|
22
22
|
- '*/*'
|
23
23
|
User-Agent:
|
24
24
|
- Ruby
|
25
|
+
Authorization:
|
26
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
25
27
|
response:
|
26
28
|
status:
|
27
29
|
code: 401
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -22,6 +22,8 @@ http_interactions:
|
|
22
22
|
- '*/*'
|
23
23
|
User-Agent:
|
24
24
|
- Ruby
|
25
|
+
Authorization:
|
26
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
25
27
|
response:
|
26
28
|
status:
|
27
29
|
code: 200
|
@@ -57,7 +59,7 @@ http_interactions:
|
|
57
59
|
recorded_at: Tue, 20 May 2014 15:39:06 GMT
|
58
60
|
- request:
|
59
61
|
method: post
|
60
|
-
uri: https://
|
62
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
61
63
|
body:
|
62
64
|
encoding: UTF-8
|
63
65
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -78,6 +80,8 @@ http_interactions:
|
|
78
80
|
- '*/*'
|
79
81
|
User-Agent:
|
80
82
|
- Ruby
|
83
|
+
Authorization:
|
84
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
81
85
|
response:
|
82
86
|
status:
|
83
87
|
code: 200
|
@@ -124,7 +128,7 @@ http_interactions:
|
|
124
128
|
recorded_at: Tue, 20 May 2014 15:39:06 GMT
|
125
129
|
- request:
|
126
130
|
method: post
|
127
|
-
uri: https://
|
131
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
128
132
|
body:
|
129
133
|
encoding: UTF-8
|
130
134
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -145,6 +149,8 @@ http_interactions:
|
|
145
149
|
- '*/*'
|
146
150
|
User-Agent:
|
147
151
|
- Ruby
|
152
|
+
Authorization:
|
153
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
148
154
|
response:
|
149
155
|
status:
|
150
156
|
code: 200
|
@@ -190,7 +196,7 @@ http_interactions:
|
|
190
196
|
recorded_at: Tue, 20 May 2014 15:39:07 GMT
|
191
197
|
- request:
|
192
198
|
method: post
|
193
|
-
uri: https://
|
199
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
194
200
|
body:
|
195
201
|
encoding: UTF-8
|
196
202
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -211,6 +217,8 @@ http_interactions:
|
|
211
217
|
- '*/*'
|
212
218
|
User-Agent:
|
213
219
|
- Ruby
|
220
|
+
Authorization:
|
221
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
214
222
|
response:
|
215
223
|
status:
|
216
224
|
code: 200
|
@@ -257,7 +265,7 @@ http_interactions:
|
|
257
265
|
recorded_at: Tue, 20 May 2014 15:39:07 GMT
|
258
266
|
- request:
|
259
267
|
method: post
|
260
|
-
uri: https://
|
268
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
261
269
|
body:
|
262
270
|
encoding: UTF-8
|
263
271
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -278,6 +286,8 @@ http_interactions:
|
|
278
286
|
- '*/*'
|
279
287
|
User-Agent:
|
280
288
|
- Ruby
|
289
|
+
Authorization:
|
290
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
281
291
|
response:
|
282
292
|
status:
|
283
293
|
code: 200
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -20,16 +20,16 @@ http_interactions:
|
|
20
20
|
Accept-Encoding:
|
21
21
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
22
|
Accept:
|
23
|
-
-
|
23
|
+
- "*/*"
|
24
24
|
User-Agent:
|
25
25
|
- Ruby
|
26
|
+
Authorization:
|
27
|
+
- Basic Zm9vOmJhcg==
|
26
28
|
response:
|
27
29
|
status:
|
28
30
|
code: 401
|
29
31
|
message: Unauthorized
|
30
32
|
headers:
|
31
|
-
Server:
|
32
|
-
- Apache
|
33
33
|
Www-Authenticate:
|
34
34
|
- Basic realm="Luna Control Center Web Services (use your Luna username and
|
35
35
|
password)"
|
@@ -38,15 +38,17 @@ http_interactions:
|
|
38
38
|
Content-Type:
|
39
39
|
- text/html; charset=iso-8859-1
|
40
40
|
Expires:
|
41
|
-
- Thu,
|
41
|
+
- Thu, 02 Mar 2017 05:54:58 GMT
|
42
42
|
Cache-Control:
|
43
43
|
- max-age=0, no-cache, no-store
|
44
44
|
Pragma:
|
45
45
|
- no-cache
|
46
46
|
Date:
|
47
|
-
- Thu,
|
47
|
+
- Thu, 02 Mar 2017 05:54:58 GMT
|
48
48
|
Connection:
|
49
49
|
- close
|
50
|
+
Strict-Transport-Security:
|
51
|
+
- max-age=15552000
|
50
52
|
X-Frame-Options:
|
51
53
|
- SAMEORIGIN
|
52
54
|
body:
|
@@ -64,6 +66,6 @@ http_interactions:
|
|
64
66
|
browser doesn't understand how to supply
|
65
67
|
the credentials required.</p>
|
66
68
|
</body></html>
|
67
|
-
http_version:
|
68
|
-
recorded_at: Thu,
|
69
|
-
recorded_with: VCR
|
69
|
+
http_version:
|
70
|
+
recorded_at: Thu, 02 Mar 2017 05:54:58 GMT
|
71
|
+
recorded_with: VCR 3.0.3
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -23,6 +23,8 @@ http_interactions:
|
|
23
23
|
- '*/*'
|
24
24
|
User-Agent:
|
25
25
|
- Ruby
|
26
|
+
Authorization:
|
27
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
26
28
|
response:
|
27
29
|
status:
|
28
30
|
code: 500
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -16,13 +16,15 @@ http_interactions:
|
|
16
16
|
Content-Type:
|
17
17
|
- text/xml;charset=UTF-8
|
18
18
|
Content-Length:
|
19
|
-
- '
|
19
|
+
- '555'
|
20
20
|
Accept-Encoding:
|
21
21
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
22
22
|
Accept:
|
23
23
|
- '*/*'
|
24
24
|
User-Agent:
|
25
25
|
- Ruby
|
26
|
+
Authorization:
|
27
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
26
28
|
response:
|
27
29
|
status:
|
28
30
|
code: 200
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -21,16 +21,16 @@ http_interactions:
|
|
21
21
|
Accept-Encoding:
|
22
22
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
23
23
|
Accept:
|
24
|
-
-
|
24
|
+
- "*/*"
|
25
25
|
User-Agent:
|
26
26
|
- Ruby
|
27
|
+
Authorization:
|
28
|
+
- Basic Zm9vOmJhcg==
|
27
29
|
response:
|
28
30
|
status:
|
29
31
|
code: 401
|
30
32
|
message: Unauthorized
|
31
33
|
headers:
|
32
|
-
Server:
|
33
|
-
- Apache
|
34
34
|
Www-Authenticate:
|
35
35
|
- Basic realm="Luna Control Center Web Services (use your Luna username and
|
36
36
|
password)"
|
@@ -39,15 +39,17 @@ http_interactions:
|
|
39
39
|
Content-Type:
|
40
40
|
- text/html; charset=iso-8859-1
|
41
41
|
Expires:
|
42
|
-
- Thu,
|
42
|
+
- Thu, 02 Mar 2017 05:58:41 GMT
|
43
43
|
Cache-Control:
|
44
44
|
- max-age=0, no-cache, no-store
|
45
45
|
Pragma:
|
46
46
|
- no-cache
|
47
47
|
Date:
|
48
|
-
- Thu,
|
48
|
+
- Thu, 02 Mar 2017 05:58:41 GMT
|
49
49
|
Connection:
|
50
50
|
- close
|
51
|
+
Strict-Transport-Security:
|
52
|
+
- max-age=15552000
|
51
53
|
X-Frame-Options:
|
52
54
|
- SAMEORIGIN
|
53
55
|
body:
|
@@ -65,6 +67,6 @@ http_interactions:
|
|
65
67
|
browser doesn't understand how to supply
|
66
68
|
the credentials required.</p>
|
67
69
|
</body></html>
|
68
|
-
http_version:
|
69
|
-
recorded_at: Thu,
|
70
|
-
recorded_with: VCR
|
70
|
+
http_version:
|
71
|
+
recorded_at: Thu, 02 Mar 2017 05:58:41 GMT
|
72
|
+
recorded_with: VCR 3.0.3
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -24,6 +24,8 @@ http_interactions:
|
|
24
24
|
- '*/*'
|
25
25
|
User-Agent:
|
26
26
|
- Ruby
|
27
|
+
Authorization:
|
28
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
27
29
|
response:
|
28
30
|
status:
|
29
31
|
code: 500
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://
|
5
|
+
uri: https://control.akamai.com/webservices/services/PublishECCU
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
@@ -17,13 +17,15 @@ http_interactions:
|
|
17
17
|
Content-Type:
|
18
18
|
- text/xml;charset=UTF-8
|
19
19
|
Content-Length:
|
20
|
-
- '
|
20
|
+
- '569'
|
21
21
|
Accept-Encoding:
|
22
22
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
23
23
|
Accept:
|
24
24
|
- '*/*'
|
25
25
|
User-Agent:
|
26
26
|
- Ruby
|
27
|
+
Authorization:
|
28
|
+
- Basic VVNFUk5BTUU6UEFTU1dPUkQ=
|
27
29
|
response:
|
28
30
|
status:
|
29
31
|
code: 200
|
@@ -37,22 +37,10 @@ Feature: akamai_api ccu arl invalidate
|
|
37
37
|
"""
|
38
38
|
* Purge ID: 12345678-1234-1234-1234-123456789012 | Support ID: 12345678901234567890-123456789
|
39
39
|
"""
|
40
|
-
And the output should contain:
|
41
|
-
"""
|
42
|
-
* Estimated time: 420 secs.
|
43
|
-
"""
|
44
|
-
And the output should contain:
|
45
|
-
"""
|
46
|
-
* Progress URI: /ccu/v2/purges/12345678-1234-5678-1234-123456789012
|
47
|
-
"""
|
48
|
-
And the output should contain:
|
49
|
-
"""
|
50
|
-
* Time to wait before check: 420 secs.
|
51
|
-
"""
|
52
40
|
|
53
41
|
@vcr
|
54
42
|
Scenario: multiple items
|
55
|
-
When I run `akamai_api ccu arl invalidate http://www.foo.
|
43
|
+
When I run `akamai_api ccu arl invalidate http://www.foo.bar/t.txt http://www.foo.com/baz.txt`
|
56
44
|
Then the output should contain:
|
57
45
|
"""
|
58
46
|
Purge request successfully submitted:
|
@@ -65,15 +53,3 @@ Feature: akamai_api ccu arl invalidate
|
|
65
53
|
"""
|
66
54
|
* Purge ID: 12345678-1234-1234-1234-123456789012 | Support ID: 12345678901234567890-123456789
|
67
55
|
"""
|
68
|
-
And the output should contain:
|
69
|
-
"""
|
70
|
-
* Estimated time: 420 secs.
|
71
|
-
"""
|
72
|
-
And the output should contain:
|
73
|
-
"""
|
74
|
-
* Progress URI: /ccu/v2/purges/12345678-1234-5678-1234-123456789012
|
75
|
-
"""
|
76
|
-
And the output should contain:
|
77
|
-
"""
|
78
|
-
* Time to wait before check: 420 secs.
|
79
|
-
"""
|
data/features/support/env.rb
CHANGED
@@ -7,11 +7,16 @@ require 'vcr'
|
|
7
7
|
require 'webmock'
|
8
8
|
require 'coveralls'
|
9
9
|
Coveralls.wear_merged!
|
10
|
-
|
11
10
|
begin
|
12
11
|
require File.expand_path '../auth.rb', __FILE__
|
13
12
|
rescue LoadError
|
14
|
-
AkamaiApi.config[:auth] = ['
|
13
|
+
AkamaiApi.config[:auth] = ['USERNAME', 'PASSWORD']
|
14
|
+
AkamaiApi.config[:openapi] = {
|
15
|
+
:base_url => "https://some-subdomain.purge.akamaiapis.net",
|
16
|
+
:client_token => "client_token",
|
17
|
+
:client_secret => "client_secret",
|
18
|
+
:access_token => "access_token"
|
19
|
+
}
|
15
20
|
end
|
16
21
|
ENV['AKAMAI_USERNAME'], ENV['AKAMAI_PASSWORD'] = AkamaiApi.config[:auth]
|
17
22
|
|
data/lib/akamai_api.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "active_support/core_ext/object/blank"
|
2
|
+
require "active_support/core_ext/hash"
|
2
3
|
|
3
4
|
%w(version ccu eccu eccu_request eccu_parser).each do |file|
|
4
5
|
require "akamai_api/#{file}"
|
@@ -9,8 +10,9 @@ module AkamaiApi
|
|
9
10
|
@config ||= {
|
10
11
|
:auth => [
|
11
12
|
ENV.fetch('AKAMAI_USERNAME', ''),
|
12
|
-
ENV.fetch('AKAMAI_PASSWORD', '')
|
13
|
+
ENV.fetch('AKAMAI_PASSWORD', ''),
|
13
14
|
],
|
15
|
+
:openapi => {},
|
14
16
|
:log => false
|
15
17
|
}
|
16
18
|
end
|
@@ -19,7 +21,11 @@ module AkamaiApi
|
|
19
21
|
config[:auth].select { |v| v.blank? }.any?
|
20
22
|
end
|
21
23
|
|
24
|
+
def self.auth_ok?
|
25
|
+
[:username, :password, :base_url, :client_token, :client_secret, :access_token ].all? { |k| auth.key? k }
|
26
|
+
end
|
27
|
+
|
22
28
|
def self.auth
|
23
|
-
{ username: config[:auth].first, password: config[:auth].last }
|
29
|
+
{ username: config[:auth].first, password: config[:auth].last }.merge(config[:openapi].symbolize_keys)
|
24
30
|
end
|
25
31
|
end
|