toccatore 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -3
  3. data/lib/toccatore/queue.rb +1 -1
  4. data/lib/toccatore/usage_update.rb +9 -15
  5. data/lib/toccatore/version.rb +1 -1
  6. data/spec/cli_spec.rb +4 -4
  7. data/spec/datacite_related_spec.rb +1 -1
  8. data/spec/fixtures/usage_event_fail.json +1 -1
  9. data/spec/fixtures/usage_events.json +4 -4
  10. data/spec/fixtures/vcr_cassettes/Toccatore_CLI/datacite_related/should_query_by_related_identifier.yml +1 -1
  11. data/spec/fixtures/vcr_cassettes/Toccatore_CLI/usage_update/no_reports_in_the_queue/should_succeed_with_no_works.yml +70 -116
  12. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_data/when_there_are_messages/should_return_the_data_for_one_message.yml +4 -4
  13. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_data/when_there_is_ONE_message/should_return_the_data_for_one_message.yml +4 -4
  14. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_message/should_return_no_meessage_when_the_queue_is_empty.yml +23 -23
  15. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_message/should_return_one_message_when_there_are_multiple_messages.yml +23 -23
  16. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_total/when_is_working_with_AWS.yml +44 -44
  17. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_fail_if_format_of_the_event_is_wrong.yml +27 -27
  18. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_work_with_DataCite_Event_Data_2.yml +493 -0
  19. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/queue_url/should_return_always_correct_queue_url.yml +11 -11
  20. data/spec/queque_spec.rb +2 -2
  21. data/spec/spec_helper.rb +2 -1
  22. data/spec/usage_update_spec.rb +6 -24
  23. metadata +4 -4
  24. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/queue_url/should_fail_if_the_queue_doesn_exist.yml +0 -49
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0cb6715e4b1f6670be94c0856acc321bc098f764c5d69c7a20c3f0bc97a496aa
4
- data.tar.gz: cff0f6962c115beec2264401db53c822291c1b062aee2cf33db89e93abd2d251
3
+ metadata.gz: d5f8f99a313455b5c95fee0533ec99e111e4c363d66f7bf11df06d234f0fdfe0
4
+ data.tar.gz: 5d9de10f33d65f0364f305446faf1fa078e96ab7e0492b33790150df33453c03
5
5
  SHA512:
6
- metadata.gz: 1513263252c59c07e13f9d89909ad62b99a91b6ddd05a1bd2ad310851b92362d3d74608981dd5370bd8a4265e7b7ebc63a063678a47c6598c71fa0e1158fa4c9
7
- data.tar.gz: 401fb2e8feba5d5817e4bd20c959cc72e2f5458d20933084a58e6fe681bfc1e8d90ca666b6111971d2f8ab1767557db38254f4b78631f95c71953a15e8d26e29
6
+ metadata.gz: 50f7bb6e70d54c892344175760a81ae30a1fdcfd6a76f9ca35d4831750b5a5bc57edbe15ec94bcf62e748e69d195fb0c86f37952325fa5d3c90463db8bdb9649
7
+ data.tar.gz: 5d895c55573397c711dda7a3d2ad53d75d7d19d2109c494a9b94307eb4cb3962ef58b67a261c832a5c1bf33b5764cf457043fe8cbd6493ea30da3e81467a5ac2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- toccatore (0.4.2)
4
+ toccatore (0.4.3)
5
5
  activesupport (~> 4.2, >= 4.2.5)
6
6
  aws-sdk-sqs
7
7
  dotenv (~> 2.1, >= 2.1.1)
@@ -22,8 +22,10 @@ GEM
22
22
  tzinfo (~> 1.1)
23
23
  addressable (2.5.1)
24
24
  public_suffix (~> 2.0, >= 2.0.2)
25
- aws-partitions (1.84.0)
26
- aws-sdk-core (3.20.2)
25
+ aws-eventstream (1.0.0)
26
+ aws-partitions (1.87.0)
27
+ aws-sdk-core (3.21.1)
28
+ aws-eventstream (~> 1.0)
27
29
  aws-partitions (~> 1.0)
28
30
  aws-sigv4 (~> 1.0)
29
31
  jmespath (~> 1.0)
@@ -45,7 +45,7 @@ module Toccatore
45
45
  end
46
46
 
47
47
  def queue_url options={}
