toccatore 0.4.0 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +12 -3
  3. data/lib/toccatore/cli.rb +1 -1
  4. data/lib/toccatore/queue.rb +8 -2
  5. data/lib/toccatore/usage_update.rb +64 -52
  6. data/lib/toccatore/version.rb +1 -1
  7. data/spec/cli_spec.rb +4 -4
  8. data/spec/datacite_related_spec.rb +1 -1
  9. data/spec/factories/default.rb +22 -0
  10. data/spec/fixtures/event_data_resp_2 +4 -4
  11. data/spec/fixtures/events_empty.json +33 -0
  12. data/spec/fixtures/usage_event.json +1 -1
  13. data/spec/fixtures/usage_event_fail.json +1 -1
  14. data/spec/fixtures/usage_events.json +8 -8
  15. data/spec/fixtures/vcr_cassettes/Toccatore_CLI/datacite_related/should_query_by_related_identifier.yml +1 -1
  16. data/spec/fixtures/vcr_cassettes/Toccatore_CLI/usage_update/no_reports_in_the_queue/should_succeed_with_no_works.yml +66 -20
  17. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_data/when_there_are_messages/should_return_the_data_for_one_message.yml +13 -13
  18. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_data/when_there_is_ONE_message/should_return_the_data_for_one_message.yml +13 -13
  19. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_message/should_return_no_meessage_when_the_queue_is_empty.yml +95 -0
  20. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_message/should_return_one_message_when_there_are_multiple_messages.yml +95 -0
  21. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/get_total/when_is_working_with_AWS.yml +187 -0
  22. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_fail_if_format_of_the_event_is_empty.yml +52 -0
  23. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_fail_if_format_of_the_event_is_wrong.yml +1039 -80
  24. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_work_with_a_single_item.yml +289 -0
  25. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/queue_url/should_return_always_correct_queue_url.yml +49 -0
  26. data/spec/queque_spec.rb +44 -58
  27. data/spec/spec_helper.rb +9 -1
  28. data/spec/usage_update_spec.rb +50 -60
  29. data/toccatore.gemspec +4 -0
  30. metadata +53 -6
  31. data/spec/fixtures/vcr_cassettes/Toccatore_CLI/usage_update/should_fail.yml +0 -150
  32. data/spec/fixtures/vcr_cassettes/Toccatore_CLI/usage_update/should_succeed_with_no_works.yml +0 -150
  33. data/spec/fixtures/vcr_cassettes/Toccatore_UsageUpdate/push_data/should_work_with_DataCite_Event_Data.yml +0 -199
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4f98467d1df1b0ce5226b887a5cd1d5b9e3fb551bfc631e9857fca366ee7d29
4
- data.tar.gz: fd8c901be0ee18936711f73e959e19cee8e9ecdf114df8b6372af83e2e8922e5
3
+ metadata.gz: 4d2393ac345f665ff869026daac1b7b682a9e030a7d789282a0bdd2948e03f16
4
+ data.tar.gz: 7430af2a9767e27c9db91e16146f02c0f63c2f756610ebfd3b07497851c00f01
5
5
  SHA512:
6
- metadata.gz: 5e3f4a9db657604571d0be6f45222e8bae2a7b7c6c5e0945cf7aeb6aec0099d0caaa0f210665d2fa7c9f88a8dc74e5c9e4f4e2326b29df0332d93fd3d93e51e7
7
- data.tar.gz: f81581346057dbe1e0d0e25c37bdfa2be5cf4ba00c59f5da36cb606a0806085c7a6b47724939e5fb032a93aa153090cf17b6c55d426e8480b61ebb5a5e99bebe
6
+ metadata.gz: df1fc16c9eae4ef0559d8ce8fc182642eb685204e979da0888b0283d164f820f81b3acdbf2c98f8ae4cd370788cb1a62f0f8687d06b2908dc4f7fef4f3a5f307
7
+ data.tar.gz: 48b01f06f65370caeae8610041c16df4111af98b1cafc748f901d71053168f4d036f7c3757d48d2a276a2c804586a8d0346bdce87d6b19299a903a75ee79f7b6
data/Gemfile.lock CHANGED
@@ -1,10 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- toccatore (0.4.0)
4
+ toccatore (0.4.9)
5
5
  activesupport (~> 4.2, >= 4.2.5)
