def edit(argv): """ [edit] vfabric <vfabric-id> online [edit] vfabric <vfabric-id> [<general-attrs>] protocol [EN <en-attrs>] | [FC <fc-attrs>] general-attrs: [running_mode <OFFLINE | ONLINE>] [desc <"DETAILS">] [ha_state < NORMAL | FAILOVER>] [auto_failover < DISABLED | ENABLED>] [auto_failback < DISABLED | ENABLED>] [primary_gw_id <primary_gw_id>] [backup_gw_id <backup_gw_id>] [protocol <protocol>] [component_mask <component_mask>] en-attrs: [mac <mac-addr>] [vlan <vlan-value>] fc-attrs: [wwpn <world-wide-port-name>] [wwnn <world-wide-node-name>] """ output = lib.output.CLIoutput("vfabric") valid_list = ['primary_gw_id', 'backup_gw_id', 'running_mode', 'desc', 'ha_state', 'component_mask','type','mac', 'auto_failover' , 'auto_failback', 'protocol','vlan' ,'wwnn','wwpn',] if (len(argv) < 2 ): output.completeOutputError(lib.errorhandler.InvalidArgumentCount(3, "vfabric-id", syntax=edit.__doc__,descape = "Please specify the vfabric id")) return output if ( argv[1] == '?' or argv[1] == 'help'): output.completeOutputError(lib.errorhandler.InvalidArgumentCount(syntax=edit.__doc__, descape = "Help")) return output if argv[2].lower() == 'online': if isEditName(output, argv[1]) == -1: print "Error Not a valid Id" return output else: dict = {} dict['id'] = int(argv[1]) try: result = vfm.py_vfm_vfabric_online(dict) except StandardError, e: print "Error!" ,e return output else: print result return output
def reg1(): vfabric = vfm.py_vfm_vfabric_create(vfabric_ip) print "Vfabric created:", vfabric vadapter = vfm.py_vfm_vadapter_create(vadapter_ip) print "vadpter created:", vadapter result = vfm.py_vfm_vfabric_edit_general_attr({'id': vfabric['id'], 'primary_gateway':1}) print "vfabric edited:", result result = vfm.py_vfm_vadapter_edit_general_attr({'id':vadapter['id'], 'vfabric_id':vfabric['id'], 'io_module_id' : 1}) print "vdapter edited:", result try : result = vfm.py_vfm_vfabric_online({'id':vfabric['id']}) except StandardError, e: print "ERROR ! " ,e
def reg1(): vfabric = vfm.py_vfm_vfabric_create(vfabric_ip) print "Vfabric created:", vfabric vadapter = vfm.py_vfm_vadapter_create(vadapter_ip) print "vadpter created:", vadapter result = vfm.py_vfm_vfabric_edit_general_attr({ 'id': vfabric['id'], 'primary_gateway': 1 }) print "vfabric edited:", result result = vfm.py_vfm_vadapter_edit_general_attr({ 'id': vadapter['id'], 'vfabric_id': vfabric['id'], 'io_module_id': 1 }) print "vdapter edited:", result try: result = vfm.py_vfm_vfabric_online({'id': vfabric['id']}) except StandardError, e: print "ERROR ! ", e
def vfabric_online(): result = vfm.py_vfm_vfabric_online({'id': vfabric_id})
def edit(argv): """ [edit] vfabric <vfabric-id> online [edit] vfabric <vfabric-id> [<general-attrs>] protocol [EN <en-attrs>] | [FC <fc-attrs>] general-attrs: [running_mode <OFFLINE | ONLINE>] [desc <"DETAILS">] [ha_state < NORMAL | FAILOVER>] [auto_failover < DISABLED | ENABLED>] [auto_failback < DISABLED | ENABLED>] [primary_gw_id <primary_gw_id>] [backup_gw_id <backup_gw_id>] [protocol <protocol>] [component_mask <component_mask>] en-attrs: [mac <mac-addr>] [vlan <vlan-value>] fc-attrs: [wwpn <world-wide-port-name>] [wwnn <world-wide-node-name>] """ output = lib.output.CLIoutput("vfabric") valid_list = [ 'primary_gw_id', 'backup_gw_id', 'running_mode', 'desc', 'ha_state', 'component_mask', 'type', 'mac', 'auto_failover', 'auto_failback', 'protocol', 'vlan', 'wwnn', 'wwpn', ] if (len(argv) < 2): output.completeOutputError( lib.errorhandler.InvalidArgumentCount( 3, "vfabric-id", syntax=edit.__doc__, descape="Please specify the vfabric id")) return output if (argv[1] == '?' or argv[1] == 'help'): output.completeOutputError( lib.errorhandler.InvalidArgumentCount(syntax=edit.__doc__, descape="Help")) return output if argv[2].lower() == 'online': if isEditName(output, argv[1]) == -1: print "Error Not a valid Id" return output else: dict = {} dict['id'] = int(argv[1]) try: result = vfm.py_vfm_vfabric_online(dict) except StandardError, e: print "Error!", e return output else: print result return output
def vfabric_online(): result = vfm.py_vfm_vfabric_online({'id' : vfabric_id})