48
- options[:queue_name] ||= "#{ENV['ENVIRONMENT']}_usage" || "stage_usage"
48
+ options[:queue_name] ||= "#{ENV['ENVIRONMENT']}_usage"
49
49
  queue_name = options[:queue_name]
50
50
  # puts "Using #{@sqs.get_queue_url(queue_name: queue_name).queue_url} queue"
51
51
  @sqs.get_queue_url(queue_name: queue_name).queue_url
@@ -22,16 +22,11 @@ module Toccatore
22
22
  error_total = 0
23
23
  num_messages = total
24
24
  while num_messages > 0
25
- # walk through paginated results
26
-
27
- # (0...total).each do |page|
28
- # options[:offset] = page * 1
29
- # options[:total] = total
30
- error_total += process_data(options)
31
- num_messages = get_total(options)
32
- # end
25
+ processed = process_data(options)
26
+ error_total += processed
27
+ num_messages += 1 if processed == 0
33
28
  end
34
- text = "#{num_messages} works processed with #{error_total} errors for Usage Reports Queue"
29
+ text = "#{num_messages} works processed with #{error_total} errors for Usage Reports Queue #{queue_url}"
35
30
 
36
31
  puts text
37
32
  # send slack notification
@@ -40,17 +35,17 @@ module Toccatore
40
35
  send_notification_to_slack(text, options) if options[:slack_webhook_url].present?
41
36
 
42
37
  # return number of works queued
43
- get_total(options)
38
+ num_messages
44
39
  end
45
40
 
46
41
  def process_data(options = {})
47
42
  message = get_message
48
43
  data = get_data(message)
49
- data = parse_data(data, options)
44
+ events = parse_data(data, options)
50
45
 
51
- return [OpenStruct.new(body: { "data" => [] })] if data.empty?
46
+ return [OpenStruct.new(body: { "data" => [] })] if events.empty?
52
47
 
53
- errors = push_data(data, options)
48
+ errors = push_data(events, options)
54
49
  if errors < 1
55
50
  delete_message message
56
51
  end
@@ -108,7 +103,6 @@ module Toccatore
108
103
  }
109
104
  end
110
105
 
111
-
112
106
  def parse_data(result, options={})
113
107
  return result.body.fetch("errors") if result.body.fetch("errors", nil).present?
114
108
 
@@ -127,7 +121,7 @@ module Toccatore
127
121
 
128
122
  instances = item.dig("performance", 0, "instance")
129
123
 
130
- return x += [OpenStruct.new(body: { "errors" => "There are too many instances. There can only be 4" })] if instances.size > 8
124
+ return x += [OpenStruct.new(body: { "errors" => "There are too many instances in #{data[:doi]} for report #{report_id}. There can only be 4" })] if instances.size > 8
131
125
 
132
126
  x += Array.wrap(instances).reduce([]) do |ssum, instance|
133
127
  data[:count] = instance.dig("count")
@@ -1,3 +1,3 @@
1
1
  module Toccatore
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
data/spec/cli_spec.rb CHANGED
@@ -8,7 +8,7 @@ describe Toccatore::CLI do
8
8
 
9
9
  describe "version" do
10
10
  it 'has version' do
11
- expect { subject.__print_version }.to output("0.4.2\n").to_stdout
11
+ expect { subject.__print_version }.to output("0.4.3\n").to_stdout
12
12
  end
13
13
  end
14
14
 
@@ -123,15 +123,15 @@ describe Toccatore::CLI do
123
123
  subject.options = { push_url: push_url,
124
124
  slack_webhook_url: slack_webhook_url,
125
125
  access_token: access_token}
126
- expect { subject.usage_update }.to output("0 works processed with 0 errors for Usage Reports Queue\n").to_stdout
126
+ expect { subject.usage_update }.to output("0 works processed with 0 errors for Usage Reports Queue https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage\n").to_stdout
127
127
  end
128
128
  end
129
129
 
130
130
  context "with reports in the queue" do
131
- ## TO test this we need a real queue working
131
+ # TO test this we need a real queue working
132
132
  # it 'should succeed' do
133
133
  # subject.options = cli_options
134
- # expect { subject.usage_update }.to output(/https:\/\/doi.org\/10.5281\/zenodo.16396 is_supplement_to https:\/\/doi.org\/10.1007\/s11548-015-1180-7 pushed to Event Data service.\n/).to_stdout
134
+ # expect { subject.usage_update }.to output("0 works processed with 0 errors for Usage Reports Queue https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage\n").to_stdout
135
135
  # end
