toccatore 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/toccatore/usage_update.rb +25 -14
- data/lib/toccatore/version.rb +1 -1
- data/spec/cli_spec.rb +1 -1
- data/spec/fixtures/events_empty.json +33 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_data/when_there_are_messages/should_return_the_data_for_one_message.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_data/when_there_is_ONE_message/should_return_the_data_for_one_message.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_message/should_return_no_meessage_when_the_queue_is_empty.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_message/should_return_one_message_when_there_are_multiple_messages.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_total/when_is_working_with_AWS.yml +28 -28
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_fail_if_format_of_the_event_is_empty.yml +52 -0
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_fail_if_format_of_the_event_is_wrong.yml +225 -232
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_work_with_a_single_item.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/queue_url/should_return_always_correct_queue_url.yml +7 -7
- data/spec/usage_update_spec.rb +15 -8
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7669490a8154bc8df633f15dcab74164562e4b554bcd94b921b88a3fff31eea
|
4
|
+
data.tar.gz: 9c0319f0fac52344ce69244ec42eb729c8e856e99195dd6b221f0d8cc1fbdc01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a3f745ef43f570eb3106802dca20c074d7cf79f00834e88a6cbfd16b8d688910cd92f9b12edb01d2b3dab1f0c82728d02a24215c5550bdacbb8ba22ca9cda88
|
7
|
+
data.tar.gz: f49a285f138b13fd38c75b98e012f65138c7ece13f2e60f7a7206ec4075fc35f93e6c27518f9966868931ff86cea42e28e3da98ec3255b2ca83a664140b5e76f
|
data/Gemfile.lock
CHANGED
@@ -41,21 +41,20 @@ module Toccatore
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def process_data(options = {})
|
44
|
+
errors = 0
|
44
45
|
message = get_message
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
unless message.messages.empty?
|
47
|
+
data = get_data(message)
|
48
|
+
events = parse_data(data, options)
|
49
|
+
errors = push_data(events, options)
|
50
|
+
if errors < 1
|
51
|
+
delete_message message
|
52
|
+
end
|
52
53
|
end
|
53
54
|
errors
|
54
55
|
end
|
55
56
|
|
56
57
|
def get_data reponse
|
57
|
-
return OpenStruct.new(body: { "errors" => "Queue is empty" }) if reponse.messages.empty?
|
58
|
-
|
59
58
|
body = JSON.parse(reponse.messages[0].body)
|
60
59
|
Maremma.get(body["report_id"])
|
61
60
|
end
|
@@ -72,7 +71,7 @@ module Toccatore
|
|
72
71
|
else
|
73
72
|
error_total = 0
|
74
73
|
Array(items).each do |item|
|
75
|
-
error_total += push_item(item, options)
|
74
|
+
error_total += push_item(item, options)
|
76
75
|
end
|
77
76
|
error_total
|
78
77
|
end
|
@@ -83,6 +82,10 @@ module Toccatore
|
|
83
82
|
end
|
84
83
|
|
85
84
|
def format_event type, data, options
|
85
|
+
fail "Not type given. Report #{data[:report_id]} not proccessed" if type.blank?
|
86
|
+
fail "Access token missing." if options[:source_token].blank?
|
87
|
+
fail "Report_id is missing" if data[:report_id].blank?
|
88
|
+
|
86
89
|
{ "uuid" => SecureRandom.uuid,
|
87
90
|
"message-action" => "add",
|
88
91
|
"subj-id" => data[:report_id],
|
@@ -102,7 +105,8 @@ module Toccatore
|
|
102
105
|
|
103
106
|
def parse_data(result, options={})
|
104
107
|
return result.body.fetch("errors") if result.body.fetch("errors", nil).present?
|
105
|
-
|
108
|
+
return [{ "errors" => { "title" => "The report is blank" }}] if result.body.blank?
|
109
|
+
|
106
110
|
items = result.body.dig("data","report","report-datasets")
|
107
111
|
header = result.body.dig("data","report","report-header")
|
108
112
|
report_id = result.url
|
@@ -130,9 +134,16 @@ module Toccatore
|
|
130
134
|
end
|
131
135
|
|
132
136
|
def push_item(item, options={})
|
133
|
-
|
134
|
-
|
135
|
-
|
137
|
+
if item["subj-id"].blank?
|
138
|
+
puts OpenStruct.new(body: { "errors" => [{ "title" => "There is no Subject" }] })
|
139
|
+
return 1
|
140
|
+
elsif options[:access_token].blank?
|
141
|
+
puts OpenStruct.new(body: { "errors" => [{ "title" => "Access token missing." }] })
|
142
|
+
return 1
|
143
|
+
elsif item["errors"].present?
|
144
|
+
puts OpenStruct.new(body: { "errors" => [{ "title" => "#{item["errors"]["title"]}" }] })
|
145
|
+
return 1
|
146
|
+
end
|
136
147
|
|
137
148
|
host = options[:push_url].presence || "https://api.test.datacite.org"
|
138
149
|
push_url = host + "/events/" + item["uuid"].to_s
|
data/lib/toccatore/version.rb
CHANGED
data/spec/cli_spec.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"uuid": "",
|
4
|
+
"message-action": "add",
|
5
|
+
"subj-id": "",
|
6
|
+
"subj": {
|
7
|
+
"pid": "",
|
8
|
+
"issued": ""
|
9
|
+
},
|
10
|
+
"total": 3,
|
11
|
+
"obj-id": "",
|
12
|
+
"relation-type-id": "",
|
13
|
+
"source-id": "datacite",
|
14
|
+
"source-token": "",
|
15
|
+
"occurred-at": "",
|
16
|
+
"license": ""
|
17
|
+
}, {
|
18
|
+
"uuid": "fc6860b8-4230-41bc-8b8e-21d60e9a7d9a",
|
19
|
+
"message-action": "add",
|
20
|
+
"subj-id": "https://metrics.test.datacite.org/reports/2018-3-Dashs",
|
21
|
+
"subj": {
|
22
|
+
"pid": "https://metrics.test.datacite.org/reports/2018-3-Dashs",
|
23
|
+
"issued": "2128-04-09"
|
24
|
+
},
|
25
|
+
"total": 3,
|
26
|
+
"obj-id": "https://doi.org/10.7291/d1q94r",
|
27
|
+
"relation-type-id": "unique-dataset-investigations-regular",
|
28
|
+
"source-id": "datacite",
|
29
|
+
"source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc",
|
30
|
+
"occurred-at": "2128-04-09",
|
31
|
+
"license": "https://creativecommons.org/publicdomain/zero/1.0/"
|
32
|
+
}
|
33
|
+
]
|
@@ -17,7 +17,7 @@ http_interactions:
|
|
17
17
|
message: ''
|
18
18
|
headers:
|
19
19
|
Date:
|
20
|
-
-
|
20
|
+
- Sat, 26 May 2018 08:28:16 GMT
|
21
21
|
Content-Type:
|
22
22
|
- application/json; charset=utf-8
|
23
23
|
Connection:
|
@@ -33,9 +33,9 @@ http_interactions:
|
|
33
33
|
Etag:
|
34
34
|
- W/"a2af7c772d0e1af937e036db75f8bbb1"
|
35
35
|
X-Runtime:
|
36
|
-
- '0.
|
36
|
+
- '0.005244'
|
37
37
|
X-Request-Id:
|
38
|
-
-
|
38
|
+
- 49b975fd-986d-4e8c-bc91-ba2f06830408
|
39
39
|
X-Powered-By:
|
40
40
|
- Phusion Passenger 5.3.1
|
41
41
|
Server:
|
@@ -48,5 +48,5 @@ http_interactions:
|
|
48
48
|
of the Tabonuco Forest trees and shrubs.","dataset-contributors":[{"type":"name","value":"Jess
|
49
49
|
Zimmerman"}]}]}}'
|
50
50
|
http_version:
|
51
|
-
recorded_at:
|
51
|
+
recorded_at: Sat, 26 May 2018 08:28:16 GMT
|
52
52
|
recorded_with: VCR 3.0.3
|
@@ -17,7 +17,7 @@ http_interactions:
|
|
17
17
|
message: ''
|
18
18
|
headers:
|
19
19
|
Date:
|
20
|
-
-
|
20
|
+
- Sat, 26 May 2018 08:28:16 GMT
|
21
21
|
Content-Type:
|
22
22
|
- application/json; charset=utf-8
|
23
23
|
Connection:
|
@@ -33,9 +33,9 @@ http_interactions:
|
|
33
33
|
Etag:
|
34
34
|
- W/"a2af7c772d0e1af937e036db75f8bbb1"
|
35
35
|
X-Runtime:
|
36
|
-
- '0.
|
36
|
+
- '0.005629'
|
37
37
|
X-Request-Id:
|
38
|
-
-
|
38
|
+
- 0e117b0d-5067-4dc4-bede-a2b20c4cc5a6
|
39
39
|
X-Powered-By:
|
40
40
|
- Phusion Passenger 5.3.1
|
41
41
|
Server:
|
@@ -48,5 +48,5 @@ http_interactions:
|
|
48
48
|
of the Tabonuco Forest trees and shrubs.","dataset-contributors":[{"type":"name","value":"Jess
|
49
49
|
Zimmerman"}]}]}}'
|
50
50
|
http_version:
|
51
|
-
recorded_at:
|
51
|
+
recorded_at: Sat, 26 May 2018 08:28:16 GMT
|
52
52
|
recorded_with: VCR 3.0.3
|
@@ -14,12 +14,12 @@ http_interactions:
|
|
14
14
|
User-Agent:
|
15
15
|
- aws-sdk-ruby3/3.21.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
|
16
16
|
X-Amz-Date:
|
17
|
-
-
|
17
|
+
- 20180526T082819Z
|
18
18
|
X-Amz-Content-Sha256:
|
19
19
|
- 5761efd13dd0ed81182207171d3660628968189941431d6044920ef8fe7b1160
|
20
20
|
Authorization:
|
21
|
-
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/
|
22
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=
|
21
|
+
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180526/eu-west-1/sqs/aws4_request,
|
22
|
+
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=2ab509ced23271346a50f94e2becd6dbe3fcf46ad5660e57200c4f763e6d3cdb
|
23
23
|
Content-Length:
|
24
24
|
- '58'
|
25
25
|
Accept:
|
@@ -32,7 +32,7 @@ http_interactions:
|
|
32
32
|
Server:
|
33
33
|
- Server
|
34
34
|
Date:
|
35
|
-
-
|
35
|
+
- Sat, 26 May 2018 08:28:19 GMT
|
36
36
|
Content-Type:
|
37
37
|
- text/xml
|
38
38
|
Content-Length:
|
@@ -40,12 +40,12 @@ http_interactions:
|
|
40
40
|
Connection:
|
41
41
|
- keep-alive
|
42
42
|
X-Amzn-Requestid:
|
43
|
-
-
|
43
|
+
- 8464fe80-c51a-567c-9796-ad03d9f9af81
|
44
44
|
body:
|
45
45
|
encoding: UTF-8
|
46
|
-
string: <?xml version="1.0"?><GetQueueUrlResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueUrlResult><QueueUrl>https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage</QueueUrl></GetQueueUrlResult><ResponseMetadata><RequestId>
|
46
|
+
string: <?xml version="1.0"?><GetQueueUrlResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueUrlResult><QueueUrl>https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage</QueueUrl></GetQueueUrlResult><ResponseMetadata><RequestId>8464fe80-c51a-567c-9796-ad03d9f9af81</RequestId></ResponseMetadata></GetQueueUrlResponse>
|
47
47
|
http_version:
|
48
|
-
recorded_at:
|
48
|
+
recorded_at: Sat, 26 May 2018 08:28:19 GMT
|
49
49
|
- request:
|
50
50
|
method: post
|
51
51
|
uri: https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage
|
@@ -60,12 +60,12 @@ http_interactions:
|
|
60
60
|
User-Agent:
|
61
61
|
- aws-sdk-ruby3/3.21.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
|
62
62
|
X-Amz-Date:
|
63
|
-
-
|
63
|
+
- 20180526T082819Z
|
64
64
|
X-Amz-Content-Sha256:
|
65
65
|
- b7f76556fe5b5efa85dad3a27ea532b3b8e01ad962d40f74c728489bf8a4b2f7
|
66
66
|
Authorization:
|
67
|
-
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/
|
68
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=
|
67
|
+
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180526/eu-west-1/sqs/aws4_request,
|
68
|
+
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=066d2e8334a849df5f2dde8e8f3b1d463540db4b2c6d6643a059f3d95358a96e
|
69
69
|
Content-Length:
|
70
70
|
- '159'
|
71
71
|
Accept:
|
@@ -78,18 +78,18 @@ http_interactions:
|
|
78
78
|
Server:
|
79
79
|
- Server
|
80
80
|
Date:
|
81
|
-
-
|
81
|
+
- Sat, 26 May 2018 08:28:19 GMT
|
82
82
|
Content-Type:
|
83
83
|
- text/xml
|
84
84
|
Content-Length:
|
85
|
-
- '
|
85
|
+
- '965'
|
86
86
|
Connection:
|
87
87
|
- keep-alive
|
88
88
|
X-Amzn-Requestid:
|
89
|
-
-
|
89
|
+
- 23c3491f-383b-5099-ab15-1a9c24d8e3e4
|
90
90
|
body:
|
91
91
|
encoding: UTF-8
|
92
|
-
string: <?xml version="1.0"?><ReceiveMessageResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><ReceiveMessageResult><Message><MessageId>c9476d03-e892-4291-a612-483d220a207e</MessageId><ReceiptHandle>
|
92
|
+
string: <?xml version="1.0"?><ReceiveMessageResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><ReceiveMessageResult><Message><MessageId>c9476d03-e892-4291-a612-483d220a207e</MessageId><ReceiptHandle>AQEBMqZycZ1NEXt/x/e2WRD1uXXQtjB/NqwmEYVeoSq61IMo0gLSgRCFOS0iqM1aFQOW5fAY2k8KWEZf0QIJ3sOTQJ5s7fuBpEGHcOvDHZcEu6zwbtuv+wv3xrsq7UzsOmGZ60F4Kw9MCvNOtha7Nt36NgGpcU4Bsf4yp2z+ABbKFYliT8iWzh7NjGsg/6Q2DVxrK+AG3xOADojs6iFEqxyhYVV0zNxkxfZ7O8q/ROH2qOFwd4Bp81pKPxpLY2g3SQrPabmq3Yskh6UApQdW9Shvkr68GNHnnk6x90YIZVpWFxSRHg/Pdw+RzHrDO1YoINRc6itth87j4aKeD79hvuVVeBFSVDK+TIVu7mwUup2bCaWLSJ02iroUFrk5N/oy8qVn3ATSmMcLYF1ux9CaNHswvg==</ReceiptHandle><MD5OfBody>bbac5118a088ff64cfde70bb7f0d219b</MD5OfBody><Body>{"report_id":"https://metrics.test.datacite.org/reports/1ff910bc-fe6b-4410-a727-c9ec39990215"}</Body></Message></ReceiveMessageResult><ResponseMetadata><RequestId>23c3491f-383b-5099-ab15-1a9c24d8e3e4</RequestId></ResponseMetadata></ReceiveMessageResponse>
|
93
93
|
http_version:
|
94
|
-
recorded_at:
|
94
|
+
recorded_at: Sat, 26 May 2018 08:28:19 GMT
|
95
95
|
recorded_with: VCR 3.0.3
|
@@ -14,12 +14,12 @@ http_interactions:
|
|
14
14
|
User-Agent:
|
15
15
|
- aws-sdk-ruby3/3.21.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
|
16
16
|
X-Amz-Date:
|
17
|
-
-
|
17
|
+
- 20180526T082819Z
|
18
18
|
X-Amz-Content-Sha256:
|
19
19
|
- 5761efd13dd0ed81182207171d3660628968189941431d6044920ef8fe7b1160
|
20
20
|
Authorization:
|
21
|
-
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/
|
22
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=
|
21
|
+
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180526/eu-west-1/sqs/aws4_request,
|
22
|
+
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=2ab509ced23271346a50f94e2becd6dbe3fcf46ad5660e57200c4f763e6d3cdb
|
23
23
|
Content-Length:
|
24
24
|
- '58'
|
25
25
|
Accept:
|
@@ -32,7 +32,7 @@ http_interactions:
|
|
32
32
|
Server:
|
33
33
|
- Server
|
34
34
|
Date:
|
35
|
-
-
|
35
|
+
- Sat, 26 May 2018 08:28:19 GMT
|
36
36
|
Content-Type:
|
37
37
|
- text/xml
|
38
38
|
Content-Length:
|
@@ -40,12 +40,12 @@ http_interactions:
|
|
40
40
|
Connection:
|
41
41
|
- keep-alive
|
42
42
|
X-Amzn-Requestid:
|
43
|
-
-
|
43
|
+
- '078a681d-f277-5266-bd07-3b9eee94ac10'
|
44
44
|
body:
|
45
45
|
encoding: UTF-8
|
46
|
-
string: <?xml version="1.0"?><GetQueueUrlResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueUrlResult><QueueUrl>https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage</QueueUrl></GetQueueUrlResult><ResponseMetadata><RequestId>
|
46
|
+
string: <?xml version="1.0"?><GetQueueUrlResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueUrlResult><QueueUrl>https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage</QueueUrl></GetQueueUrlResult><ResponseMetadata><RequestId>078a681d-f277-5266-bd07-3b9eee94ac10</RequestId></ResponseMetadata></GetQueueUrlResponse>
|
47
47
|
http_version:
|
48
|
-
recorded_at:
|
48
|
+
recorded_at: Sat, 26 May 2018 08:28:19 GMT
|
49
49
|
- request:
|
50
50
|
method: post
|
51
51
|
uri: https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage
|
@@ -60,12 +60,12 @@ http_interactions:
|
|
60
60
|
User-Agent:
|
61
61
|
- aws-sdk-ruby3/3.21.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
|
62
62
|
X-Amz-Date:
|
63
|
-
-
|
63
|
+
- 20180526T082819Z
|
64
64
|
X-Amz-Content-Sha256:
|
65
65
|
- b7f76556fe5b5efa85dad3a27ea532b3b8e01ad962d40f74c728489bf8a4b2f7
|
66
66
|
Authorization:
|
67
|
-
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/
|
68
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=
|
67
|
+
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180526/eu-west-1/sqs/aws4_request,
|
68
|
+
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=066d2e8334a849df5f2dde8e8f3b1d463540db4b2c6d6643a059f3d95358a96e
|
69
69
|
Content-Length:
|
70
70
|
- '159'
|
71
71
|
Accept:
|
@@ -78,18 +78,18 @@ http_interactions:
|
|
78
78
|
Server:
|
79
79
|
- Server
|
80
80
|
Date:
|
81
|
-
-
|
81
|
+
- Sat, 26 May 2018 08:28:20 GMT
|
82
82
|
Content-Type:
|
83
83
|
- text/xml
|
84
84
|
Content-Length:
|
85
|
-
- '
|
85
|
+
- '965'
|
86
86
|
Connection:
|
87
87
|
- keep-alive
|
88
88
|
X-Amzn-Requestid:
|
89
|
-
-
|
89
|
+
- ab49b777-b5be-5d7a-913d-e4f4a95a8283
|
90
90
|
body:
|
91
91
|
encoding: UTF-8
|
92
|
-
string: <?xml version="1.0"?><ReceiveMessageResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><ReceiveMessageResult><Message><MessageId>
|
92
|
+
string: <?xml version="1.0"?><ReceiveMessageResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><ReceiveMessageResult><Message><MessageId>d45856d0-1e94-4643-badb-95a9825edc58</MessageId><ReceiptHandle>AQEBF+kOidg1tQ7fPE9PEu58JGZto2NVi5V8D3pD2L1hYU+B5070akaQGIMZz8N/0XmmQm7btKkcRCcZB+a9netKvfH/LMiXCdaFryPt7ZWRndr5PyNBbd4JTBORFGHEvx5wSyaRoaS8RVZDOpEz7BTytEhCsHMWD3RxejDNXCnZGcHKLMYaIWcE1LSeHk/8dq6efk7rQEIqmhSIVl/3NGCrWfKkZRfdaPjehns95FX4t9Bvrg4wKws+b90hzidQKGfrfaivu5cuY4BEbnqx1omQANM+nrlGpxy01byjeYQUx6mEnhErTP56RIEeexZXm4HgJIdBAhBsFq5XnW8i8iPQdEMCTiGjS2y/kt7B9F+f4W5a+G1ex6dOxbahCSnNKAu+3UDPwzqIL47vF9mJEbM1Xw==</ReceiptHandle><MD5OfBody>c43cd6b5169cc0d0abf08439bee45031</MD5OfBody><Body>{"report_id":"https://metrics.test.datacite.org/reports/22b67b62-186e-4c38-bafa-e217c503cc71"}</Body></Message></ReceiveMessageResult><ResponseMetadata><RequestId>ab49b777-b5be-5d7a-913d-e4f4a95a8283</RequestId></ResponseMetadata></ReceiveMessageResponse>
|
93
93
|
http_version:
|
94
|
-
recorded_at:
|
94
|
+
recorded_at: Sat, 26 May 2018 08:28:20 GMT
|
95
95
|
recorded_with: VCR 3.0.3
|
data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_total/when_is_working_with_AWS.yml
CHANGED
@@ -14,12 +14,12 @@ http_interactions:
|
|
14
14
|
User-Agent:
|
15
15
|
- aws-sdk-ruby3/3.21.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
|
16
16
|
X-Amz-Date:
|
17
|
-
-
|
17
|
+
- 20180526T082818Z
|
18
18
|
X-Amz-Content-Sha256:
|
19
19
|
- 5761efd13dd0ed81182207171d3660628968189941431d6044920ef8fe7b1160
|
20
20
|
Authorization:
|
21
|
-
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/
|
22
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=
|
21
|
+
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180526/eu-west-1/sqs/aws4_request,
|
22
|
+
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=fb9969df4a8fe01e1205b909a4c96db4afab8b34317aa9d46aa0ca28242fbb91
|
23
23
|
Content-Length:
|
24
24
|
- '58'
|
25
25
|
Accept:
|
@@ -32,7 +32,7 @@ http_interactions:
|
|
32
32
|
Server:
|
33
33
|
- Server
|
34
34
|
Date:
|
35
|
-
-
|
35
|
+
- Sat, 26 May 2018 08:28:18 GMT
|
36
36
|
Content-Type:
|
37
37
|
- text/xml
|
38
38
|
Content-Length:
|
@@ -40,12 +40,12 @@ http_interactions:
|
|
40
40
|
Connection:
|
41
41
|
- keep-alive
|
42
42
|
X-Amzn-Requestid:
|
43
|
-
-
|
43
|
+
- 9c22d060-a576-5dea-a486-83e3b9941e91
|
44
44
|
body:
|
45
45
|
encoding: UTF-8
|
46
|
-
string: <?xml version="1.0"?><GetQueueUrlResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueUrlResult><QueueUrl>https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage</QueueUrl></GetQueueUrlResult><ResponseMetadata><RequestId>
|
46
|
+
string: <?xml version="1.0"?><GetQueueUrlResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueUrlResult><QueueUrl>https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage</QueueUrl></GetQueueUrlResult><ResponseMetadata><RequestId>9c22d060-a576-5dea-a486-83e3b9941e91</RequestId></ResponseMetadata></GetQueueUrlResponse>
|
47
47
|
http_version:
|
48
|
-
recorded_at:
|
48
|
+
recorded_at: Sat, 26 May 2018 08:28:18 GMT
|
49
49
|
- request:
|
50
50
|
method: post
|
51
51
|
uri: https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage
|
@@ -60,12 +60,12 @@ http_interactions:
|
|
60
60
|
User-Agent:
|
61
61
|
- aws-sdk-ruby3/3.21.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
|
62
62
|
X-Amz-Date:
|
63
|
-
-
|
63
|
+
- 20180526T082818Z
|
64
64
|
X-Amz-Content-Sha256:
|
65
65
|
- 4fa1f9790ab8d8b778fc048ef890ef00e82c1fd4658cd21964eff9eb5dc9426d
|
66
66
|
Authorization:
|
67
|
-
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/
|
68
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=
|
67
|
+
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180526/eu-west-1/sqs/aws4_request,
|
68
|
+
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=dbfdd84ccd65c6ef60e9ecb3a10abf61f14811689d557ec5e2df0516ab8dbd1d
|
69
69
|
Content-Length:
|
70
70
|
- '221'
|
71
71
|
Accept:
|
@@ -78,7 +78,7 @@ http_interactions:
|
|
78
78
|
Server:
|
79
79
|
- Server
|
80
80
|
Date:
|
81
|
-
-
|
81
|
+
- Sat, 26 May 2018 08:28:19 GMT
|
82
82
|
Content-Type:
|
83
83
|
- text/xml
|
84
84
|
Content-Length:
|
@@ -86,12 +86,12 @@ http_interactions:
|
|
86
86
|
Connection:
|
87
87
|
- keep-alive
|
88
88
|
X-Amzn-Requestid:
|
89
|
-
-
|
89
|
+
- 48022634-be35-5467-8784-75b7a2d6bcc7
|
90
90
|
body:
|
91
91
|
encoding: UTF-8
|
92
|
-
string: <?xml version="1.0"?><GetQueueAttributesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueAttributesResult><Attribute><Name>ApproximateNumberOfMessages</Name><Value>3</Value></Attribute><Attribute><Name>ApproximateNumberOfMessagesNotVisible</Name><Value>0</Value></Attribute></GetQueueAttributesResult><ResponseMetadata><RequestId>
|
92
|
+
string: <?xml version="1.0"?><GetQueueAttributesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueAttributesResult><Attribute><Name>ApproximateNumberOfMessages</Name><Value>3</Value></Attribute><Attribute><Name>ApproximateNumberOfMessagesNotVisible</Name><Value>0</Value></Attribute></GetQueueAttributesResult><ResponseMetadata><RequestId>48022634-be35-5467-8784-75b7a2d6bcc7</RequestId></ResponseMetadata></GetQueueAttributesResponse>
|
93
93
|
http_version:
|
94
|
-
recorded_at:
|
94
|
+
recorded_at: Sat, 26 May 2018 08:28:19 GMT
|
95
95
|
- request:
|
96
96
|
method: post
|
97
97
|
uri: https://sqs.eu-west-1.amazonaws.com/
|
@@ -106,12 +106,12 @@ http_interactions:
|
|
106
106
|
User-Agent:
|
107
107
|
- aws-sdk-ruby3/3.21.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
|
108
108
|
X-Amz-Date:
|
109
|
-
-
|
109
|
+
- 20180526T082819Z
|
110
110
|
X-Amz-Content-Sha256:
|
111
111
|
- 5761efd13dd0ed81182207171d3660628968189941431d6044920ef8fe7b1160
|
112
112
|
Authorization:
|
113
|
-
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/
|
114
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=
|
113
|
+
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180526/eu-west-1/sqs/aws4_request,
|
114
|
+
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=2ab509ced23271346a50f94e2becd6dbe3fcf46ad5660e57200c4f763e6d3cdb
|
115
115
|
Content-Length:
|
116
116
|
- '58'
|
117
117
|
Accept:
|
@@ -124,7 +124,7 @@ http_interactions:
|
|
124
124
|
Server:
|
125
125
|
- Server
|
126
126
|
Date:
|
127
|
-
-
|
127
|
+
- Sat, 26 May 2018 08:28:19 GMT
|
128
128
|
Content-Type:
|
129
129
|
- text/xml
|
130
130
|
Content-Length:
|
@@ -132,12 +132,12 @@ http_interactions:
|
|
132
132
|
Connection:
|
133
133
|
- keep-alive
|
134
134
|
X-Amzn-Requestid:
|
135
|
-
-
|
135
|
+
- 284a8374-00e3-5931-9a71-d0f71c007b30
|
136
136
|
body:
|
137
137
|
encoding: UTF-8
|
138
|
-
string: <?xml version="1.0"?><GetQueueUrlResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueUrlResult><QueueUrl>https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage</QueueUrl></GetQueueUrlResult><ResponseMetadata><RequestId>
|
138
|
+
string: <?xml version="1.0"?><GetQueueUrlResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueUrlResult><QueueUrl>https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage</QueueUrl></GetQueueUrlResult><ResponseMetadata><RequestId>284a8374-00e3-5931-9a71-d0f71c007b30</RequestId></ResponseMetadata></GetQueueUrlResponse>
|
139
139
|
http_version:
|
140
|
-
recorded_at:
|
140
|
+
recorded_at: Sat, 26 May 2018 08:28:19 GMT
|
141
141
|
- request:
|
142
142
|
method: post
|
143
143
|
uri: https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage
|
@@ -152,12 +152,12 @@ http_interactions:
|
|
152
152
|
User-Agent:
|
153
153
|
- aws-sdk-ruby3/3.21.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
|
154
154
|
X-Amz-Date:
|
155
|
-
-
|
155
|
+
- 20180526T082819Z
|
156
156
|
X-Amz-Content-Sha256:
|
157
157
|
- 4fa1f9790ab8d8b778fc048ef890ef00e82c1fd4658cd21964eff9eb5dc9426d
|
158
158
|
Authorization:
|
159
|
-
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/
|
160
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=
|
159
|
+
- AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180526/eu-west-1/sqs/aws4_request,
|
160
|
+
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=3db436e1ed6d3f901ff8f7481a66b7ab2bbdc6c8a08532173ec8ee9601d3c1a4
|
161
161
|
Content-Length:
|
162
162
|
- '221'
|
163
163
|
Accept:
|
@@ -170,7 +170,7 @@ http_interactions:
|
|
170
170
|
Server:
|
171
171
|
- Server
|
172
172
|
Date:
|
173
|
-
-
|
173
|
+
- Sat, 26 May 2018 08:28:19 GMT
|
174
174
|
Content-Type:
|
175
175
|
- text/xml
|
176
176
|
Content-Length:
|
@@ -178,10 +178,10 @@ http_interactions:
|
|
178
178
|
Connection:
|
179
179
|
- keep-alive
|
180
180
|
X-Amzn-Requestid:
|
181
|
-
-
|
181
|
+
- fbcc461e-f63d-5200-82d1-159deade341a
|
182
182
|
body:
|
183
183
|
encoding: UTF-8
|
184
|
-
string: <?xml version="1.0"?><GetQueueAttributesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueAttributesResult><Attribute><Name>ApproximateNumberOfMessages</Name><Value>3</Value></Attribute><Attribute><Name>ApproximateNumberOfMessagesNotVisible</Name><Value>0</Value></Attribute></GetQueueAttributesResult><ResponseMetadata><RequestId>
|
184
|
+
string: <?xml version="1.0"?><GetQueueAttributesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueAttributesResult><Attribute><Name>ApproximateNumberOfMessages</Name><Value>3</Value></Attribute><Attribute><Name>ApproximateNumberOfMessagesNotVisible</Name><Value>0</Value></Attribute></GetQueueAttributesResult><ResponseMetadata><RequestId>fbcc461e-f63d-5200-82d1-159deade341a</RequestId></ResponseMetadata></GetQueueAttributesResponse>
|
185
185
|
http_version:
|
186
|
-
recorded_at:
|
186
|
+
recorded_at: Sat, 26 May 2018 08:28:19 GMT
|
187
187
|
recorded_with: VCR 3.0.3
|