xcal-parktronic 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/xcal/parktronic/routes/events.rb +18 -0
- data/lib/xcal/parktronic/version.rb +1 -1
- data/spec/lib/xcal/parktronic/routes/events_route_spec.rb +9 -0
- data/spec/support/api_mock.rb +4 -0
- data/spec/support/fixtures/responses/event_status_update.json +3 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d420daedd5a7fe7d9a637412cb721d5caed39840
|
4
|
+
data.tar.gz: 3275a06cd027c399ce4c3c1b2e9942bf85dbaf53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee2602fc17f9c90d65aa364bff5903608590405f69786e60b0a52aed5a3328b16b4514a3b07ad2a8c3d7a69c098d7eb4efc99dbfc4339e83a06bbdb48f29a151
|
7
|
+
data.tar.gz: 879c94f91e4a317d3e5cc6db5bcb52980057ceaca1bee52f6b635bd45b6559fefd79e74bea393c11aa04545ff5cffb5cc78005c3613b85fadadf2700ae62538c
|
data/README.md
CHANGED
@@ -76,6 +76,9 @@ api.search_events(search: {subject: 'test event', incident_ticket_id: '23'})
|
|
76
76
|
api.search_events(scopes: {tagged_with: 'test event tag', general_filter: 'ticketed'})
|
77
77
|
api.search_events(where: {event_status: 'Critical', incident_ticket_id: 'IFS-23'})
|
78
78
|
api.search_events(extends: ['alarm_impact_level'])
|
79
|
+
|
80
|
+
api.status_update_events(incident_sor: 'brouha', incident_id: 1, incident_status: 'Resolved')
|
81
|
+
api.status_update_events(incident_sor: 'tp', incident_id: ['ifs-1', 'ifs-2'], incident_status: 'In Progress')
|
79
82
|
```
|
80
83
|
|
81
84
|
### Events history
|
@@ -90,6 +90,24 @@ module Xcal
|
|
90
90
|
generic_response = Xcal::Parktronic::GenericResponse.new(response.body)
|
91
91
|
response.code == '200' && generic_response.has_key?(:events) ? generic_response.events.map(&:event) : generic_response
|
92
92
|
end
|
93
|
+
|
94
|
+
# Bulk update events with incident status for specified ticket SOR and incident ticket id
|
95
|
+
#
|
96
|
+
# ==== Parameters
|
97
|
+
# * +incident_sor+ incident ticket SOR
|
98
|
+
# * +incident_id+ incident ticket id(s)
|
99
|
+
# * +incident_status+ incident status
|
100
|
+
#
|
101
|
+
# ==== Examples
|
102
|
+
# api.status_update_events(incident_sor: 'brouha', incident_id: 1, incident_status: 'Resolved')
|
103
|
+
# api.status_update_events(incident_sor: 'tp', incident_id: ['ifs-1', 'ifs-2'], incident_status: 'In Progress')
|
104
|
+
def status_update_events(args = {})
|
105
|
+
request = Net::HTTP::Post.new("/#{api_version}/events/bulk_status_update", 'Content-Type' => 'application/json')
|
106
|
+
request.body = args.merge(access_token: access_token).to_json
|
107
|
+
|
108
|
+
response = http.start { |net| net.request(request) }
|
109
|
+
Xcal::Parktronic::GenericResponse.new(response.body)
|
110
|
+
end
|
93
111
|
end
|
94
112
|
|
95
113
|
end
|
@@ -35,6 +35,15 @@ describe Xcal::Parktronic::ApiClient do
|
|
35
35
|
expect(events).to be_a Array
|
36
36
|
end
|
37
37
|
end
|
38
|
+
|
39
|
+
describe '#status_update_events' do
|
40
|
+
let(:status_update_params) { {incident_sor: 'tp', incident_id: ['IFS-1', 'IFS-2'], incident_status: 'Resolved'} }
|
41
|
+
it 'responds to status_update_events' do
|
42
|
+
events_message = nil
|
43
|
+
expect { events_message = api_http_client.status_update_events(status_update_params) }.not_to raise_error
|
44
|
+
expect(events_message.message).to match(/10 events updated/)
|
45
|
+
end
|
46
|
+
end
|
38
47
|
end
|
39
48
|
|
40
49
|
end
|
data/spec/support/api_mock.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcal-parktronic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitaliy Omelchenko
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: hashie
|
@@ -183,6 +183,7 @@ files:
|
|
183
183
|
- spec/support/fixtures/responses/command_notification.json
|
184
184
|
- spec/support/fixtures/responses/command_notifications.json
|
185
185
|
- spec/support/fixtures/responses/event.json
|
186
|
+
- spec/support/fixtures/responses/event_status_update.json
|
186
187
|
- spec/support/fixtures/responses/event_tags.json
|
187
188
|
- spec/support/fixtures/responses/events_history_page_1.json
|
188
189
|
- spec/support/fixtures/responses/events_history_page_2.json
|
@@ -253,6 +254,7 @@ test_files:
|
|
253
254
|
- spec/support/fixtures/responses/command_notification.json
|
254
255
|
- spec/support/fixtures/responses/command_notifications.json
|
255
256
|
- spec/support/fixtures/responses/event.json
|
257
|
+
- spec/support/fixtures/responses/event_status_update.json
|
256
258
|
- spec/support/fixtures/responses/event_tags.json
|
257
259
|
- spec/support/fixtures/responses/events_history_page_1.json
|
258
260
|
- spec/support/fixtures/responses/events_history_page_2.json
|