File: cap_del.py

package info (click to toggle)
zvmcloudconnector 1.4.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 6,092 kB
  • sloc: ansic: 45,973; python: 29,045; sh: 2,732; makefile: 790
file content (31 lines) | stat: -rw-r--r-- 1,147 bytes parent folder | download | duplicates (2)
1
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
# Copyright 2017 IBM Corp.

from zvmconnector import connector
import os

print("Setup client: client=connector.ZVMConnector('9.60.18.170', 8080)\n")
client=connector.ZVMConnector('9.60.18.170', 8080)

print("Test: send_request('vswitch_get_list')")
list = client.send_request('vswitch_get_list')
print("Result: %s\n" % list)

GUEST_USERID = 'LINUX173'

print("Capture guest: send_request('guest_capture', '%s', 'test_capture')" % GUEST_USERID)
info = client.send_request('guest_capture', GUEST_USERID, 'test_capture', capture_type='rootonly', compress_level=6)
print('Result: %s\n' % info)

print("Check generated image: send_request('image_query', imagename='test_capture')")
info = client.send_request('image_query', imagename='test_capture')
print('Result: %s\n' % info)

print("Check generated image: send_request('guest_delete', '%s') % GUEST_USERID")
info = client.send_request('guest_delete', GUEST_USERID)
print('Result: %s\n' % info)

print("Check generated image: send_request('image_query', '%s') % GUEST_USERID")
info = client.send_request('guest_get_definition_info', GUEST_USERID)
print('Result: %s\n' % info)

print('Completed\n')