ticket_abstractor_client 1.23.0 → 1.24.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c1da81a66687d51774ac816ed8bd808ffa50b99
|
4
|
+
data.tar.gz: a83e15379fb54fe2f1c22039a0fc576b680f9329
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2e772acbf491c15d976d38a6a6c642c2aa7ecd7f75972d515d882fd3dc3dffaf72415402b97e7b265ec11253034dcd2a3dcceb6c81a9019f119f43b2c6d715d
|
7
|
+
data.tar.gz: 17303292863c487d436451e1773d8ca9fea02ff4f208f783f9f3c91344ea464d1c9184a36e5fdb8c2b278c23f671d0aaec75209bb713923d77762d95764cfcf5
|
@@ -1,29 +1,49 @@
|
|
1
1
|
class TicketAbstractorClient::ServiceNowClient < TicketAbstractorClient::Client
|
2
|
+
def initialize(base_url, security_token = nil, endpoint = 'default')
|
3
|
+
super base_url, security_token
|
4
|
+
@service_now_endpoint = endpoint
|
5
|
+
end
|
6
|
+
|
7
|
+
def endpoints
|
8
|
+
get 'service_now/endpoints'
|
9
|
+
end
|
10
|
+
|
2
11
|
def get_all_incidents(params = {})
|
3
|
-
|
12
|
+
get_with_endpoint 'service_now/get_all_incidents', params
|
4
13
|
end
|
5
14
|
|
6
15
|
def get_incidents_by_query(params)
|
7
|
-
|
16
|
+
get_with_endpoint 'service_now/get_incidents_by_query', params
|
8
17
|
end
|
9
18
|
|
10
19
|
def get_attachments(params)
|
11
|
-
|
20
|
+
get_with_endpoint 'service_now/get_attachments', params
|
12
21
|
end
|
13
22
|
|
14
23
|
def get_incident(params)
|
15
|
-
|
24
|
+
get_with_endpoint 'service_now/get_incident', params
|
16
25
|
end
|
17
26
|
|
18
27
|
def create_attachment(params)
|
19
|
-
|
28
|
+
post_with_endpoint 'service_now/create_attachment', params
|
20
29
|
end
|
21
30
|
|
22
31
|
def create_incident(params)
|
23
|
-
|
32
|
+
post_with_endpoint 'service_now/create_incident', params
|
24
33
|
end
|
25
34
|
|
26
35
|
def update_incident(params)
|
27
|
-
|
36
|
+
post_with_endpoint 'service_now/update_incident', params
|
28
37
|
end
|
38
|
+
|
39
|
+
protected
|
40
|
+
def get_with_endpoint(url, args={}, params={})
|
41
|
+
params.merge! service_now_endpoint: @service_now_endpoint
|
42
|
+
get url, args, params
|
43
|
+
end
|
44
|
+
|
45
|
+
def post_with_endpoint(url, args={}, params={})
|
46
|
+
params.merge! service_now_endpoint: @service_now_endpoint
|
47
|
+
post url, args, params
|
48
|
+
end
|
29
49
|
end
|
@@ -11,7 +11,8 @@ module TicketAbstractorClient
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def jira(endpoint = 'tp')
|
14
|
-
|
14
|
+
client_key = "jira_#{endpoint}".to_sym
|
15
|
+
@clients[client_key] ||= JiraClient.new(@url, @security_token, CGI.escape(endpoint.to_s))
|
15
16
|
end
|
16
17
|
|
17
18
|
def brouha
|
@@ -30,8 +31,9 @@ module TicketAbstractorClient
|
|
30
31
|
@clients[:sev_one] ||= SevOneClient.new(@url, @security_token)
|
31
32
|
end
|
32
33
|
|
33
|
-
def service_now
|
34
|
-
|
34
|
+
def service_now(endpoint = 'default')
|
35
|
+
client_key = "service_now_#{endpoint}".to_sym
|
36
|
+
@clients[client_key] ||= ServiceNowClient.new(@url, @security_token, CGI.escape(endpoint))
|
35
37
|
end
|
36
38
|
end
|
37
39
|
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.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rsamoilov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|