136
136
  # it 'should fail' do
137
137
  # subject.options = cli_options.except(:access_token)
@@ -102,7 +102,7 @@ describe Toccatore::DataciteRelated, vcr: true do
102
102
  response = subject.parse_data(result, source_token: ENV['SOURCE_TOKEN'])
103
103
 
104
104
  expect(response.length).to eq(134)
105
- expect(response.last.except("id")).to eq("message_action" => "create", "subj_id"=>"https://doi.org/10.17180/obs.yzeron", "obj_id"=>"https://doi.org/10.1016/j.jhydrol.2013.09.055", "relation_type_id"=>"is_referenced_by", "source_id"=>"datacite","source_token" => "28276d12-b320-41ba-9272-bb0adc3466ff", "occurred_at"=>"2015-04-07T12:22:40Z", "license" => "https://creativecommons.org/publicdomain/zero/1.0/")
105
+ expect(response.last.except("id")).to eq("message_action" => "create", "subj_id"=>"https://doi.org/10.17180/obs.yzeron", "obj_id"=>"https://doi.org/10.1016/j.jhydrol.2013.09.055", "relation_type_id"=>"is_referenced_by", "source_id"=>"datacite","source_token" => "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc", "occurred_at"=>"2015-04-07T12:22:40Z", "license" => "https://creativecommons.org/publicdomain/zero/1.0/")
106
106
  end
107
107
 
108
108
  it "should report if there are works ignored because of an IsIdenticalTo relation" do
@@ -9,7 +9,7 @@
9
9
  "obj-id": "https://doi.org/10.6071/z7wc73",
10
10
  "relation-type-id": "Unique-Dataset-Requests-Machine",
11
11
  "source-id": "datacite",
12
- "source-token": "28276d12-b320-41ba-9272-bb0adc3466ff",
12
+ "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc",
13
13
  "occurred-at": "2128-04-09",
14
14
  "license": "https://creativecommons.org/publicdomain/zero/1.0/"
15
15
  }
@@ -11,7 +11,7 @@
11
11
  "obj-id": "https://doi.org/10.7291/d1q94r",
12
12
  "relation-type-id": "total-dataset-investigations-regular",
13
13
  "source-id": "datacite",
14
- "source-token": "28276d12-b320-41ba-9272-bb0adc3466ff",
14
+ "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc",
15
15
  "occurred-at": "2128-04-09",
16
16
  "license": "https://creativecommons.org/publicdomain/zero/1.0/"
17
17
  }, {
@@ -26,7 +26,7 @@
26
26
  "obj-id": "https://doi.org/10.7291/d1q94r",
27
27
  "relation-type-id": "unique-dataset-investigations-regular",
28
28
  "source-id": "datacite",
29
- "source-token": "28276d12-b320-41ba-9272-bb0adc3466ff",
29
+ "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc",
30
30
  "occurred-at": "2128-04-09",
31
31
  "license": "https://creativecommons.org/publicdomain/zero/1.0/"
32
32
  }, {
@@ -41,7 +41,7 @@
41
41
  "obj-id": "https://doi.org/10.6071/z7wc73",
42
42
  "relation-type-id": "Total-Dataset-Requests-Machine",
43
43
  "source-id": "datacite",
44
- "source-token": "28276d12-b320-41ba-9272-bb0adc3466ff",
44
+ "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc",
45
45
  "occurred-at": "2128-04-09",
46
46
  "license": "https://creativecommons.org/publicdomain/zero/1.0/"
47
47
  }, {
@@ -56,7 +56,7 @@
56
56
  "obj-id": "https://doi.org/10.6071/z7wc73",
57
57
  "relation-type-id": "Unique-Dataset-Requests-Machine",
58
58
  "source-id": "datacite",
59
- "source-token": "28276d12-b320-41ba-9272-bb0adc3466ff",
59
+ "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc",
60
60
  "occurred-at": "2128-04-09",
61
61
  "license": "https://creativecommons.org/publicdomain/zero/1.0/"
62
62
  }
@@ -191,7 +191,7 @@ http_interactions:
191
191
  uri: https://bus-staging.eventdata.crossref.org/events
192
192
  body:
193
193
  encoding: UTF-8
