openstack中Nova组件servers的所有python API 汇总,openstacknova
Servers
Server interface.
- class novaclient.v2.servers.Server(manager, info, loaded=False)
-
Bases: novaclient.openstack.common.apiclient.base.Resource
Populate and bind to a manager.
Parameters: - manager – BaseManager object
- info – dictionary representing resource attributes
- loaded – prevent lazy-loading if set to True
- HUMAN_ID = True
- add_fixed_ip(network_id)
-
Add an IP address on a network.
Parameters: network_id – The ID of the network the IP should be on.
- add_floating_ip(address, fixed_address=None)
-
Add floating IP to an instance
Parameters: - address – The IP address or FloatingIP to add to the instance
- fixed_address – The fixedIP address the FloatingIP is to beassociated with (optional)
- add_security_group(security_group)
-
Add a security group to an instance.
- backup(backup_name, backup_type, rotation)
-
Backup a server instance.
Parameters: - backup_name – Name of the backup image
- backup_type – The backup type, like ‘daily’ or ‘weekly’
- rotation – Int parameter representing how many backups tokeep around.
- change_password(password)
-
Update the admin password for a server.
Parameters: password – string to set as the admin password on the server
- clear_password()
-
Get password for a Server.
- confirm_resize()
-
Confirm that the resize worked, thus removing the original server.
- create_image(image_name, metadata=None)
-
Create an image based on this server.
Parameters: - image_name – The name to assign the newly create image.
- metadata – Metadata to assign to the image.
- delete()
-
Delete (i.e. shut down and delete the image) this server.
- diagnostics()
-
Diagnostics – Retrieve server diagnostics.
- evacuate(host=None, on_shared_storage=True, password=None)
-
Evacuate an instance from failed host to specified host.
Parameters: - host – Name of the target host
- on_shared_storage – Specifies whether instance files locatedon shared storage
- password – string to set as admin password on the evacuatedserver.
- force_delete()
-
Force delete – Force delete a server.
- get_console_output(length=None)
-
Get text console log output from Server.
Parameters: length – The number of lines you would like to retrieve (as int)
- get_password(private_key=None)
-
Get password for a Server.
Returns the clear password of an instance if private_key isprovided, returns the ciphered password otherwise.
Parameters: private_key – Path to private key file for decryption(optional)
- get_rdp_console(console_type)
-
Get rdp console for a Server.
Parameters: console_type – Type of console (‘rdp-html5’)
- get_serial_console(console_type)
-
Get serial console for a Server.

