RaaS 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/RaaSmain.rb +0 -1
- data/lib/modules/RaaSCore.rb +26 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmUyMGEzNGZiYzA1MTkzMGZmNDQzNWExMDg2ZDE1Y2U1NGU3MGQwMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjhkMzk4MDNmNmJjNWZmYjEyN2E1OTZmZDljNTA3M2VhNmZkMDYwNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjIzYjMwMzA0M2ZiOWMxMzQ4ZmJkYTkyN2QyOTg1MWJhNDhjYzZmYWE2N2Zk
|
10
|
+
MTJlYjFkNDNlODliOWZjY2I4YmY0MjJmYThlNzUzODZmMzNjODM1ODc2NGNj
|
11
|
+
YmE1YTk1MzIzZTI1YzIyNzdiMDFjYWY5OGIzNjllNTM4M2NlNTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjNmNTAyMjY1ZjJiMWEzMzU2YTJlNmY0MGI1MGY4YzMwODE4ZTA3YWE4ZWIz
|
14
|
+
ZjdiZDllYTc5ZDA5NDI1ZjY4ODVmMTZlNmNlNWYzYzMzYWVhNjczODFhNTRj
|
15
|
+
M2Q4MTJjNjEzODZjMDIzMmFmZDJjYjE1ODcyNjVhZGZhOGI0N2E=
|
data/lib/RaaSmain.rb
CHANGED
@@ -115,7 +115,6 @@ if $operation
|
|
115
115
|
when 'replications'
|
116
116
|
if $details
|
117
117
|
foundVM, vmname, rpo, replicationState, quiesceGuestEnabled, paused, currentRpoViolation, testRecoveryState, recoveryState, vmhref = raas.replications($details)
|
118
|
-
puts foundVM
|
119
118
|
puts 'Detailed information for currently active replication(s):'.green
|
120
119
|
puts "\n"
|
121
120
|
if foundVM == false
|
data/lib/modules/RaaSCore.rb
CHANGED
@@ -91,7 +91,7 @@ class RaaS
|
|
91
91
|
# This internal method issues the test failover action against the VM ID passed
|
92
92
|
# It doesn't return anything, it just executes the testfailover
|
93
93
|
|
94
|
-
def testfailover(replicaURI
|
94
|
+
def testfailover(replicaURI)
|
95
95
|
self.class.default_options[:headers] = {"Accept" => "application/*+xml;version=5.6", "Cookie" => @cookie, "Content-Type" => "application/vnd.vmware.hcs.testFailoverParams+xml"}
|
96
96
|
testFailoverParam = XmlFu.xml("TestFailoverParams" => {
|
97
97
|
"@xmlns" => "http://www.vmware.com/vr/v6.0",
|
@@ -106,7 +106,7 @@ class RaaS
|
|
106
106
|
# This internal method issues the failover action against the VM ID passed
|
107
107
|
# It doesn't return anything, it just executes the failover
|
108
108
|
|
109
|
-
def failover(replicaURI
|
109
|
+
def failover(replicaURI)
|
110
110
|
self.class.default_options[:headers] = {"Accept" => "application/*+xml;version=5.6", "Cookie" => @cookie, "Content-Type" => "application/vnd.vmware.hcs.failoverParams+xml"}
|
111
111
|
failoverParam = XmlFu.xml("FailoverParams" => {
|
112
112
|
"@xmlns" => "http://www.vmware.com/vr/v6.0",
|
@@ -120,7 +120,7 @@ class RaaS
|
|
120
120
|
# This internal method issues the test cleanup action against the VM ID passed
|
121
121
|
# It doesn't return anything, it just executes the testcleanup
|
122
122
|
|
123
|
-
def testcleanup(replicaURI
|
123
|
+
def testcleanup(replicaURI)
|
124
124
|
response = self.class.post("/api/vr/replications/#{replicaURI}/action/testCleanup")
|
125
125
|
end
|
126
126
|
|
@@ -145,6 +145,7 @@ class RaaS
|
|
145
145
|
siteName = Array.new
|
146
146
|
siteID = Array.new
|
147
147
|
i = 0
|
148
|
+
if peersarray[0] != nil
|
148
149
|
peersarray.each do |peer|
|
149
150
|
peerhref = peer['href']
|
150
151
|
peerURI[i] = peerhref[51..124]
|
@@ -154,6 +155,7 @@ class RaaS
|
|
154
155
|
siteID[i] = peerinfo['SiteUuid']
|
155
156
|
i+= 1
|
156
157
|
end
|
158
|
+
end #if != NIL
|
157
159
|
return peerURI, siteName, siteID
|
158
160
|
end
|
159
161
|
|
@@ -177,7 +179,7 @@ class RaaS
|
|
177
179
|
recoveryState = Array.new
|
178
180
|
vmhref = Array.new
|
179
181
|
i = 0
|
180
|
-
|
182
|
+
if replicationsarray[0] != nil
|
181
183
|
if target == 'ALL'
|
182
184
|
replicationsarray.each do |replica|
|
183
185
|
replicahref = replica['href']
|
@@ -216,8 +218,8 @@ class RaaS
|
|
216
218
|
end #if
|
217
219
|
end #do
|
218
220
|
end #if replications = ALL
|
219
|
-
end #
|
220
|
-
|
221
|
+
end #if != NIL
|
222
|
+
return foundVM, vmname, rpo, replicationState, quiesceGuestEnabled, paused, currentRpoViolation, testRecoveryState, recoveryState, vmhref
|
221
223
|
end
|
222
224
|
|
223
225
|
|
@@ -231,6 +233,7 @@ class RaaS
|
|
231
233
|
replicationsarray = replicationshref
|
232
234
|
testfailover = false
|
233
235
|
foundVM = false
|
236
|
+
if replicationsarray[0] != nil
|
234
237
|
replicationsarray.each do |replica|
|
235
238
|
replicahref = replica['href']
|
236
239
|
replicaURI = replicahref[58..136]
|
@@ -241,11 +244,12 @@ class RaaS
|
|
241
244
|
if replicadetails['TestRecoveryState'] == 'none'
|
242
245
|
if replicadetails['RecoveryState'] == 'notStarted'
|
243
246
|
testfailover = true
|
244
|
-
testfailover(replicaURI
|
247
|
+
testfailover(replicaURI)
|
245
248
|
end #if
|
246
249
|
end #if
|
247
250
|
end
|
248
251
|
end
|
252
|
+
end #if != NIL
|
249
253
|
return foundVM, testfailover
|
250
254
|
end
|
251
255
|
|
@@ -260,6 +264,7 @@ class RaaS
|
|
260
264
|
replicationsarray = replicationshref
|
261
265
|
failover = false
|
262
266
|
foundVM = false
|
267
|
+
if replicationsarray[0] != nil
|
263
268
|
replicationsarray.each do |replica|
|
264
269
|
replicahref = replica['href']
|
265
270
|
replicaURI = replicahref[58..136]
|
@@ -270,11 +275,12 @@ class RaaS
|
|
270
275
|
if replicadetails['TestRecoveryState'] == 'none'
|
271
276
|
if replicadetails['RecoveryState'] == 'notStarted'
|
272
277
|
failover = true
|
273
|
-
failover(replicaURI
|
278
|
+
failover(replicaURI)
|
274
279
|
end #if
|
275
280
|
end #if
|
276
281
|
end #if
|
277
282
|
end #eachdo
|
283
|
+
end #If != NIL
|
278
284
|
return foundVM, failover
|
279
285
|
end
|
280
286
|
|
@@ -289,6 +295,7 @@ class RaaS
|
|
289
295
|
replicationsarray = replicationshref
|
290
296
|
testcleanup = false
|
291
297
|
foundVM = false
|
298
|
+
if replicationsarray[0] != nil
|
292
299
|
replicationsarray.each do |replica|
|
293
300
|
replicahref = replica['href']
|
294
301
|
replicaURI = replicahref[58..136]
|
@@ -297,11 +304,12 @@ class RaaS
|
|
297
304
|
if replicadetails['name'] == target
|
298
305
|
foundVM = true
|
299
306
|
if replicadetails['TestRecoveryState'] == "complete" or replicadetails['TestRecoveryState'] == "testError"
|
300
|
-
testcleanup(replicaURI
|
307
|
+
testcleanup(replicaURI)
|
301
308
|
testcleanup = true
|
302
309
|
else end
|
303
310
|
end #if
|
304
311
|
end #each do
|
312
|
+
end #if != NIL
|
305
313
|
return foundVM, testcleanup
|
306
314
|
end
|
307
315
|
|
@@ -316,6 +324,7 @@ class RaaS
|
|
316
324
|
vmname = Array.new
|
317
325
|
testfailover = Array.new
|
318
326
|
i = 0
|
327
|
+
if replicationsarray[0] != nil
|
319
328
|
replicationsarray.each do |replica|
|
320
329
|
replicahref = replica['href']
|
321
330
|
replicaURI = replicahref[58..136]
|
@@ -325,13 +334,14 @@ class RaaS
|
|
325
334
|
if replicadetails['TestRecoveryState'] == 'none'
|
326
335
|
if replicadetails['RecoveryState'] == 'notStarted'
|
327
336
|
testfailover[i] = true
|
328
|
-
testfailover(replicaURI
|
337
|
+
testfailover(replicaURI)
|
329
338
|
else testfailover[i] = false
|
330
339
|
end
|
331
340
|
else testfailover[i] = false
|
332
341
|
end #if
|
333
342
|
i+= 1
|
334
343
|
end #each do
|
344
|
+
end #if != NIL
|
335
345
|
return vmname, testfailover
|
336
346
|
end
|
337
347
|
|
@@ -346,6 +356,7 @@ class RaaS
|
|
346
356
|
vmname = Array.new
|
347
357
|
testcleanup = Array.new
|
348
358
|
i = 0
|
359
|
+
if replicationsarray[0] != nil
|
349
360
|
replicationsarray.each do |replica|
|
350
361
|
replicahref = replica['href']
|
351
362
|
replicaURI = replicahref[58..136]
|
@@ -354,11 +365,12 @@ class RaaS
|
|
354
365
|
vmname[i] = replicadetails['name']
|
355
366
|
if replicadetails['TestRecoveryState'] == "complete" or replicadetails['TestRecoveryState'] == "testError"
|
356
367
|
testcleanup[i] = true
|
357
|
-
testcleanup(replicaURI
|
368
|
+
testcleanup(replicaURI)
|
358
369
|
else testcleanup[i] = false
|
359
370
|
end #if
|
360
371
|
i+= 1
|
361
372
|
end #each do
|
373
|
+
end #if != NIL
|
362
374
|
return vmname, testcleanup
|
363
375
|
end
|
364
376
|
|
@@ -373,6 +385,7 @@ class RaaS
|
|
373
385
|
vmname = Array.new
|
374
386
|
failover = Array.new
|
375
387
|
i = 0
|
388
|
+
if replicationsarray[0] != nil
|
376
389
|
replicationsarray.each do |replica|
|
377
390
|
replicahref = replica['href']
|
378
391
|
replicaURI = replicahref[58..136]
|
@@ -382,13 +395,14 @@ class RaaS
|
|
382
395
|
if replicadetails['TestRecoveryState'] == 'none'
|
383
396
|
if replicadetails['RecoveryState'] == 'notStarted'
|
384
397
|
failover[i] = true
|
385
|
-
failover(replicaURI
|
398
|
+
failover(replicaURI)
|
386
399
|
else failover[i] = false
|
387
400
|
end
|
388
401
|
else failover[i] = false
|
389
402
|
end #if
|
390
403
|
i+= 1
|
391
404
|
end #each do
|
405
|
+
end #if != NIL
|
392
406
|
return vmname, failover
|
393
407
|
end
|
394
408
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RaaS
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Massimo Re Ferrè
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -75,7 +75,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
75
75
|
requirements:
|
76
76
|
- - ! '>='
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
78
|
+
version: 1.9.3
|
79
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - ! '>='
|