194
- string: '{"id":"6accc7dd-d727-4202-9d33-a314d357fc2f","message_action":"create","subj_id":"https://doi.org/10.5061/dryad.b835k","obj_id":"https://doi.org/10.7554/elife.01567","relation_type_id":"is_referenced_by","source_id":"datacite","source_token":"28276d12-b320-41ba-9272-bb0adc3466ff","occurred_at":"2014-01-23T19:20:48Z"}'
194
+ string: '{"id":"6accc7dd-d727-4202-9d33-a314d357fc2f","message_action":"create","subj_id":"https://doi.org/10.5061/dryad.b835k","obj_id":"https://doi.org/10.7554/elife.01567","relation_type_id":"is_referenced_by","source_id":"datacite","source_token":"43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc","occurred_at":"2014-01-23T19:20:48Z"}'
195
195
  headers:
196
196
  User-Agent:
197
197
  - Maremma - https://github.com/datacite/maremma
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://sqs.eu-west-1.amazonaws.com/
6
6
  body:
7
7
  encoding: UTF-8
8
- string: Action=GetQueueUrl&QueueName=stage_usage&Version=2012-11-05
8
+ string: Action=GetQueueUrl&QueueName=test_usage&Version=2012-11-05
9
9
  headers:
10
10
  Content-Type:
11
11
  - application/x-www-form-urlencoded; charset=utf-8
@@ -14,14 +14,14 @@ http_interactions:
14
14
  User-Agent:
15
15
  - aws-sdk-ruby3/3.20.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
16
16
  X-Amz-Date:
17
- - 20180517T135353Z
17
+ - 20180521T110327Z
18
18
  X-Amz-Content-Sha256:
19
- - 5034a1b0b889e68da64b7a052e782d357595681cff3bfea21cac68581dec9836
19
+ - 5761efd13dd0ed81182207171d3660628968189941431d6044920ef8fe7b1160
20
20
  Authorization:
21
- - AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180517/eu-west-1/sqs/aws4_request,
22
- SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=bebc3d0da820ae3bd911134080ed6461359fd357bce937b15580b1107e73e94b
21
+ - AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180521/eu-west-1/sqs/aws4_request,
22
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=5414e1c758e4fd14204c1cd2c287210cf4b59642434b472cce1046ad83549bb7
23
23
  Content-Length:
24
- - '59'
24
+ - '58'
25
25
  Accept:
26
26
  - "*/*"
27
27
  response:
@@ -32,26 +32,26 @@ http_interactions:
32
32
  Server:
33
33
  - Server
34
34
  Date:
35
- - Thu, 17 May 2018 13:53:53 GMT
35
+ - Mon, 21 May 2018 11:03:28 GMT
36
36
  Content-Type:
37
37
  - text/xml
38
38
  Content-Length:
39
- - '331'
39
+ - '330'
40
40
  Connection:
41
41
  - keep-alive
42
42
  X-Amzn-Requestid:
43
- - bc0893f6-562e-544a-9a6f-c081dd9fba5e
43
+ - 88c27720-9253-5ee8-96f3-245c3b934d65
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/stage_usage</QueueUrl></GetQueueUrlResult><ResponseMetadata><RequestId>bc0893f6-562e-544a-9a6f-c081dd9fba5e</RequestId></ResponseMetadata></GetQueueUrlResponse>
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>88c27720-9253-5ee8-96f3-245c3b934d65</RequestId></ResponseMetadata></GetQueueUrlResponse>
47
47
  http_version:
48
- recorded_at: Thu, 17 May 2018 13:53:54 GMT
48
+ recorded_at: Mon, 21 May 2018 11:03:28 GMT
49
49
  - request:
50
50
  method: post
51
- uri: https://sqs.eu-west-1.amazonaws.com/404017989009/stage_usage
51
+ uri: https://sqs.eu-west-1.amazonaws.com/404017989009/test_usage
52
52
  body:
53
53
  encoding: UTF-8
54
- string: Action=GetQueueAttributes&AttributeName.1=ApproximateNumberOfMessages&AttributeName.2=ApproximateNumberOfMessagesNotVisible&QueueUrl=https%3A%2F%2Fsqs.eu-west-1.amazonaws.com%2F404017989009%2Fstage_usage&Version=2012-11-05
54
+ string: Action=GetQueueAttributes&AttributeName.1=ApproximateNumberOfMessages&AttributeName.2=ApproximateNumberOfMessagesNotVisible&QueueUrl=https%3A%2F%2Fsqs.eu-west-1.amazonaws.com%2F404017989009%2Ftest_usage&Version=2012-11-05
55
55
  headers:
