Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
>>> nt = nclient.Client('admin', 'secrete', 'demo',KEYSTONE_URL,service_type='compute')
>>> instances = nt.servers.list()
>>> for instance in instances:
...    print instance.id, instance.status
... 
44e362ba-e8a4-4bae-b0ea-5477666632c9 ACTIVE


>>> dir(instances[0])         
['HUMAN_ID', 'NAME_ATTR', 'OS-DCF:diskConfig', 'OS-EXT-AZ:availability_zone', 'OS-EXT-SRV-ATTR:host', 'OS-EXT-SRV-ATTR:hypervisor_hostname', 'OS-EXT-SRV-ATTR:instance_name', 'OS-EXT-STS:power_state', 'OS-EXT-STS:task_state', 'OS-EXT-STS:vm_state', '__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattr__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_add_details', '_info', '_loaded', 'accessIPv4', 'accessIPv6', 'add_fixed_ip', 'add_floating_ip', 'add_security_group', 'addresses', 'backup', 'change_password', 'clear_password', 'config_drive', 'confirm_resize', 'create_image', 'created', 'delete', 'diagnostics', 'evacuate', 'flavor', 'get', 'get_console_output', 'get_password', 'get_spice_console', 'get_vnc_console', 'hostId', 'human_id', 'id', 'image', 'interface_attach', 'interface_detach', 'interface_list', 'is_loaded', 'key_name', 'links', 'live_migrate', 'lock', 'manager', 'metadata', 'migrate', 'name', 'networks', 'pause', 'progress', 'reboot', 'rebuild', 'remove_fixed_ip', 'remove_floating_ip', 'remove_security_group', 'rescue', 'reset_network', 'reset_state', 'resize', 'resume', 'revert_resize', 'security_groups', 'set_loaded', 'start', 'status', 'stop', 'suspend', 'tenant_id', 'unlock', 'unpause', 'unrescue', 'update', 'updated', 'user_id']