novaclient - Getting the flavor of server

asked 2016-01-12 00:47:18 -0600

itsme gravatar image

I can be able to get the list of servers or instances using the following command as well as code in my devserver.

CLI code:

nova list

python code:

instances = nt.servers.list()

Now I need to get the Flavor of server, I have tried the following command in CLI , It works fine.

CLI Command:

nova show Instance-1

Now I need to get the same using python code. Someone let me know the way for the same.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2016-01-12 06:57:27 -0600

Hi,

you are looking for get(server) as docs says: http://docs.openstack.org/developer/python-novaclient/ref/v2/servers.html

 get(server)

    Get a server.
    Parameters: server – ID of the Server to get.
    Return type:    Server

Regards

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-01-12 00:47:18 -0600

Seen: 252 times

Last updated: Jan 12 '16