Exemple #1
0
            if success:
                from pprint import pprint
                pprint(result)
            else:
                print result.printTraceback()

    deferreds = []
    if len(sys.argv) < 2:
        deferreds.extend((
            client.listConfigurations(name='default.page.size'),
            client.listZones(),
            client.listPods(),
            client.listClusters(),
            client.listHosts(),
            client.listSystemVms(),
            client.listRouters(),
            client.listVirtualMachines(),
            client.listCapacity(),
            client.listAlerts(),
            client.listEvents(),
        ))
    else:
        for command in sys.argv[1:]:
            call = getattr(client, command, None)
            if call is not None:
                if command == 'listConfigurations':
                    deferreds.append(call(name='default.page.size'))
                elif command == 'listHosts':
                    deferreds.append(call(type='Routing'))
                elif command == 'listVirtualMachines':
                    deferreds.append(
                pprint(result)
            elif hasattr(result, 'value') and hasattr(result.value, 'response'):
                print result.value.response
            else:
                print result.getErrorMessage()

    deferreds = []
    if len(sys.argv) < 2:
        deferreds.extend((
            client.listConfigurations(name='default.page.size'),
            client.listZones(available='true'),
            client.listPods(),
            client.listClusters(),
            client.listHosts(),
            client.listSystemVms(),
            client.listRouters(listAll='true'),
            client.listVirtualMachines(),
            client.listCapacity(),
            client.listAlerts(),
            client.listEvents(),
            ))
    else:
        for command in sys.argv[1:]:
            call = getattr(client, command, None)
            if call is not None:
                if command == 'listConfigurations':
                    deferreds.append(call(name='default.page.size'))
                elif command == 'listHosts':
                    deferreds.append(call(type='Routing'))
                elif command == 'listRouters':
                    deferreds.append(call(listAll='true'))
            if success:
                from pprint import pprint
                pprint(result)
            else:
                print result.printTraceback()

    deferreds = []
    if len(sys.argv) < 2:
        deferreds.extend((
            client.listConfigurations(name='default.page.size'),
            client.listZones(),
            client.listPods(),
            client.listClusters(),
            client.listHosts(),
            client.listSystemVms(),
            client.listRouters(),
            client.listVirtualMachines(),
            client.listCapacity(),
            client.listAlerts(),
            client.listEvents(),
            ))
    else:
        for command in sys.argv[1:]:
            call = getattr(client, command, None)
            if call is not None:
                if command == 'listConfigurations':
                    deferreds.append(call(name='default.page.size'))
                elif command == 'listHosts':
                    deferreds.append(call(type='Routing'))
                elif command == 'listVirtualMachines':
                    deferreds.append(call(domainid='1', isrecursive=True, state='Running'))
Exemple #4
0
            elif hasattr(result, 'value') and hasattr(result.value,
                                                      'response'):
                print result.value.response
            else:
                print result.getErrorMessage()

    deferreds = []
    if len(sys.argv) < 2:
        deferreds.extend((
            client.listConfigurations(name='default.page.size'),
            client.listZones(available='true'),
            client.listPods(),
            client.listClusters(),
            client.listHosts(),
            client.listSystemVms(),
            client.listRouters(listAll='true'),
            client.listVirtualMachines(),
            client.listCapacity(),
            client.listAlerts(),
            client.listEvents(),
        ))
    else:
        for command in sys.argv[1:]:
            call = getattr(client, command, None)
            if call is not None:
                if command == 'listConfigurations':
                    deferreds.append(call(name='default.page.size'))
                elif command == 'listHosts':
                    deferreds.append(call(type='Routing'))
                elif command == 'listRouters':
                    deferreds.append(call(listAll='true'))