56
56
  Content-Type:
57
57
  - application/x-www-form-urlencoded; charset=utf-8
@@ -60,14 +60,14 @@ http_interactions:
60
60
  User-Agent:
61
61
  - aws-sdk-ruby3/3.20.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
62
62
  X-Amz-Date:
63
- - 20180517T135354Z
63
+ - 20180521T110328Z
64
64
  X-Amz-Content-Sha256:
65
- - 96a6d2cb54f526d279e954a56182b68f10b0ee5e7a64bc951623176e816b2435
65
+ - 4fa1f9790ab8d8b778fc048ef890ef00e82c1fd4658cd21964eff9eb5dc9426d
66
66
  Authorization:
67
- - AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180517/eu-west-1/sqs/aws4_request,
68
- SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=90fb080b0ba9bc6fe3181e653cbd8961faf5923a5bccd72e6edfb611f8297cb2
67
+ - AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180521/eu-west-1/sqs/aws4_request,
68
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=c718cb55335a28510e0e321979a6ec45773b2e3fda7573324db765637f3b2147
69
69
  Content-Length:
70
- - '222'
70
+ - '221'
71
71
  Accept:
72
72
  - "*/*"
73
73
  response:
@@ -78,7 +78,7 @@ http_interactions:
78
78
  Server:
79
79
  - Server
80
80
  Date:
81
- - Thu, 17 May 2018 13:53:54 GMT
81
+ - Mon, 21 May 2018 11:03:28 GMT
82
82
  Content-Type:
83
83
  - text/xml
84
84
  Content-Length:
@@ -86,73 +86,18 @@ http_interactions:
86
86
  Connection:
87
87
  - keep-alive
88
88
  X-Amzn-Requestid:
89
- - c1a29456-465b-53ae-aebc-c721cde986e3
89
+ - 512d1c94-dc6a-568c-b788-4fe875aa65a6
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>0</Value></Attribute><Attribute><Name>ApproximateNumberOfMessagesNotVisible</Name><Value>0</Value></Attribute></GetQueueAttributesResult><ResponseMetadata><RequestId>c1a29456-465b-53ae-aebc-c721cde986e3</RequestId></ResponseMetadata></GetQueueAttributesResponse>
92
+ string: <?xml version="1.0"?><GetQueueAttributesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueAttributesResult><Attribute><Name>ApproximateNumberOfMessages</Name><Value>0</Value></Attribute><Attribute><Name>ApproximateNumberOfMessagesNotVisible</Name><Value>1</Value></Attribute></GetQueueAttributesResult><ResponseMetadata><RequestId>512d1c94-dc6a-568c-b788-4fe875aa65a6</RequestId></ResponseMetadata></GetQueueAttributesResponse>
93
93
  http_version:
94
- recorded_at: Thu, 17 May 2018 13:53:54 GMT
95
- - request:
96
- method: post
97
- uri: "<SLACK_WEBHOOK_URL>"
98
- body:
99
- encoding: US-ASCII
100
- string: payload=%7B%22username%22%3A%22Event+Data+Agent%22%2C%22icon_url%22%3A%22https%3A%2F%2Fraw.githubusercontent.com%2Fdatacite%2Ftoccatore%2Fmaster%2Flib%2Ftoccatore%2Fimages%2Ftoccatore.png%22%2C%22attachments%22%3A%5B%7B%22title%22%3A%22Report+for+usage_update%22%2C%22text%22%3A%220+works+processed+with+0+errors+for+Usage+Reports+Queue%22%2C%22color%22%3A%22warning%22%7D%5D%7D
101
- headers:
102
- Accept-Encoding:
103
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
104
- Accept:
105
- - "*/*"
106
- User-Agent:
107
- - Ruby
108
- Content-Type:
109
- - application/x-www-form-urlencoded
110
- response:
111
- status:
112
- code: 200
113
- message: OK
114
- headers:
115
- Content-Type:
116
- - text/html
117
- Content-Length:
118
- - '22'
119
- Connection:
120
- - keep-alive
121
- Date:
122
- - Thu, 17 May 2018 13:53:54 GMT
123
- Server:
124
- - Apache
125
- X-Slack-Backend:
126
- - h
127
- Referrer-Policy:
128
- - no-referrer
129
- Strict-Transport-Security:
130
- - max-age=31536000; includeSubDomains; preload
131
- X-Frame-Options:
132
- - SAMEORIGIN
133
- Vary:
134
- - Accept-Encoding
135
- Access-Control-Allow-Origin:
136
- - "*"
137
- X-Via:
138
- - haproxy-www-7xdi
139
- X-Cache:
140
- - Miss from cloudfront
141
- Via:
142
- - 1.1 9bb7bac3df4ba5eb70e607f6fa98eab8.cloudfront.net (CloudFront)
143
- X-Amz-Cf-Id:
144
- - Upbb1emQ0p1Da2EjO_ivEA_ZY5XE3j2hqc39PamDfqGKQCian2SBKw==
145
- body:
146
- encoding: ASCII-8BIT
147
- string: ok
148
- http_version:
149
- recorded_at: Thu, 17 May 2018 13:53:54 GMT
94
+ recorded_at: Mon, 21 May 2018 11:03:28 GMT
150
95
  - request:
