ticket_abstractor_client 1.16.0 → 1.17.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 +36 -12
- data/lib/ticket_abstractor_client.rb +5 -0
- data/lib/ticket_abstractor_client/service_now_client.rb +17 -0
- data/lib/ticket_abstractor_client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27dcb094bd7915d40383cb6f8e407a4c2a80d1d6
|
4
|
+
data.tar.gz: 5d3e69070f303bdad352e74291e302fff5398a73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b76e4c2d9b200457243453f53e84ff794824a3febceac046b48724c5a3d9e03a10e39b6c54b468a0fcff38ecf03470d703c2f5d29e63c387a589576c904c7ec2
|
7
|
+
data.tar.gz: 820bd50852b649cc03cccf3510ae96ff0c2e44ead5598221608bd155abdbbdaed94073bf7c2399a71b44d6c82c2c6cdfe01ae77af3069bd09ea9bfc252103e34
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ And then execute:
|
|
15
15
|
Or install it yourself as:
|
16
16
|
|
17
17
|
$ gem install ticket_abstractor_client
|
18
|
-
|
18
|
+
|
19
19
|
## API
|
20
20
|
|
21
21
|
[API Documentation](http://rubydoc.info/gems/ticket_abstractor_client/frames)
|
@@ -45,6 +45,8 @@ Access clients:
|
|
45
45
|
client.brouha
|
46
46
|
client.itrc
|
47
47
|
client.ilogger
|
48
|
+
client.sev_one
|
49
|
+
client.service_now
|
48
50
|
|
49
51
|
### Jira
|
50
52
|
|
@@ -61,13 +63,13 @@ Grab issue:
|
|
61
63
|
|
62
64
|
client.jira.get_issue 'IFS-123'
|
63
65
|
client.jira.get_issue_status 'IFS-123'
|
64
|
-
|
66
|
+
|
65
67
|
Get issues by filter:
|
66
68
|
|
67
69
|
jira_filter_id = 2145
|
68
70
|
client.jira.get_issues_by_filter jira_filter_id #=> [{ issue_1 }, { issue_2 }, ...]
|
69
71
|
client.jira.get_issues_by_filter jira_filter_id, page, per_page, show_total: true #=> { total: 2, issues: [...] }
|
70
|
-
|
72
|
+
|
71
73
|
Create issue (project, summary, description and issuetype fields are required):
|
72
74
|
|
73
75
|
options = { project: "IFS", summary: "Summary", description: "Desc", issuetype: "Bug"}
|
@@ -84,11 +86,11 @@ Create issue using Jira params:
|
|
84
86
|
options = { fields: { project: { key: "IFS" }, summary: "Summary", issuetype: { id: 82 } } }
|
85
87
|
attachment = File.new('file.png', 'rb')
|
86
88
|
client.jira.raw_create_issue options, attachment
|
87
|
-
|
89
|
+
|
88
90
|
Update issue (issuekey field is required):
|
89
91
|
|
90
92
|
client.jira.update_issue(issuekey: 'IFS-123', description: 'new description')
|
91
|
-
|
93
|
+
|
92
94
|
Attach the file to issue:
|
93
95
|
|
94
96
|
attachment = File.new('file.png', 'rb')
|
@@ -140,7 +142,7 @@ Create issue:
|
|
140
142
|
}
|
141
143
|
|
142
144
|
client.brouha.create_issue options
|
143
|
-
|
145
|
+
|
144
146
|
List products and services:
|
145
147
|
|
146
148
|
client.brouha.list_product_services
|
@@ -151,17 +153,17 @@ Find apps:
|
|
151
153
|
|
152
154
|
client.itrc.list_apps
|
153
155
|
client.itrc.find_app 'itrc'
|
154
|
-
|
156
|
+
|
155
157
|
Find app_groups:
|
156
158
|
|
157
159
|
client.itrc.list_app_groups
|
158
160
|
client.itrc.find_app_group 'app-mgmt-tools'
|
159
|
-
|
161
|
+
|
160
162
|
Find business units:
|
161
163
|
|
162
164
|
client.itrc.list_business_units
|
163
165
|
client.itrc.find_business_unit 3
|
164
|
-
|
166
|
+
|
165
167
|
Find departments:
|
166
168
|
|
167
169
|
client.itrc.list_departments
|
@@ -177,17 +179,39 @@ Grab incidents:
|
|
177
179
|
|
178
180
|
Get data from graph:
|
179
181
|
|
182
|
+
## :graph => :data_sources is required
|
183
|
+
## :timespan => :start_time and :end_time is required
|
180
184
|
params = {
|
181
185
|
graph: {
|
182
186
|
data_sources: [
|
183
187
|
{ device_name: "ccprtr-br-a1-p", object_name: "ae1", indicator: "ifHCOutOctets" },
|
184
188
|
{ device_name: "ccprtr-br-a2-p", object_name: "ae1", indicator: "ifHCOutOctets" }
|
185
189
|
]
|
186
|
-
}
|
187
|
-
timespan: { simple_timespan: "past 5 minutes" }
|
190
|
+
}
|
188
191
|
}
|
189
|
-
client.sev_one.report_get_data_from_graph params
|
190
192
|
|
193
|
+
## query which fetch data for period(time in UNIX timestamp)
|
194
|
+
client.sev_one.report_get_data_from_graph(params.merge(timespan: { start_time: 1423242600.0, end_time: 1423242900.0 }))
|
195
|
+
|
196
|
+
## query which fetch data for last 5 minutes
|
197
|
+
client.sev_one.report_get_data_from_graph(params.merge(timespan: { simple_timespan: "past 5 minutes" }))
|
198
|
+
|
199
|
+
### Service Now
|
200
|
+
|
201
|
+
Get all incidents:
|
202
|
+
client.service_now.get_all_incidents(limit: '1000', offset: '0', table_name: 'incident')
|
203
|
+
|
204
|
+
Get incident:
|
205
|
+
:sys_id is a required parameter
|
206
|
+
client.service_now.get_incident(sys_id: '', table_name: 'incident')
|
207
|
+
|
208
|
+
Create incident:
|
209
|
+
:incident_params is a required parameters
|
210
|
+
client.service_now.create_incident(incident_params: {}, table_name: 'incident')
|
211
|
+
|
212
|
+
Update incident:
|
213
|
+
:incident_params and :sys_id is a required parameters
|
214
|
+
client.service_now.update_incident(incident_params: {}, sys_id: '', table_name: 'incident')
|
191
215
|
|
192
216
|
## Contributing
|
193
217
|
|
@@ -29,6 +29,10 @@ module TicketAbstractorClient
|
|
29
29
|
def sev_one
|
30
30
|
@clients[:sev_one] ||= SevOneClient.new(@url, @security_token)
|
31
31
|
end
|
32
|
+
|
33
|
+
def service_now
|
34
|
+
@clients[:service_now] ||= ServiceNowClient.new(@url, @security_token)
|
35
|
+
end
|
32
36
|
end
|
33
37
|
end
|
34
38
|
|
@@ -42,3 +46,4 @@ require 'ticket_abstractor_client/brouha_client'
|
|
42
46
|
require 'ticket_abstractor_client/itrc_client'
|
43
47
|
require 'ticket_abstractor_client/i_logger_client'
|
44
48
|
require 'ticket_abstractor_client/sev_one_client'
|
49
|
+
require 'ticket_abstractor_client/service_now_client'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class TicketAbstractorClient::ServiceNowClient < TicketAbstractorClient::Client
|
2
|
+
def get_all_incidents(params = {})
|
3
|
+
get 'service_now/get_all_incidents', params
|
4
|
+
end
|
5
|
+
|
6
|
+
def get_incident(params)
|
7
|
+
get 'service_now/get_incident', params
|
8
|
+
end
|
9
|
+
|
10
|
+
def create_incident(params)
|
11
|
+
post 'service_now/create_incident', params
|
12
|
+
end
|
13
|
+
|
14
|
+
def update_incident(params)
|
15
|
+
post 'service_now/update_incident', params
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ticket_abstractor_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rsamoilov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- lib/ticket_abstractor_client/i_logger_client.rb
|
67
67
|
- lib/ticket_abstractor_client/itrc_client.rb
|
68
68
|
- lib/ticket_abstractor_client/jira_client.rb
|
69
|
+
- lib/ticket_abstractor_client/service_now_client.rb
|
69
70
|
- lib/ticket_abstractor_client/sev_one_client.rb
|
70
71
|
- lib/ticket_abstractor_client/version.rb
|
71
72
|
homepage: http://github.com/rsamoilov/ticket_abstractor_client
|