Contents:
Api Controller
The API controller for the virt_web application.
Controls and views various domain information
Return a list of domains
If filter_name is specified it will only return names that match it.
Parameters: |
|
---|
Return a list of nodes
If filter_name is specified it will only return names that match it.
Parameters: |
|
---|
Return a list of nodes with basic pool info on each node
returns a dict containing a list of all nodes that match as well as number of pools, how much total space is used, and how much of that space is free
Parameters: |
|
---|
Return a list of pools
Returns a list of pools
Parameters: |
|
---|
Return a list of volumes
Returns a list of volumes
Parameters: |
|
---|
Using Virt Web Util
WebHelpers used in virt_web.
Convert a number of bytes to a more human readable version.
The conversion will take the number of bytes and find a number of KB, MB, or GB to the nearest tenth that still has at least one non-zero number in the ones place. It appends KB, MB, or GB to the end of the number depending on what units were used.
Parameter: | bytes – Number of bytes to convert to a more human readable form. |
---|---|
Returns: | String with a more human readbale form of the number of bytes. |
Creates a dict of getObjects return from amqp
This will return a dict of objects as returned by getObjects().
Parameter: | response_list – A list of objects returned from getObjects |
---|---|
Returns: | Returns a dict of the objects |
Creates a json representation of getObjects return from amqp
This will return a list of objects as returned by getObjects(). in a json friendly format
Parameter: | response_list – A list of objects returned from getObjects |
---|---|
Returns: | Returns a list of the objects |
Convert a string into a number of bytes.
Parameter: | amount – string representing anumber of bytes. It can be all digits or have a suffix of B, K, KB, M, MB, G or GB. K and KB mean kilobytes (1024 bytes), M and MB mean megabytes (1024*1024 bytes), and G and GB mean gigabytes(1024*1024*1024 bytes). B or no suffix means bytes. Note that fractions of a byte are rounded down. |
---|---|
Raises ValueError: | |
if the string is not in a recognized format | |
Returns: | The number of bytes that the string represented |
The application’s Globals object
Container for objects available throughout the life of the application.
One instance of Globals is created during application initialization and is available during requests via the ‘tg.app_globals’ variable.
Validator to turn a human readable byte string into a number of bytes
kwarg minimum: Number of bytes must be more than this amount kwarg maximum: Number of bytes must be less than this amount kwarg negative: if True the number of bytes may be negative. The default is False which disallows negative values
Messages
Node Controller
The Domain controller for the virt_web application.
Controls and views various domain information
Return node, pool, volume and domain information about a host
This method returns all information known about a specific node using hostname as the identifier.
Parameter: | hostname – the fqdn of a node’s hostname |
---|
The following cause problems
Volume Controller
The Domain controller for the virt_web application.
Controls and views various domain information
Delete a volume name:
This method will delete a volume from the pool
Parameter: | volume_id – The getObjectId id of the volume to delete. |
---|
Dump the xml contents of a volume
This will prompt the user to make edits to the raw xml configuration for a given domain
Parameter: | uuid – uuid of the domain to dump |
---|
Get a list of valid volumes
This method returns a list of nodes, volumes, and pools.
Display form for creating a new volume
This method will prompt for a new volume on a given hostname and pool.
Parameters: |
|
---|
Create a new volume
This method will create a new volume on a specified node and volume
Parameters: |
|
---|
Create a new volume
This method will create a new volume on a specified node and volume
Parameters: |
|
---|
Domain Controller
The Domain controller for the virt_web application.
Controls and views various domain information
Prompt user to create a new domain
This method will attempt to create (start) a new domain.
Parameter: | domain_id – The uuid of the domain you want to start. |
---|---|
Returns: | The domain name, result text and result status |
Create all domains on a node_hostname
This will create all domains on a given node_hostname
Parameter: | node_hostname – The hostname to create all domains on |
---|
Destroy a domain
This method will destroy a domain given domain id
Parameter: | domain_uuid – Domain uuid as given by string representation of the domain |
---|
Destroy all domains on a node_hostname
This will destroy all domains on a given node_hostname
Parameter: | node_hostname – The hostname to destroy all domains on |
---|
Put the xml file in a text area and prompt user for updates
This will prompt the user to make edits to the raw xml configuration for a given domain
Parameter: | uuid – uuid of the domain to edit |
---|
Create a new domain
Takes all the information in required to create a new hostname.
Parameters: |
|
---|
Return a list of domains and nodes
If filter_name is specified it will only return names that match it.
Parameter: | filter_name – Filter by this name |
---|
Prompt user for a new domain
For a given node hostname prompt user to create a new domain.
Parameter: | hostname – Hostname of the node to add a new volume to |
---|
Create a new domain
Takes all the information in required to create a new hostname.
Parameters: |
|
---|
Create a new domain
Takes all the information in required to create a new hostname.
Parameters: |
|
---|
Resume a domain
This method will resume a suspended domain and resume it’s function
Parameter: | domain_uuid – Domain uuid as given by a string representation of the domain |
---|
resume all domains on a node_hostname
This will resume all domains on a given node_hostname
Parameter: | node_hostname – The hostname to pause all domains on |
---|
Shutdown a domain
This method will attempt to gracefully shutdown a domain
Parameter: | domain_uuid – Domain uuid as given by a string representation of the domain |
---|
Shutdown all domains on a node_hostname
This will shutdown all domains on a given node_hostname
Parameter: | node_hostname – The hostname to pause all domains on |
---|
Suspend or pause a domain
This method will suspend a domain and stop it’s function until it is resumed
Parameter: | domain_uuid – domain_uuid as given by a string representation of the domain |
---|
Suspend all domains on a node_hostname
This will suspend all domains on a given node_hostname
Parameter: | node_hostname – The hostname to pause all domains on |
---|
Undefine or delete a domain
This method will undefine or delete a domain.
Parameter: | domain_id – Domain uuid as given by a string representation of the domain |
---|
Pool Controller
The Domain controller for the virt_web application.
Controls and views various domain information
Create (starts) a running pool
Given pool id, this will start a libvirt storage pool
Parameter: | pool_uuid – UUID of the pool being enabled |
---|
Destroy (disables) a running pool
Given pool id, this will disable a libvirt storage pool
Parameter: | pool_uuid – UUID of the pool being disabled |
---|
Put the xml file in a text area and prompt user for updates
This will prompt the user to make edits to the raw xml configuration for a given domain
Parameter: | uuid – uuid of the domain to edit |
---|
Edit a pool
Takes all the information in required to create a new hostname.
Parameters: |
|
---|
Return a list of all pools and nodes
Parameter: | filter_name – Filters the pools by hostname |
---|
Prompt user to create a new pool
This will display a form to users and get information back to then create a pool.
Parameter: | hostname – The hostname to create a new pool on |
---|---|
Returns: | node |
Creates (enables) an already defined pool.
Given pool id, this will enable a libvirt storage pool
Parameters: |
|
---|
Creates (enables) an already defined pool.
Given pool id, this will enable a libvirt storage pool
Parameters: |
|
---|
Undefine a destroyed pool
Once a pool has been stopped, this will undefine it.
Parameter: | pool_uuid – UUID of the pool to be removed |
---|