For details on how to use compute, see Using OpenStack Compute
The compute high-level interface is available through the compute member of a Connection object. The compute member will only be added if the service is detected.
Find a single extension
| Parameters: |
|
|---|---|
| Returns: | One Extension or None |
Retrieve a generator of extensions
| Returns: | A generator of extension instances. |
|---|---|
| Return type: | Extension |
Find a single flavor
| Parameters: |
|
|---|---|
| Returns: | One Flavor or None |
Create a new flavor from attributes
| Parameters: | attrs (dict) – Keyword arguments which will be used to create a Flavor, comprised of the properties on the Flavor class. |
|---|---|
| Returns: | The results of flavor creation |
| Return type: | Flavor |
Delete a flavor
| Parameters: | |
|---|---|
| Returns: | None |
Get a single flavor
| Parameters: | flavor – The value can be the ID of a flavor or a Flavor instance. |
|---|---|
| Returns: | One Flavor |
| Raises: | ResourceNotFound when no resource can be found. |
Return a generator of flavors
| Parameters: |
|
|---|---|
| Returns: | A generator of flavor objects |
Delete an image
| Parameters: | |
|---|---|
| Returns: | None |
Find a single image
| Parameters: |
|
|---|---|
| Returns: | One Image or None |
Get a single image
| Parameters: | image – The value can be the ID of an image or a Image instance. |
|---|---|
| Returns: | One Image |
| Raises: | ResourceNotFound when no resource can be found. |
Return a generator of images
| Parameters: |
|
|---|---|
| Returns: | A generator of image objects |
Return a dictionary of metadata for an image
| Parameters: | image – Either the ID of an image or a Image or ImageDetail instance. |
|---|---|
| Returns: | A Image with only the image’s metadata. All keys and values are Unicode text. |
| Return type: | Image |
Update metadata for an image
| Parameters: |
|
|---|---|
| Returns: | A Image with only the image’s metadata. All keys and values are Unicode text. |
| Return type: |
Delete metadata for an image
Note: This method will do a HTTP DELETE request for every key in keys.
| Parameters: |
|
|---|---|
| Return type: | None |
Create a new keypair from attributes
| Parameters: | attrs (dict) – Keyword arguments which will be used to create a Keypair, comprised of the properties on the Keypair class. |
|---|---|
| Returns: | The results of keypair creation |
| Return type: | Keypair |
Delete a keypair
| Parameters: | |
|---|---|
| Returns: | None |
Get a single keypair
| Parameters: | keypair – The value can be the ID of a keypair or a Keypair instance. |
|---|---|
| Returns: | One Keypair |
| Raises: | ResourceNotFound when no resource can be found. |
Find a single keypair
| Parameters: |
|
|---|---|
| Returns: | One Keypair or None |
Return a generator of keypairs
| Returns: | A generator of keypair objects |
|---|---|
| Return type: | Keypair |
Retrieve limits that are applied to the project’s account
| Returns: | A Limits object, including both AbsoluteLimits and RateLimits |
|---|---|
| Return type: | Limits |
Create a new server from attributes
| Parameters: | attrs (dict) – Keyword arguments which will be used to create a Server, comprised of the properties on the Server class. |
|---|---|
| Returns: | The results of server creation |
| Return type: | Server |
Delete a server
| Parameters: |
|
|---|---|
| Returns: | None |
Find a single server
| Parameters: |
|
|---|---|
| Returns: | One Server or None |
Get a single server
| Parameters: | server – The value can be the ID of a server or a Server instance. |
|---|---|
| Returns: | One Server |
| Raises: | ResourceNotFound when no resource can be found. |
Retrieve a generator of servers
| Parameters: |
|
|---|---|
| Returns: | A generator of server instances. |
Update a server
| Parameters: | server – Either the ID of a server or a Server instance. |
|---|---|
| Attrs kwargs: | The attributes to update on the server represented by server. |
| Returns: | The updated server |
| Return type: | Server |
Change the administrator password
| Parameters: | |
|---|---|
| Returns: | None |
Reboot a server
| Parameters: | |
|---|---|
| Returns: | None |
Rebuild a server
| Parameters: |
|
|---|---|
| Returns: | The rebuilt Server instance. |
Resize a server
| Parameters: | |
|---|---|
| Returns: | None |
Confirm a server resize
| Parameters: | server – Either the ID of a server or a Server instance. |
|---|---|
| Returns: | None |
Revert a server resize
| Parameters: | server – Either the ID of a server or a Server instance. |
|---|---|
| Returns: | None |
Create an image from a server
| Parameters: | |
|---|---|
| Returns: | None |
Add a security group to a server
| Parameters: |
|
|---|---|
| Returns: | None |
Add a security group to a server
| Parameters: |
|
|---|---|
| Returns: | None |
Create a new server interface from attributes
| Parameters: |
|
|---|---|
| Returns: | The results of server interface creation |
| Return type: |
Delete a server interface
| Parameters: |
|
|---|---|
| Returns: | None |
Get a single server interface
| Parameters: |
|
|---|---|
| Returns: | One ServerInterface |
| Raises: | ResourceNotFound when no resource can be found. |
Return a generator of server interfaces
| Parameters: | server – The server can be either the ID of a server or a Server. |
|---|---|
| Returns: | A generator of ServerInterface objects |
| Return type: | ServerInterface |
Return a generator of server IPs
| Parameters: |
|
|---|---|
| Returns: | A generator of ServerIP objects |
| Return type: |
Return a generator of availability zones
| Parameters: | details (bool) – Return extra details about the availability zones. This defaults to False as it generally requires extra permission. |
|---|---|
| Returns: | A generator of availability zone |
| Return type: | :class:`~openstack.compute.v2.availability_zone. |
AvailabilityZone`
Return a dictionary of metadata for a server
| Parameters: | server – Either the ID of a server or a Server or ServerDetail instance. |
|---|---|
| Returns: | A Server with only the server’s metadata. All keys and values are Unicode text. |
| Return type: | Server |
Update metadata for a server
| Parameters: |
|
|---|---|
| Returns: | A Server with only the server’s metadata. All keys and values are Unicode text. |
| Return type: |
Delete metadata for a server
Note: This method will do a HTTP DELETE request for every key in keys.
| Parameters: | |
|---|---|
| Return type: | None |
Create a new server group from attributes
| Parameters: | attrs (dict) – Keyword arguments which will be used to create a ServerGroup, comprised of the properties on the ServerGroup class. |
|---|---|
| Returns: | The results of server group creation |
| Return type: | ServerGroup |
Delete a server group
| Parameters: |
|
|---|---|
| Returns: | None |
Find a single server group
| Parameters: |
|
|---|---|
| Returns: | One ServerGroup object or None |
Get a single server group
| Parameters: | server_group – The value can be the ID of a server group or a ServerGroup instance. |
|---|---|
| Returns: | A ServerGroup object. |
| Raises: | ResourceNotFound when no resource can be found. |
Return a generator of server groups
| Parameters: | **query (kwargs) – Optional query parameters to be sent to limit the resources being returned. |
|---|---|
| Returns: | A generator of ServerGroup objects |
| Return type: | ServerGroup |
Return a generator of hypervisor
| Returns: | A generator of hypervisor |
|---|---|
| Return type: | class: ~openstack.compute.v2.hypervisor.Hypervisor |
Find a hypervisor from name or id to get the corresponding info
| Parameters: | name_or_id – The name or id of a hypervisor |
|---|---|
| Returns: | One: class:~openstack.compute.v2.hypervisor.Hypervisor object or None |
Get a single hypervisor
| Parameters: | hypervisor – The value can be the ID of a hypervisor or a Hypervisor instance. |
|---|---|
| Returns: | A Hypervisor object. |
| Raises: | ResourceNotFound when no resource can be found. |
Get a single service
| Parameters: | service – The value can be the ID of a serivce or a Service instance. |
|---|---|
| Returns: | A Service object. |
| Raises: | ResourceNotFound when no resource can be found. |
Force a service down
| Parameters: | |
|---|---|
| Returns: | None |
Disable a service
| Parameters: | |
|---|---|
| Returns: | None |
Enable a service
| Parameters: | |
|---|---|
| Returns: | None |
Return a generator of service
| Returns: | A generator of service |
|---|---|
| Return type: | class: ~openstack.compute.v2.service.Service |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.