6
6
  aws-sdk-sqs
7
7
  dotenv (~> 2.1, >= 2.1.1)
8
+ factory_bot
8
9
  gender_detector (~> 1.0)
9
10
  maremma (~> 3.5)
10
11
  namae (~> 0.11.0)
@@ -21,8 +22,10 @@ GEM
21
22
  tzinfo (~> 1.1)
22
23
  addressable (2.5.1)
23
24
  public_suffix (~> 2.0, >= 2.0.2)
24
- aws-partitions (1.84.0)
25
- aws-sdk-core (3.20.2)
25
+ aws-eventstream (1.0.0)
26
+ aws-partitions (1.87.0)
27
+ aws-sdk-core (3.21.2)
28
+ aws-eventstream (~> 1.0)
26
29
  aws-partitions (~> 1.0)
27
30
  aws-sigv4 (~> 1.0)
28
31
  jmespath (~> 1.0)
@@ -40,6 +43,10 @@ GEM
40
43
  docile (1.1.5)
41
44
  dotenv (2.4.0)
42
45
  excon (0.45.4)
46
+ factory_bot (4.8.2)
47
+ activesupport (>= 3.0.0)
48
+ faker (1.8.7)
49
+ i18n (>= 0.7)
43
50
  faraday (0.9.2)
44
51
  multipart-post (>= 1.2, < 3)
45
52
  faraday-encoding (0.0.4)
@@ -112,6 +119,8 @@ PLATFORMS
112
119
  DEPENDENCIES
113
120
  bundler (~> 1.0)
114
121
  codeclimate-test-reporter (~> 1.0, >= 1.0.0)
122
+ factory_bot
123
+ faker
115
124
  rack-test (~> 0)
116
125
  rake (~> 12.0)
117
126
  rspec (~> 3.4)
data/lib/toccatore/cli.rb CHANGED
@@ -53,7 +53,7 @@ module Toccatore
53
53
  method_option :push_url, type: :string
54
54
  method_option :slack_webhook_url, type: :string
55
55
  method_option :doi, type: :string
56
- method_option :jsonapi, :type => :boolean, :force => true
56
+ method_option :jsonapi, :type => :boolean, default: true
57
57
  def usage_update
58
58
  usage_update = Toccatore::UsageUpdate.new
59
59
  usage_update.queue_jobs(usage_update.unfreeze(options))
@@ -4,7 +4,10 @@ module Toccatore
4
4
  module Queue
5
5
 
6
6
  def queue options={}
7
- Aws::SQS::Client.new(region: ENV['AWS_REGION'].to_s, stub_responses: false)
7
+ puts "Queue name has not been specified" unless ENV['ENVIRONMENT'].present?
8
+ puts "AWS_REGION has not been specified" unless ENV['AWS_REGION'].present?
9
+ region = ENV['AWS_REGION'] ||= 'eu-west-1'
10
+ Aws::SQS::Client.new(region: region.to_s, stub_responses: false)
8
11
  end
9
12
 
10
13
  def get_total options={}
@@ -28,6 +31,7 @@ module Toccatore
28
31
  end
29
32
 
30
33
  def delete_message options={}