151
96
  method: post
152
97
  uri: https://sqs.eu-west-1.amazonaws.com/
153
98
  body:
154
99
  encoding: UTF-8
155
- string: Action=GetQueueUrl&QueueName=stage_usage&Version=2012-11-05
100
+ string: Action=GetQueueUrl&QueueName=test_usage&Version=2012-11-05
156
101
  headers:
157
102
  Content-Type:
158
103
  - application/x-www-form-urlencoded; charset=utf-8
@@ -161,14 +106,14 @@ http_interactions:
161
106
  User-Agent:
162
107
  - aws-sdk-ruby3/3.20.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
163
108
  X-Amz-Date:
164
- - 20180517T135354Z
109
+ - 20180521T110328Z
165
110
  X-Amz-Content-Sha256:
166
- - 5034a1b0b889e68da64b7a052e782d357595681cff3bfea21cac68581dec9836
111
+ - 5761efd13dd0ed81182207171d3660628968189941431d6044920ef8fe7b1160
167
112
  Authorization:
168
- - AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180517/eu-west-1/sqs/aws4_request,
169
- SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=62b57367ad5be273f2a3001f081487440a655bc427b12dbe22a5863e2454e8e3
113
+ - AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180521/eu-west-1/sqs/aws4_request,
114
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=4771cd5c30016ac15fcf8100ecae01d583788bc44a3e947ae91a5a3cb4ceb2c3
170
115
  Content-Length:
171
- - '59'
116
+ - '58'
172
117
  Accept:
173
118
  - "*/*"
174
119
  response:
@@ -179,64 +124,73 @@ http_interactions:
179
124
  Server:
180
125
  - Server
181
126
  Date:
182
- - Thu, 17 May 2018 13:53:54 GMT
127
+ - Mon, 21 May 2018 11:03:28 GMT
183
128
  Content-Type:
184
129
  - text/xml
185
130
  Content-Length:
186
- - '331'
131
+ - '330'
187
132
  Connection:
188
133
  - keep-alive
189
134
  X-Amzn-Requestid:
190
- - c9b352e6-b1e8-5fd3-ac17-01913a5a2afc
135
+ - 812a66e7-e4a7-5781-98e3-359b4d679550
191
136
  body:
192
137
  encoding: UTF-8
193
- 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/stage_usage</QueueUrl></GetQueueUrlResult><ResponseMetadata><RequestId>c9b352e6-b1e8-5fd3-ac17-01913a5a2afc</RequestId></ResponseMetadata></GetQueueUrlResponse>
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>812a66e7-e4a7-5781-98e3-359b4d679550</RequestId></ResponseMetadata></GetQueueUrlResponse>
194
139
  http_version:
195
- recorded_at: Thu, 17 May 2018 13:53:54 GMT
140
+ recorded_at: Mon, 21 May 2018 11:03:28 GMT
196
141
  - request:
197
142
  method: post
198
- uri: https://sqs.eu-west-1.amazonaws.com/404017989009/stage_usage
143
+ uri: "<SLACK_WEBHOOK_URL>"
199
144
  body:
