kaseyaws 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/kaseyaws/client.rb +211 -89
- data/lib/kaseyaws/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1c6087a49ff8e3a5e580b69e1f320d9547d392d
|
4
|
+
data.tar.gz: 4fda24e48272d4cbc45e94aa81622595db77c69a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cac5e6d1aae4dc12df2aa554519b007b899c4bee5212ba51a242ee7035a10db2165464aefef29abdb0cda0d35eafc4f78a466ade7bf6a4a9439d5645892e23f2
|
7
|
+
data.tar.gz: 98ddce15b9e69466406527755e21e0676e1bb1b9cea055aa32b3f5a14f42e568a2d59d905a045c4b9b967a2d12eba81f56b8560e1a99c2dac34392f799e3cd96
|
data/README.md
CHANGED
data/lib/kaseyaws/client.rb
CHANGED
@@ -29,7 +29,7 @@ module KaseyaWS
|
|
29
29
|
convert_request_keys_to: :camelcase,
|
30
30
|
env_namespace: :soap,
|
31
31
|
open_timeout: 30,
|
32
|
-
log:
|
32
|
+
log: true
|
33
33
|
}
|
34
34
|
@sessionid = self.authenticate(username,password)
|
35
35
|
|
@@ -37,31 +37,33 @@ module KaseyaWS
|
|
37
37
|
|
38
38
|
def add_mach_group_to_scope(group_name,scope_name)
|
39
39
|
|
40
|
-
response = self.client.call(:add_mach_group_to_scope, message
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
session_i_d
|
40
|
+
response = self.client.call(:add_mach_group_to_scope, :message => {:req =>[{
|
41
|
+
:group_name => group_name,
|
42
|
+
:scope_name => scope_name,
|
43
|
+
:browser_i_p => @client_ip,
|
44
|
+
:session_i_d => @sessionid}]}
|
45
45
|
)
|
46
46
|
response.body[:add_mach_group_to_scope_response][:add_mach_group_to_scope_result]
|
47
47
|
end
|
48
48
|
|
49
|
+
|
50
|
+
|
49
51
|
def add_org_to_scope(company_id,scope_id)
|
50
52
|
|
51
|
-
response = self.client.call(:add_org_to_scope, message
|
52
|
-
|
53
|
-
|
54
|
-
session_i_d
|
53
|
+
response = self.client.call(:add_org_to_scope, :message => {:req =>[{
|
54
|
+
:company_i_d => company_id,
|
55
|
+
:scope_i_d => scope_id,
|
56
|
+
:session_i_d => @sessionid}]}
|
55
57
|
)
|
56
58
|
response.body[:add_org_to_scope_response][:add_org_to_scope_result]
|
57
59
|
end
|
58
60
|
|
59
61
|
def add_user_to_role(username,role_id)
|
60
62
|
|
61
|
-
response = self.client.call(:add_user_to_role, message
|
62
|
-
|
63
|
-
|
64
|
-
session_i_d
|
63
|
+
response = self.client.call(:add_user_to_role, :message => {:req =>[{
|
64
|
+
:user_name => user_name,
|
65
|
+
:role_i_d => role_id,
|
66
|
+
:session_i_d => @sessionid}]}
|
65
67
|
)
|
66
68
|
response.body[:add_user_to_role_response][:add_user_to_role_result]
|
67
69
|
end
|
@@ -73,57 +75,57 @@ module KaseyaWS
|
|
73
75
|
|
74
76
|
self.client = Savon::Client.new(@savon_options)
|
75
77
|
|
76
|
-
response = self.client.call(:authenticate, message
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
hashing_algorithm
|
78
|
+
response = self.client.call(:authenticate, :message => {:req =>[{
|
79
|
+
:user_name => username,
|
80
|
+
:covered_password => covered_password,
|
81
|
+
:random_number => random_number,
|
82
|
+
:browser_i_p => @client_ip,
|
83
|
+
:hashing_algorithm => HASH_ALGORITHM}]}
|
82
84
|
)
|
83
85
|
@sessionid = response.body[:authenticate_response][:authenticate_result][:session_id]
|
84
86
|
end
|
85
87
|
|
86
88
|
def close_alarm (monitor_alarm_id, notes)
|
87
89
|
|
88
|
-
response = self.client.call(:close_alarm, message
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
session_i_d
|
90
|
+
response = self.client.call(:close_alarm, :message => {:req =>[{
|
91
|
+
:monitor_alarm_i_d => monitor_alarm_id,
|
92
|
+
:notes => notes,
|
93
|
+
:browser_i_p => @client_ip,
|
94
|
+
:session_i_d => @sessionid}]}
|
93
95
|
)
|
94
96
|
response.body[:close_alarm_response][:close_alarm_result]
|
95
97
|
end
|
96
98
|
|
97
99
|
def create_machine_group (group_name,org_name,parent_name)
|
98
100
|
|
99
|
-
response = self.client.call(:create_machine_group, message
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
session_i_d
|
101
|
+
response = self.client.call(:create_machine_group, :message => {:req =>[{
|
102
|
+
:group_name => group_name,
|
103
|
+
:org_name => org_name,
|
104
|
+
:parent_name => parent_name,
|
105
|
+
:browser_i_p => @client_ip,
|
106
|
+
:session_i_d => @sessionid}]}
|
105
107
|
)
|
106
108
|
response.body[:create_machine_group_response][:create_machine_group_result]
|
107
109
|
end
|
108
110
|
|
109
111
|
def create_role (role_name,role_type,parent_role_name)
|
110
112
|
|
111
|
-
response = self.client.call(:create_role, message
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
session_i_d
|
113
|
+
response = self.client.call(:create_role, :message => {:req =>[{
|
114
|
+
:role_name => role_name,
|
115
|
+
:role_type => role_type,
|
116
|
+
:parent_role_name => parent_role_name,
|
117
|
+
:browser_i_p => @client_ip,
|
118
|
+
:session_i_d => @sessionid}]}
|
117
119
|
)
|
118
120
|
response.body[:create_role_response][:create_role_result]
|
119
121
|
end
|
120
122
|
|
121
123
|
def delete_admin (user_name)
|
122
124
|
|
123
|
-
response = self.client.call(:delete_admin, message
|
124
|
-
|
125
|
-
|
126
|
-
session_i_d
|
125
|
+
response = self.client.call(:delete_admin, :message => {:req =>[{
|
126
|
+
:user_name => user_name,
|
127
|
+
:browser_i_p => @client_ip,
|
128
|
+
:session_i_d => @sessionid}]}
|
127
129
|
)
|
128
130
|
response.body[:delete_admin_response][:delete_admin_result]
|
129
131
|
end
|
@@ -131,110 +133,230 @@ module KaseyaWS
|
|
131
133
|
|
132
134
|
def delete_agent (agent_guid, uninstall_agent_first)
|
133
135
|
|
134
|
-
response = self.client.call(:delete_agent, message
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
session_i_d
|
136
|
+
response = self.client.call(:delete_agent, :message => {:req =>[{
|
137
|
+
:agent_guid => agent_guid,
|
138
|
+
:uninstall_agent_first => uninstall_agent_first,
|
139
|
+
:browser_i_p => @client_ip,
|
140
|
+
:session_i_d => @sessionid}]}
|
139
141
|
)
|
140
142
|
response.body[:delete_agent_response][:delete_agent_result]
|
141
143
|
end
|
142
144
|
|
143
145
|
def delete_agent_install_package (package_id)
|
144
146
|
|
145
|
-
response = self.client.call(:delete_agent_install_package, message
|
146
|
-
|
147
|
-
|
148
|
-
session_i_d
|
147
|
+
response = self.client.call(:delete_agent_install_package, :message => {:req =>[{
|
148
|
+
:package_id => package_id,
|
149
|
+
:browser_i_p => @client_ip,
|
150
|
+
:session_i_d => @sessionid}]}
|
149
151
|
)
|
150
152
|
response.body[:delete_agent_install_package_response][:delete_agent_install_package_result]
|
151
153
|
end
|
152
154
|
|
153
155
|
def delete_machine_group (group_name)
|
154
156
|
|
155
|
-
response = self.client.call(:delete_machine_group, message
|
156
|
-
|
157
|
-
|
158
|
-
session_i_d
|
157
|
+
response = self.client.call(:delete_machine_group, :message => {:req =>[{
|
158
|
+
:group_name => group_name,
|
159
|
+
:browser_i_p => @client_ip,
|
160
|
+
:session_i_d => @sessionid}]}
|
159
161
|
)
|
160
162
|
response.body[:delete_machine_group_response][:delete_machine_group_result]
|
161
163
|
end
|
162
164
|
|
163
165
|
def echo (input)
|
164
166
|
|
165
|
-
response = self.client.call(:echo, message
|
166
|
-
|
167
|
+
response = self.client.call(:echo, :message => { :input => input })
|
168
|
+
|
167
169
|
response.body[:echo_response][:echo_result]
|
168
170
|
end
|
169
171
|
|
170
172
|
def echo_mt (payload)
|
171
173
|
|
172
|
-
response = self.client.call(:echo_mt, message
|
173
|
-
|
174
|
-
session_i_d
|
174
|
+
response = self.client.call(:echo_mt, :message => {:req =>[{
|
175
|
+
:payload => payload,
|
176
|
+
:session_i_d => @sessionid}]}
|
175
177
|
)
|
176
178
|
response.body[:echo_mt_response][:echo_mt_result]
|
177
179
|
end
|
178
180
|
|
179
181
|
def get_alarm (monitor_alarm_id)
|
180
182
|
|
181
|
-
response = self.client.call(:get_alarm, message
|
182
|
-
|
183
|
-
|
184
|
-
session_i_d
|
185
|
-
)
|
186
|
-
response.body[:get_alarm_response][:get_alarm_result]
|
187
|
-
end
|
188
|
-
|
189
|
-
def get_alarm (monitor_alarm_id)
|
190
|
-
|
191
|
-
response = self.client.call(:get_alarm, message: {req:[{
|
192
|
-
monitor_alarm_i_d: monitor_alarm_id,
|
193
|
-
browser_i_p: @client_ip,
|
194
|
-
session_i_d: @sessionid}]}
|
183
|
+
response = self.client.call(:get_alarm, :message => {:req =>[{
|
184
|
+
:monitor_alarm_i_d => monitor_alarm_id,
|
185
|
+
:browser_i_p => @client_ip,
|
186
|
+
:session_i_d => @sessionid}]}
|
195
187
|
)
|
196
188
|
response.body[:get_alarm_response][:get_alarm_result]
|
197
189
|
end
|
198
190
|
|
199
191
|
def get_alarm_list (get_all_records=true)
|
200
192
|
|
201
|
-
response = self.client.call(:get_alarm_list, message
|
202
|
-
|
203
|
-
|
204
|
-
session_i_d
|
193
|
+
response = self.client.call(:get_alarm_list, :message => {:req =>[{
|
194
|
+
:return_all_records => get_all_records,
|
195
|
+
:browser_i_p => @client_ip,
|
196
|
+
:session_i_d => @sessionid}]}
|
205
197
|
)
|
206
198
|
response.body[:get_alarm_list_response][:get_alarm_list_result]
|
207
199
|
end
|
208
200
|
|
209
201
|
def get_machine(machine_group_id)
|
210
202
|
|
211
|
-
response = self.client.call(:get_machine, message
|
212
|
-
|
213
|
-
|
214
|
-
session_i_d
|
203
|
+
response = self.client.call(:get_machine, :message => {:req =>[{
|
204
|
+
:machine___group_i_d => machine_group_id,
|
205
|
+
:browser_i_p => @client_ip,
|
206
|
+
:session_i_d => @sessionid}]}
|
215
207
|
)
|
216
208
|
response.body[:get_machine_response][:get_machine_result]
|
217
209
|
end
|
218
210
|
|
219
211
|
def get_machine_group_list
|
220
212
|
|
221
|
-
response = self.client.call(:get_machine_group_list, message
|
222
|
-
|
223
|
-
session_i_d
|
213
|
+
response = self.client.call(:get_machine_group_list, :message => {:req =>[{
|
214
|
+
:browser_i_p => @client_ip,
|
215
|
+
:session_i_d => @sessionid}]}
|
224
216
|
)
|
225
217
|
response.body[:get_machine_group_list_response][:get_machine_group_list_result]
|
226
218
|
end
|
227
219
|
|
228
220
|
def get_machine_list(machine_group,machine_collection)
|
229
221
|
|
230
|
-
response = self.client.call(:get_machine_list, message
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
session_i_d
|
222
|
+
response = self.client.call(:get_machine_list, :message => {:req =>[{
|
223
|
+
:machine_group => machine_group,
|
224
|
+
:machine_collection => machine_collection,
|
225
|
+
:browser_i_p => @client_ip,
|
226
|
+
:session_i_d => @sessionid}]}
|
235
227
|
)
|
236
228
|
response.body[:get_machine_list_response][:get_machine_list_result]
|
237
229
|
end
|
238
230
|
|
231
|
+
def get_notes_list(added_since)
|
232
|
+
|
233
|
+
response = self.client.call(:get_notes_list, :message => {:req =>[{
|
234
|
+
:added_since => get_notes_list,
|
235
|
+
:browser_i_p => @client_ip,
|
236
|
+
:session_i_d => @sessionid}]}
|
237
|
+
)
|
238
|
+
response.body[:get_notes_list_response][:get_notes_list_result]
|
239
|
+
end
|
240
|
+
|
241
|
+
def get_orgs
|
242
|
+
|
243
|
+
response = self.client.call(:get_orgs, :message => {:req =>[{
|
244
|
+
:session_i_d => @sessionid}]}
|
245
|
+
)
|
246
|
+
response.body[:get_orgs_response][:get_orgs_result]
|
247
|
+
end
|
248
|
+
|
249
|
+
def get_org_types
|
250
|
+
|
251
|
+
response = self.client.call(:get_org_types, :message => {:req =>[{
|
252
|
+
:browser_i_p => @client_ip,
|
253
|
+
:session_i_d => @sessionid}]}
|
254
|
+
)
|
255
|
+
response.body[:get_org_types_response][:get_org_types_result]
|
256
|
+
end
|
257
|
+
|
258
|
+
def get_orgs_by_scope_id (scope_id)
|
259
|
+
|
260
|
+
response = self.client.call(:get_orgs_by_scope_id, :message => {:req =>[{
|
261
|
+
:scope_i_d => scope_id,
|
262
|
+
:session_i_d => @sessionid}]}
|
263
|
+
)
|
264
|
+
response.body[:get_orgs_by_scope_id_response][:get_orgs_by_scope_id_result]
|
265
|
+
end
|
266
|
+
|
267
|
+
def get_package_urls (group_name)
|
268
|
+
|
269
|
+
response = self.client.call(:get_package_urls, :message => {:req =>[{
|
270
|
+
:group_name => group_name,
|
271
|
+
:browser_i_p => @client_ip,
|
272
|
+
:session_i_d => @sessionid}]}
|
273
|
+
)
|
274
|
+
response.body[:get_package_urls_response][:get_package_urls_result]
|
275
|
+
end
|
276
|
+
|
277
|
+
def get_partner_user_location (admin_id)
|
278
|
+
|
279
|
+
response = self.client.call(:get_partner_user_location, :message => {:req =>[{
|
280
|
+
:admin_id => admin_id,
|
281
|
+
:browser_i_p => @client_ip,
|
282
|
+
:session_i_d => @sessionid}]}
|
283
|
+
)
|
284
|
+
response.body[:get_partner_user_location_response][:get_partner_user_location_result]
|
285
|
+
end
|
286
|
+
|
287
|
+
def get_published_view_columns (view_name)
|
288
|
+
|
289
|
+
response = self.client.call(:get_published_view_columns, :message => {:req =>[{
|
290
|
+
:view_name => view_name,
|
291
|
+
:browser_i_p => @client_ip,
|
292
|
+
:session_i_d => @sessionid}]}
|
293
|
+
)
|
294
|
+
response.body[:get_published_view_columns_response][:get_published_view_columns_result]
|
295
|
+
end
|
296
|
+
|
297
|
+
def get_published_views
|
298
|
+
|
299
|
+
response = self.client.call(:get_published_views, :message => {:req =>[{
|
300
|
+
:browser_i_p => @client_ip,
|
301
|
+
:session_i_d => @sessionid}]}
|
302
|
+
)
|
303
|
+
response.body[:get_published_views_response][:get_published_views_result]
|
304
|
+
end
|
305
|
+
|
306
|
+
def get_roles
|
307
|
+
|
308
|
+
response = self.client.call(:get_roles, :message => {:req =>[{
|
309
|
+
:session_i_d => @sessionid}]}
|
310
|
+
)
|
311
|
+
response.body[:get_roles_response][:get_roles_result]
|
312
|
+
end
|
313
|
+
|
314
|
+
def get_scopes
|
315
|
+
|
316
|
+
response = self.client.call(:get_scopes, :message => {:req =>[{
|
317
|
+
:session_i_d => @sessionid}]}
|
318
|
+
)
|
319
|
+
response.body[:get_scopes_response][:get_scopes_result]
|
320
|
+
end
|
321
|
+
|
322
|
+
def get_tic_request_ticket (id)
|
323
|
+
|
324
|
+
response = self.client.call(:get_tic_request_ticket, :message => {:req =>[{
|
325
|
+
:id => id,
|
326
|
+
:browser_i_p => @client_ip,
|
327
|
+
:session_i_d => @sessionid}]}
|
328
|
+
)
|
329
|
+
response.body[:get_tic_request_ticket_response][:get_tic_request_ticket_result]
|
330
|
+
end
|
331
|
+
|
332
|
+
def get_ticket (ticket_id)
|
333
|
+
|
334
|
+
response = self.client.call(:get_ticket, :message => {:req =>[{
|
335
|
+
:ticket_i_d => ticket_id,
|
336
|
+
:browser_i_p => @client_ip,
|
337
|
+
:session_i_d => @sessionid}]}
|
338
|
+
)
|
339
|
+
response.body[:get_ticket_response][:get_ticket_result]
|
340
|
+
end
|
341
|
+
|
342
|
+
def get_ticket_list (return_all_records=true)
|
343
|
+
|
344
|
+
response = self.client.call(:get_ticket_list, :message => {:req =>[{
|
345
|
+
:return_all_records => return_all_records,
|
346
|
+
:browser_i_p => @client_ip,
|
347
|
+
:session_i_d => @sessionid}]}
|
348
|
+
)
|
349
|
+
response.body[:get_ticket_list_response][:get_ticket_list_result]
|
350
|
+
end
|
351
|
+
|
352
|
+
def get_ticket_notes (ticket_id)
|
353
|
+
|
354
|
+
response = self.client.call(:get_ticket_notes, :message => {:req =>[{
|
355
|
+
:ticket_i_d => ticket_id,
|
356
|
+
:browser_i_p => @client_ip,
|
357
|
+
:session_i_d => @sessionid}]}
|
358
|
+
)
|
359
|
+
response.body[:get_ticket_notes_response][:get_ticket_notes_result]
|
360
|
+
end
|
239
361
|
end
|
240
362
|
end
|
data/lib/kaseyaws/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaseyaws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phillip Henslee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|