34
+ return 1 if options.messages.size < 1
31
35
  reponse = @sqs.delete_message({
32
36
  queue_url: queue_url,
33
37
  receipt_handle: options.messages[0][:receipt_handle]
@@ -43,7 +47,9 @@ module Toccatore
43
47
  end
44
48
 
45
49
  def queue_url options={}
46
- queue_name = queue_name ||= "#{ENV['ENVIROMENT']}_usage"
50
+ options[:queue_name] ||= "#{ENV['ENVIRONMENT']}_usage"
51
+ queue_name = options[:queue_name]
52
+ # puts "Using #{@sqs.get_queue_url(queue_name: queue_name).queue_url} queue"
47
53
  @sqs.get_queue_url(queue_name: queue_name).queue_url
48
54
  end
49
55
  end
@@ -19,18 +19,16 @@ module Toccatore
19
19
  text = "No works found for in the Usage Reports Queue."
20
20
  end
21
21
 
22
- while total > 0
23
- # walk through paginated results
24
- total_pages = (total.to_f / job_batch_size).ceil
25
- error_total = 0
26
-
27
- (0...total_pages).each do |page|
28
- options[:offset] = page * job_batch_size
29
- options[:total] = total
30
- error_total += process_data(options)
31
- end
32
- text = "#{total} works processed with #{error_total} errors for Usage Reports Queue"
22
+ error_total = 0
23
+ proccessed_messages = 0
24
+ num_messages = total
25
+ while num_messages != 0
26
+ processed = process_data(options)
27
+ error_total += processed
28
+ proccessed_messages += 1 if processed == 0
29
+ num_messages -= proccessed_messages
33
30
  end
31
+ text = "#{proccessed_messages} works processed with #{error_total} errors for Usage Reports Queue #{queue_url}"
34
32
 
35
33
  puts text
36
34
  # send slack notification
@@ -39,25 +37,32 @@ module Toccatore
39
37
  send_notification_to_slack(text, options) if options[:slack_webhook_url].present?
40
38
 
41
39
  # return number of works queued
42
- total
40
+ proccessed_messages
43
41
  end
44
42
 
45
43
  def process_data(options = {})
44
+ errors = 0
46
45
  message = get_message
47
- data = get_data(message)
48
- data = parse_data(data, options)
49
-
50
- return [OpenStruct.new(body: { "data" => [] })] if data.empty?
51
-
52
- push_data(data, options)
53
- delete_message message
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
53
+ end
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
- Maremma.get(body["report_id"])
59
+ url = body["report_id"]
60
+ host = URI.parse(body["report_id"]).host.downcase
61
+ puts url
62
+ puts host
63
+ puts body
64
+ puts "%%%%%%%%%%"
65
+ Maremma.get(url, timeout: 120, host: host)
61
66
  end
62
67
 
63
68
 
@@ -72,22 +77,24 @@ module Toccatore
72
77
  else
73
78
  error_total = 0
74
79
  Array(items).each do |item|
75
- error_total += push_item(item, options)
80
+ puts item
81
+ puts "*************"
82
+ error_total += push_item(item, options)
76
83
  end
77
84
  error_total
78
85
  end
79
86
  end
80
87
 
81
- def metrics_url
82
- ENV['SASHIMI_URL']
83
- end
84
-
85
88
  def source_id
86
89
  "usage_update"
87
90
  end
88
91
 
89
92
  def format_event type, data, options
90
- { "id" => SecureRandom.uuid,
93
+ fail "Not type given. Report #{data[:report_id]} not proccessed" if type.blank?
94
+ fail "Access token missing." if options[:source_token].blank?
95
+ fail "Report_id is missing" if data[:report_id].blank?
96
+
97
+ { "uuid" => SecureRandom.uuid,
91
98
  "message-action" => "add",
92
99
  "subj-id" => data[:report_id],
93
100
  "subj"=> {
@@ -104,13 +111,15 @@ module Toccatore
104
111
  }
105
112
  end
106
113
 
107
-
108
114
  def parse_data(result, options={})
115
+ puts result.status
116
+ puts "*************"
109
117
  return result.body.fetch("errors") if result.body.fetch("errors", nil).present?
118
+ return [{ "errors" => { "title" => "The report is blank" }}] if result.body.blank?
110
119
 
111
120
  items = result.body.dig("data","report","report-datasets")
112
121
  header = result.body.dig("data","report","report-header")
113
- report_id = metrics_url + "/" + result.body.dig("data","report","id")
122
+ report_id = result.url
114
123
 
115
124
  created = header.fetch("created")
116
125
  Array.wrap(items).reduce([]) do |x, item|
@@ -123,7 +132,7 @@ module Toccatore
123
132
 
124
133
  instances = item.dig("performance", 0, "instance")
125
134
 
126
- return x += [OpenStruct.new(body: { "errors" => "There are too many instances. There can only be 4" })] if instances.size > 8
135
+ 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
127
136
 
128
137
  x += Array.wrap(instances).reduce([]) do |ssum, instance|
129
138
  data[:count] = instance.dig("count")
@@ -135,31 +144,34 @@ module Toccatore
135
144
  end
136
145
 
137
146
  def push_item(item, options={})
138
- return OpenStruct.new(body: { "errors" => [{ "title" => "Access token missing." }] }) if options[:access_token].blank?
139
-
140
- host = options[:push_url].presence || "https://api.test.datacite.org"
141
- push_url = host + "/events"
142
-
143
- if options[:jsonapi]
144
- data = { "data" => {
145
- "id" => item["id"],
146
- "type" => "events",
147
- "attributes" => item.except("id") }}
148
- response = Maremma.post(push_url, data: data.to_json,
149
- bearer: options[:access_token],
150
- content_type: 'json',
151
- host: host)
152
- else
153
- response = Maremma.post(push_url, data: item.to_json,
154
- bearer: options[:access_token],
155
- content_type: 'json',
156
- host: host)
147
+ if item["subj-id"].blank?
148
+ puts OpenStruct.new(body: { "errors" => [{ "title" => "There is no Subject" }] })
149
+ return 1
150
+ elsif options[:access_token].blank?
151
+ puts OpenStruct.new(body: { "errors" => [{ "title" => "Access token missing." }] })
152
+ return 1
153
+ elsif item["errors"].present?
154
+ puts OpenStruct.new(body: { "errors" => [{ "title" => "#{item["errors"]["title"]}" }] })
155
+ return 1
157
156
  end
158
157
 
159
- # return 0 if successful, 1 if error
160
- if response.status == 201
158
+ host = options[:push_url].presence || "https://api.test.datacite.org"
159
+ push_url = host + "/events/" + item["uuid"].to_s
160
+ data = { "data" => {
161
+ "id" => item["uuid"],
162
+ "type" => "events",
163
+ "attributes" => item.except("id") }}
164
+ response = Maremma.put(push_url, data: data.to_json,
165
+ bearer: options[:access_token],
166
+ content_type: 'application/json',
167
+ host: host)
168
+
169
+ if response.status == 201
161
170
  puts "#{item['subj-id']} #{item['relation-type-id']} #{item['obj-id']} pushed to Event Data service."
162
171
  0
172
+ elsif response.status == 200
173
+ puts "#{item['subj-id']} #{item['relation-type-id']} #{item['obj-id']} pushed to Event Data service for update."
174
+ 0
163
175
  elsif response.body["errors"].present?
164
176
  puts "#{item['subj-id']} #{item['relation-type-id']} #{item['obj-id']} had an error:"
165
177
  puts "#{response.body['errors'].first['title']}"
@@ -1,3 +1,3 @@
1
1
  module Toccatore
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.9"
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.0\n").to_stdout
11
+ expect { subject.__print_version }.to output("0.4.9\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("No works found for in the 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
@@ -0,0 +1,22 @@
1
+ require "faker"
2
+ require 'securerandom'
3
+
4
+
5
+ FactoryBot.define do
6
+ factory :event , class: OpenStruct do
7
+ sequence(:uuid) { |n| "#{SecureRandom.uuid}-#{n}" }
8
+ message_action "add"
9
+ sequence(:obj_id) { |n| "#{Faker::Internet.url}#{n}" }
10
+ sequence(:subj_id) { |n| "#{Faker::Internet.url}#{n}" }
11
+ total Faker::Number.number(3)
12
+ subj {{
13
+ "pid" => "fdfdfd",
14
+ "issued" => Faker::Time.between(DateTime.now - 2, DateTime.now),
15
+ }}
16
+ relation_type_id ["total-dataset-investigations-regular","total-dataset-investigations-machine","unique-dataset-investigations-machine","total-dataset-investigations-machine"].sample
17
+ source_id "datacite-usage"
18
+ sequence(:source_token) { |n| "#{SecureRandom.uuid}-#{n}" }
19
+ occurred_at Faker::Time.between(DateTime.now - 2, DateTime.now)
20
+ license "https://creativecommons.org/publicdomain/zero/1.0/"
21
+ end
22
+ end
@@ -1,4 +1,4 @@
1
- https://metrics.test.datacite.org/reports/2018-3-Dash total-dataset-investigations-regular https://doi.org/10.7291/d1q94r pushed to Event Data service.
2
- https://metrics.test.datacite.org/reports/2018-3-Dash unique-dataset-investigations-regular https://doi.org/10.7291/d1q94r pushed to Event Data service.
3
- https://metrics.test.datacite.org/reports/2018-3-Dash Total-Dataset-Requests-Machine https://doi.org/10.6071/z7wc73 pushed to Event Data service.
4
- https://metrics.test.datacite.org/reports/2018-3-Dash Unique-Dataset-Requests-Machine https://doi.org/10.6071/z7wc73 pushed to Event Data service.
1
+ https://metrics.test.datacite.org/reports/2018-3-Dash total-dataset-investigations-regular https://doi.org/10.7291/d1q94r had an error:\nthe server responded with status 500/\n
2
+ https://metrics.test.datacite.org/reports/2018-3-Dash unique-dataset-investigations-regular https://doi.org/10.7291/d1q94r had an error:\nthe server responded with status 500/\n
3
+ https://metrics.test.datacite.org/reports/2018-3-Dash Total-Dataset-Requests-Machine https://doi.org/10.6071/z7wc73 had an error:\nthe server responded with status 500/\n
4
+ https://metrics.test.datacite.org/reports/2018-3-Dash Unique-Dataset-Requests-Machine https://doi.org/10.6071/z7wc73 had an error:\nthe server responded with status 500/\n
@@ -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
+ ]
@@ -1 +1 @@
1
- {"report_id":"https://metrics.test.datacite.org/reports/2018-3-DataONE"}
1
+ {"report_id":"https://metrics.test.datacite.org/reports/5cac6ca0-9391-4e1d-95cf-ba2f475cbfad"}
@@ -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
  }
@@ -1,6 +1,6 @@
1
1
  [
2
2
  {
3
- "id": "a17e783b-8214-451e-9b0d-077213c2acae",
3
+ "uuid": "a17e783b-8214-451e-9b0d-077213c2acae",
4
4
  "message-action": "add",
5
5
  "subj-id": "https://metrics.test.datacite.org/reports/2018-3-Dash",
6
6
  "subj": {
@@ -11,11 +11,11 @@
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
  }, {
18
- "id": "fc6860b8-4230-41bc-8b8e-21d60e9a7d9a",
18
+ "uuid": "fc6860b8-4230-41bc-8b8e-21d60e9a7d9a",
19
19
  "message-action": "add",
20
20
  "subj-id": "https://metrics.test.datacite.org/reports/2018-3-Dash",
21
21
  "subj": {
@@ -26,11 +26,11 @@
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
  }, {
33
- "id": "054da0ad-9821-492e-877e-5c3adbfd5ccf",
33
+ "uuid": "054da0ad-9821-492e-877e-5c3adbfd5ccf",
34
34
  "message-action": "add",
35
35
  "subj-id": "https://metrics.test.datacite.org/reports/2018-3-Dash",
36
36
  "subj": {
@@ -41,11 +41,11 @@
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
  }, {
48
- "id": "6d6fd620-2123-42da-91f3-6c02e63f3cec",
48
+ "uuid": "6d6fd620-2123-42da-91f3-6c02e63f3cec",
49
49
  "message-action": "add",
50
50
  "subj-id": "https://metrics.test.datacite.org/reports/2018-3-Dash",
51
51
  "subj": {
@@ -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