200
- encoding: UTF-8
201
- string: Action=GetQueueAttributes&AttributeName.1=ApproximateNumberOfMessages&AttributeName.2=ApproximateNumberOfMessagesNotVisible&QueueUrl=https%3A%2F%2Fsqs.eu-west-1.amazonaws.com%2F404017989009%2Fstage_usage&Version=2012-11-05
145
+ encoding: US-ASCII
146
+ string: payload=%7B%22username%22%3A%22Event+Data+Agent%22%2C%22icon_url%22%3A%22https%3A%2F%2Fraw.githubusercontent.com%2Fdatacite%2Ftoccatore%2Fmaster%2Flib%2Ftoccatore%2Fimages%2Ftoccatore.png%22%2C%22attachments%22%3A%5B%7B%22title%22%3A%22Report+for+usage_update%22%2C%22text%22%3A%220+works+processed+with+0+errors+for+Usage+Reports+Queue+https%3A%2F%2Fsqs.eu-west-1.amazonaws.com%2F404017989009%2Ftest_usage%22%2C%22color%22%3A%22warning%22%7D%5D%7D
202
147
  headers:
203
- Content-Type:
204
- - application/x-www-form-urlencoded; charset=utf-8
205
148
  Accept-Encoding:
206
- - ''
207
- User-Agent:
208
- - aws-sdk-ruby3/3.20.2 ruby/2.3.3 x86_64-darwin15 aws-sdk-sqs/1.3.0
209
- X-Amz-Date:
210
- - 20180517T135354Z
211
- X-Amz-Content-Sha256:
212
- - 96a6d2cb54f526d279e954a56182b68f10b0ee5e7a64bc951623176e816b2435
213
- Authorization:
214
- - AWS4-HMAC-SHA256 Credential=AKIAIXLDUBIDM74CC6KQ/20180517/eu-west-1/sqs/aws4_request,
215
- SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=90fb080b0ba9bc6fe3181e653cbd8961faf5923a5bccd72e6edfb611f8297cb2
216
- Content-Length:
217
- - '222'
149
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
218
150
  Accept:
219
151
  - "*/*"
152
+ User-Agent:
153
+ - Ruby
154
+ Content-Type:
155
+ - application/x-www-form-urlencoded
220
156
  response:
221
157
  status:
222
158
  code: 200
223
159
  message: OK
224
160
  headers:
225
- Server:
226
- - Server
227
- Date:
228
- - Thu, 17 May 2018 13:53:54 GMT
229
161
  Content-Type:
230
- - text/xml
162
+ - text/html
231
163
  Content-Length:
232
- - '446'
164
+ - '22'
233
165
  Connection:
234
166
  - keep-alive
235
- X-Amzn-Requestid:
236
- - 793887b1-401d-5680-9d0a-d4c6cbafdcc9
167
+ Date:
168
+ - Mon, 21 May 2018 11:03:29 GMT
169
+ Server:
170
+ - Apache
171
+ X-Slack-Backend:
172
+ - h
173
+ Referrer-Policy:
174
+ - no-referrer
175
+ Strict-Transport-Security:
176
+ - max-age=31536000; includeSubDomains; preload
177
+ X-Frame-Options:
178
+ - SAMEORIGIN
179
+ Vary:
180
+ - Accept-Encoding
181
+ Access-Control-Allow-Origin:
182
+ - "*"
183
+ X-Via:
184
+ - haproxy-www-n712
185
+ X-Cache:
186
+ - Miss from cloudfront
187
+ Via:
188
+ - 1.1 77bf0d58790cfb484da5202fe124c53f.cloudfront.net (CloudFront)
189
+ X-Amz-Cf-Id:
190
+ - DwT_7NcPg4LrvuropK2xun2b3PLF2ZSBnH-A7YjkYQLHn5PSwPTZLQ==
237
191
  body:
238
- encoding: UTF-8
239
- string: <?xml version="1.0"?><GetQueueAttributesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><GetQueueAttributesResult><Attribute><Name>ApproximateNumberOfMessages</Name><Value>0</Value></Attribute><Attribute><Name>ApproximateNumberOfMessagesNotVisible</Name><Value>0</Value></Attribute></GetQueueAttributesResult><ResponseMetadata><RequestId>793887b1-401d-5680-9d0a-d4c6cbafdcc9</RequestId></ResponseMetadata></GetQueueAttributesResponse>
192
+ encoding: ASCII-8BIT
193
+ string: ok
240
194
  http_version:
241
- recorded_at: Thu, 17 May 2018 13:53:54 GMT
195
+ recorded_at: Mon, 21 May 2018 11:03:29 GMT
242
196
  recorded_with: VCR 3.0.3