""" Usage examples of the XCLIClient. """ from pyxcli.client import XCLIClient # Connect SSL to an XIV-Storage. xcli_client = XCLIClient.connect_ssl('username', 'password', "mgmt_ip") # extracting Volume list from XIV-Storage # as list - getting all the volumes as a list element volumes = xcli_client.cmd.vol_list().as_list for vol in volumes: print (vol.name) # Getting all of the pools pools = xcli_client.cmd.pool_list().as_list for pool in pools: print (pool.name) # Create volume - return value is an XML object indicating if the # command succeeded. vol_result = xcli_client.cmd.vol_create(pool="pool_name", size=301, vol="vol_name") # Add volume to performance class (return value is an XML object) perf_class_result = xcli_client.cmd.perf_class_add_vol(perf_class="perf_class", vol="vol_name")
""" Usage examples of the XCLIClient. """ from pyxcli.client import XCLIClient # Connect SSL to an XIV-Storage. xcli_client = XCLIClient.connect_ssl('username', 'password', "mgmt_ip") # extracting Volume list from XIV-Storage # as list - getting all the volumes as a list element volumes = xcli_client.cmd.vol_list().as_list for vol in volumes: print(vol.name) # Getting all of the pools pools = xcli_client.cmd.pool_list().as_list for pool in pools: print(pool.name) # Create volume - return value is an XML object indicating if the # command succeeded. vol_result = xcli_client.cmd.vol_create(pool="pool_name", size=301, vol="vol_name") # Add volume to performance class (return value is an XML object) perf_class_result = xcli_client.cmd.perf_class_add_vol(perf_class="perf_class", vol="vol_name")
#!/usr/bin/env python3 # -*- coding: utf-8 -* from pyxcli.client import XCLIClient import json, sys # Variable Arguments ibm_user = sys.argv[1] ibm_pass = sys.argv[2] ibm_host_ip = sys.argv[3] # Connect SSL to XIV - Storage xcli_client = XCLIClient.connect_ssl(ibm_user, ibm_pass, ibm_host_ip) result_dict = {} # CMD command and create data lists for parsing ups = xcli_client.cmd.ups_list().as_list result_dict['ups'] = ups ats = xcli_client.cmd.ats_list().as_list result_dict['ats'] = ats cna = xcli_client.cmd.cna_list().as_list result_dict['cna'] = cna