nexpose 0.0.98 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +17 -7
- data/Rakefile +17 -22
- data/lib/README.md +5 -0
- data/lib/nexpose.rb +104 -130
- data/lib/nexpose/api_request.rb +133 -144
- data/lib/nexpose/common.rb +138 -0
- data/lib/nexpose/connection.rb +117 -106
- data/lib/nexpose/creds.rb +292 -279
- data/lib/nexpose/error.rb +21 -21
- data/lib/nexpose/manage.rb +83 -0
- data/lib/nexpose/misc.rb +85 -122
- data/lib/nexpose/report.rb +783 -603
- data/lib/nexpose/role.rb +27 -0
- data/lib/nexpose/scan.rb +264 -285
- data/lib/nexpose/scan_engine.rb +344 -350
- data/lib/nexpose/silo.rb +348 -347
- data/lib/nexpose/site.rb +826 -898
- data/lib/nexpose/ticket.rb +108 -108
- data/lib/nexpose/user.rb +223 -221
- data/lib/nexpose/util.rb +36 -36
- data/lib/nexpose/vuln.rb +510 -520
- metadata +37 -23
- data/README +0 -0
- data/nexpose.gemspec +0 -20
data/lib/nexpose/silo.rb
CHANGED
@@ -1,347 +1,348 @@
|
|
1
|
-
module Nexpose
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
end
|
1
|
+
module Nexpose
|
2
|
+
module NexposeAPI
|
3
|
+
include XMLUtils
|
4
|
+
|
5
|
+
###################
|
6
|
+
# SILO MANAGEMENT #
|
7
|
+
###################
|
8
|
+
|
9
|
+
#########################
|
10
|
+
# MULTI-TENANT USER OPS #
|
11
|
+
#########################
|
12
|
+
|
13
|
+
#-------------------------------------------------------------------------
|
14
|
+
# Creates a multi-tenant user
|
15
|
+
#
|
16
|
+
# user_config - A map of the user data.
|
17
|
+
#
|
18
|
+
# REQUIRED PARAMS
|
19
|
+
# user-id, authsrcid, user-name, full-name, enabled, superuser
|
20
|
+
#
|
21
|
+
# OPTIONAL PARAMS
|
22
|
+
# email, password
|
23
|
+
#
|
24
|
+
# silo_configs - An array of maps of silo specific data
|
25
|
+
#
|
26
|
+
# REQUIRED PARAMS
|
27
|
+
# silo-id, role-name, all-groups, all-sites, default-silo
|
28
|
+
#
|
29
|
+
# allowed_groups/allowed_sites - An array of ids
|
30
|
+
#-------------------------------------------------------------------------
|
31
|
+
def create_multi_tenant_user(user_config, silo_configs)
|
32
|
+
xml = make_xml('MultiTenantUserCreateRequest')
|
33
|
+
mtu_config_xml = make_xml('MultiTenantUserConfig', user_config, '', false)
|
34
|
+
|
35
|
+
# Add the silo access
|
36
|
+
silo_xml = make_xml('SiloAccesses', {}, '', false)
|
37
|
+
silo_configs.each do |silo_config|
|
38
|
+
silo_config_xml = make_xml('SiloAccess', {}, '', false)
|
39
|
+
silo_config.keys.each do |k|
|
40
|
+
if k == 'allowed_sites'
|
41
|
+
allowed_sites_xml = make_xml('AllowedSites', {}, '', false)
|
42
|
+
silo_config['allowed_sites'].each do |allowed_site|
|
43
|
+
allowed_sites_xml.add_element(make_xml('AllowedSite', {'id' => allowed_site}, '', false))
|
44
|
+
end
|
45
|
+
silo_config_xml.add_element(allowed_sites_xml)
|
46
|
+
elsif k == 'allowed_groups'
|
47
|
+
allowed_groups_xml = make_xml('AllowedGroups', {}, '', false)
|
48
|
+
silo_config['allowed_groups'].each do |allowed_group|
|
49
|
+
allowed_groups_xml.add_element(make_xml('AllowedGroup', {'id' => allowed_group}, '', false))
|
50
|
+
end
|
51
|
+
silo_config_xml.add_element(allowed_groups_xml)
|
52
|
+
else
|
53
|
+
silo_config_xml.attributes[k] = silo_config[k]
|
54
|
+
end
|
55
|
+
end
|
56
|
+
silo_xml.add_element(silo_config_xml)
|
57
|
+
end
|
58
|
+
mtu_config_xml.add_element(silo_xml)
|
59
|
+
xml.add_element(mtu_config_xml)
|
60
|
+
r = execute(xml, '1.2')
|
61
|
+
r.success
|
62
|
+
end
|
63
|
+
|
64
|
+
#-------------------------------------------------------------------------
|
65
|
+
# Lists all the multi-tenant users and their attributes.
|
66
|
+
#-------------------------------------------------------------------------
|
67
|
+
def list_mtu
|
68
|
+
xml = make_xml('MultiTenantUserListingRequest')
|
69
|
+
r = execute xml, '1.2'
|
70
|
+
|
71
|
+
if r.success
|
72
|
+
res = []
|
73
|
+
r.res.elements.each("//MultiTenantUserSummary") do |mtu|
|
74
|
+
res << {
|
75
|
+
:id => mtu.attributes['id'],
|
76
|
+
:full_name => mtu.attributes['full-name'],
|
77
|
+
:user_name => mtu.attributes['user-name'],
|
78
|
+
:email => mtu.attributes['email'],
|
79
|
+
:super_user => mtu.attributes['superuser'],
|
80
|
+
:enabled => mtu.attributes['enabled'],
|
81
|
+
:auth_module => mtu.attributes['auth-module'],
|
82
|
+
:silo_count => mtu.attributes['silo-count'],
|
83
|
+
:locked => mtu.attributes['locked']
|
84
|
+
}
|
85
|
+
end
|
86
|
+
res
|
87
|
+
else
|
88
|
+
false
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
#-------------------------------------------------------------------------
|
93
|
+
# Delete a multi-tenant user
|
94
|
+
#-------------------------------------------------------------------------
|
95
|
+
def delete_mtu user_name, user_id
|
96
|
+
using_user_name = (user_name and not user_name.empty?)
|
97
|
+
xml = make_xml('MultiTenantUserDeleteRequest', (using_user_name ? {'user-name' => user_name} : {'user-id' => user_id}))
|
98
|
+
r = execute xml, '1.2'
|
99
|
+
r.success
|
100
|
+
end
|
101
|
+
|
102
|
+
####################
|
103
|
+
# SILO PROFILE OPS #
|
104
|
+
####################
|
105
|
+
|
106
|
+
#-------------------------------------------------------------------------
|
107
|
+
# Creates a silo profile
|
108
|
+
#
|
109
|
+
# silo_config - A map of the silo data.
|
110
|
+
#
|
111
|
+
# REQUIRED PARAMS
|
112
|
+
# id, name, all‐licensed-modules, all‐global-engines, all-global-report-templates, all‐global-scan‐templates
|
113
|
+
#
|
114
|
+
# OPTIONAL PARAMS
|
115
|
+
# description
|
116
|
+
#
|
117
|
+
# permissions - A map of an array of maps of silo specific data
|
118
|
+
#
|
119
|
+
# REQUIRED PARAMS
|
120
|
+
# silo-id, role-name, all-groups, all-sites, default-silo
|
121
|
+
#
|
122
|
+
# allowed_groups/allowed_sites - An array of ids
|
123
|
+
#-------------------------------------------------------------------------
|
124
|
+
def create_silo_profile silo_profile_config, permissions
|
125
|
+
xml = make_xml 'SiloProfileCreateRequest'
|
126
|
+
spc_xml = make_xml('SiloProfileConfig', silo_profile_config, '', false)
|
127
|
+
|
128
|
+
# Add the permissions
|
129
|
+
if permissions['global_report_templates']
|
130
|
+
grt_xml = make_xml('GlobalReportTemplates', {}, '', false)
|
131
|
+
permissions['global_report_templates'].each do |name|
|
132
|
+
grt_xml.add_element make_xml('GlobalReportTemplate', {'name' => name}, '', false)
|
133
|
+
end
|
134
|
+
spc_xml.add_element grt_xml
|
135
|
+
end
|
136
|
+
|
137
|
+
if permissions['global_scan_engines']
|
138
|
+
gse_xml = make_xml('GlobalScanEngines', {}, '', false)
|
139
|
+
permissions['global_scan_engines'].each do |name|
|
140
|
+
gse_xml.add_element make_xml('GlobalScanEngine', {'name' => name}, '', false)
|
141
|
+
end
|
142
|
+
spc_xml.add_element gse_xml
|
143
|
+
end
|
144
|
+
|
145
|
+
if permissions['global_scan_templates']
|
146
|
+
gst_xml = make_xml('GlobalScanTemplates', {}, '', false)
|
147
|
+
permissions['global_scan_templates'].each do |name|
|
148
|
+
gst_xml.add_element make_xml('GlobalScanTemplate', {'name' => name}, '', false)
|
149
|
+
end
|
150
|
+
spc_xml.add_element gst_xml
|
151
|
+
end
|
152
|
+
|
153
|
+
if permissions['licensed_modules']
|
154
|
+
lm_xml = make_xml('LicensedModules', {}, '', false)
|
155
|
+
permissions['licensed_modules'].each do |name|
|
156
|
+
lm_xml.add_element make_xml('LicensedModule', {'name' => name}, '', false)
|
157
|
+
end
|
158
|
+
spc_xml.add_element lm_xml
|
159
|
+
end
|
160
|
+
|
161
|
+
if permissions['restricted_report_formats']
|
162
|
+
rrf_xml = make_xml('RestrictedReportFormats', {}, '', false)
|
163
|
+
permissions['restricted_report_formats'].each do |name|
|
164
|
+
rrf_xml.add_element make_xml('RestrictedReportFormat', {'name' => name}, '', false)
|
165
|
+
end
|
166
|
+
spc_xml.add_element rrf_xml
|
167
|
+
end
|
168
|
+
|
169
|
+
if permissions['restricted_report_sections']
|
170
|
+
rrs_xml = make_xml('RestrictedReportSections', {}, '', false)
|
171
|
+
permissions['restricted_report_sections'].each do |name|
|
172
|
+
rrs_xml.add_element make_xml('RestrictedReportSection', {'name' => name}, '', false)
|
173
|
+
end
|
174
|
+
spc_xml.add_element rrs_xml
|
175
|
+
end
|
176
|
+
|
177
|
+
xml.add_element spc_xml
|
178
|
+
r = execute xml, '1.2'
|
179
|
+
r.success
|
180
|
+
end
|
181
|
+
|
182
|
+
#-------------------------------------------------------------------------
|
183
|
+
# Lists all the silo profiles and their attributes.
|
184
|
+
#-------------------------------------------------------------------------
|
185
|
+
def list_silo_profiles
|
186
|
+
xml = make_xml('SiloProfileListingRequest')
|
187
|
+
r = execute xml, '1.2'
|
188
|
+
|
189
|
+
if r.success
|
190
|
+
res = []
|
191
|
+
r.res.elements.each("//SiloProfileSummary") do |silo_profile|
|
192
|
+
res << {
|
193
|
+
:id => silo_profile.attributes['id'],
|
194
|
+
:name => silo_profile.attributes['name'],
|
195
|
+
:description => silo_profile.attributes['description'],
|
196
|
+
:global_report_template_count => silo_profile.attributes['global-report-template-count'],
|
197
|
+
:global_scan_engine_count => silo_profile.attributes['global-scan-engine-count'],
|
198
|
+
:global_scan_template_count => silo_profile.attributes['global-scan-template-count'],
|
199
|
+
:licensed_module_count => silo_profile.attributes['licensed-module-count'],
|
200
|
+
:restricted_report_section_count => silo_profile.attributes['restricted-report-section-count'],
|
201
|
+
:all_licensed_modules => silo_profile.attributes['all-licensed-modules'],
|
202
|
+
:all_global_engines => silo_profile.attributes['all-global-engines'],
|
203
|
+
:all_global_report_templates => silo_profile.attributes['all-global-report-templates'],
|
204
|
+
:all_global_scan_templates => silo_profile.attributes['all-global-scan-templates']
|
205
|
+
}
|
206
|
+
end
|
207
|
+
res
|
208
|
+
else
|
209
|
+
false
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
#-------------------------------------------------------------------------
|
214
|
+
# Delete a silo profile
|
215
|
+
#-------------------------------------------------------------------------
|
216
|
+
def delete_silo_profile name, id
|
217
|
+
using_name = (name and not name.empty?)
|
218
|
+
xml = make_xml('SiloProfileDeleteRequest', (using_name ? {'name' => name} : {'silo-profile-id' => id}))
|
219
|
+
r = execute xml, '1.2'
|
220
|
+
r.success
|
221
|
+
end
|
222
|
+
|
223
|
+
####################
|
224
|
+
# SILO OPS #
|
225
|
+
####################
|
226
|
+
|
227
|
+
#-------------------------------------------------------------------------
|
228
|
+
# Creates a silo
|
229
|
+
#
|
230
|
+
# silo_config - A map of the silo creation data.
|
231
|
+
#
|
232
|
+
# REQUIRED PARAMS
|
233
|
+
# id, name, silo-profile-id, max-assets, max-hosted-assets, max-users
|
234
|
+
#
|
235
|
+
# OPTIONAL PARAMS
|
236
|
+
# description
|
237
|
+
#-------------------------------------------------------------------------
|
238
|
+
def create_silo silo_config
|
239
|
+
xml = make_xml 'SiloCreateRequest'
|
240
|
+
silo_config_xml = make_xml 'SiloConfig', {}, '', false
|
241
|
+
|
242
|
+
# Add the attributes
|
243
|
+
silo_config.keys.each do |key|
|
244
|
+
if not 'merchant'.eql? key and not 'organization'.eql? key
|
245
|
+
silo_config_xml.attributes[key] = silo_config[key]
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
# Add Organization info
|
250
|
+
if silo_config['organization']
|
251
|
+
org_xml = make_xml 'Organization', {}, '', false
|
252
|
+
silo_config['organization'].keys.each do |key|
|
253
|
+
if not 'address'.eql? key
|
254
|
+
org_xml.attributes[key] = silo_config['organization'][key]
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
address_xml = make_xml 'Address', silo_config['organization']['address'], '', false
|
259
|
+
org_xml.add_element address_xml
|
260
|
+
silo_config_xml.add_element org_xml
|
261
|
+
end
|
262
|
+
|
263
|
+
# Add Merchant info
|
264
|
+
if silo_config['merchant']
|
265
|
+
merchant_xml = make_xml 'Merchant', {}, '', false
|
266
|
+
|
267
|
+
silo_config['merchant'].keys.each do |key|
|
268
|
+
if not 'dba'.eql? key and not 'other_industries'.eql? key and not 'qsa'.eql? key and not 'address'.eql? key
|
269
|
+
merchant_xml.attributes[key] = silo_config['merchant'][key]
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
# Add the merchant address
|
274
|
+
merchant_address_xml = make_xml 'Address', silo_config['merchant']['address'], '', false
|
275
|
+
merchant_xml.add_element merchant_address_xml
|
276
|
+
|
277
|
+
#Now add the complex data types
|
278
|
+
if silo_config['merchant']['dba']
|
279
|
+
dba_xml = make_xml 'DBAs', {}, '', false
|
280
|
+
silo_config['merchant']['dba'].each do |name|
|
281
|
+
dba_xml.add_element make_xml('DBA', {'name' => name}, '', false)
|
282
|
+
end
|
283
|
+
merchant_xml.add_element dba_xml
|
284
|
+
end
|
285
|
+
|
286
|
+
if silo_config['merchant']['other_industries']
|
287
|
+
ois_xml = make_xml 'OtherIndustries', {}, '', false
|
288
|
+
silo_config['merchant']['other_industries'].each do |name|
|
289
|
+
ois_xml.add_element make_xml('Industry', {'name' => name}, '', false)
|
290
|
+
end
|
291
|
+
merchant_xml.add_element ois_xml
|
292
|
+
end
|
293
|
+
|
294
|
+
if silo_config['merchant']['qsa']
|
295
|
+
qsa_xml = make_xml 'QSA', {}, '', false
|
296
|
+
silo_config['merchant']['qsa'].keys.each do |key|
|
297
|
+
if not 'address'.eql? key
|
298
|
+
qsa_xml.attributes[key] = silo_config['merchant']['qsa'][key]
|
299
|
+
end
|
300
|
+
end
|
301
|
+
|
302
|
+
# Add the address for this QSA
|
303
|
+
address_xml = make_xml 'Address', silo_config['merchant']['qsa']['address'], '', false
|
304
|
+
|
305
|
+
qsa_xml.add_element address_xml
|
306
|
+
merchant_xml.add_element qsa_xml
|
307
|
+
end
|
308
|
+
silo_config_xml.add_element merchant_xml
|
309
|
+
end
|
310
|
+
|
311
|
+
xml.add_element silo_config_xml
|
312
|
+
r = execute xml, '1.2'
|
313
|
+
r.success
|
314
|
+
end
|
315
|
+
|
316
|
+
#-------------------------------------------------------------------------
|
317
|
+
# Lists all the silos and their attributes.
|
318
|
+
#-------------------------------------------------------------------------
|
319
|
+
def list_silos
|
320
|
+
xml = make_xml('SiloListingRequest')
|
321
|
+
r = execute xml, '1.2'
|
322
|
+
|
323
|
+
if r.success
|
324
|
+
res = []
|
325
|
+
r.res.elements.each("//SiloSummary") do |silo_profile|
|
326
|
+
res << {
|
327
|
+
:id => silo_profile.attributes['id'],
|
328
|
+
:name => silo_profile.attributes['name'],
|
329
|
+
:description => silo_profile.attributes['description']
|
330
|
+
}
|
331
|
+
end
|
332
|
+
res
|
333
|
+
else
|
334
|
+
false
|
335
|
+
end
|
336
|
+
end
|
337
|
+
|
338
|
+
#-------------------------------------------------------------------------
|
339
|
+
# Delete a silo
|
340
|
+
#-------------------------------------------------------------------------
|
341
|
+
def delete_silo name, id
|
342
|
+
using_name = (name and not name.empty?)
|
343
|
+
xml = make_xml('SiloDeleteRequest', (using_name ? {'silo-name' => name} : {'silo-id' => id}))
|
344
|
+
r = execute xml, '1.2'
|
345
|
+
r.success
|
346
|
+
end
|
347
|
+
end
|
348
|
+
end
|