cfme.common.provider module¶
-
class
cfme.common.provider.
BaseProvider
(*args, **kwargs)[source]¶ Bases:
cfme.common.WidgetasticTaggable
,cfme.utils.update.Updateable
,cfme.common.SummaryMixin
,cfme.utils.appliance.Navigatable
-
STATS_TO_MATCH
= []¶
-
create
(cancel=False, validate_credentials=True, check_existing=False, validate_inventory=False)[source]¶ Creates a provider in the UI
Parameters: - cancel (boolean) – Whether to cancel out of the creation. The cancel is done after all the information present in the Provider has been filled in the UI.
- validate_credentials (boolean) – Whether to validate credentials - if True and the credentials are invalid, an error will be raised.
- check_existing (boolean) – Check if this provider already exists, skip if it does
- validate_inventory (boolean) – Whether or not to block until the provider stats in CFME match the stats gleaned from the backend management system
Returns: True if it was created, False if it already existed
-
create_rest
(check_existing=False, validate_inventory=False)[source]¶ Creates a provider using REST
Parameters: - check_existing (boolean) – Check if this provider already exists, skip if it does
- validate_inventory (boolean) – Whether or not to block until the provider stats in CFME match the stats gleaned from the backend management system
Returns: True if it was created, False if it already existed
-
data
¶
-
db_types
= ['Providers']¶
-
default_endpoint
¶
-
delete
(cancel=True)[source]¶ Deletes a provider from CFME
Parameters: cancel – Whether to cancel the deletion, defaults to True
-
delete_if_exists
(*args, **kwargs)[source]¶ Combines
.exists
and.delete()
as a shortcut forrequest.addfinalizer
Returns: True if provider existed and delete was initiated, False otherwise
-
ems_events
= []¶
-
exists
¶ Returns
True
if a provider of the same name exists on the appliance
-
get_all_template_details
()[source]¶ Returns a dictionary mapping template ids to their name, type, and guid
-
classmethod
get_credentials
(credential_dict, cred_type=None)[source]¶ Processes a credential dictionary into a credential object.
Parameters: - credential_dict – A credential dictionary.
- cred_type – Type of credential (None, token, ssh, amqp, ...)
Returns: A
cfme.base.credential.Credential
instance.
-
classmethod
get_credentials_from_config
(credential_config_name, cred_type=None)[source]¶ Retrieves the credential by its name from the credentials yaml.
Parameters: - credential_config_name – The name of the credential in the credentials yaml.
- cred_type – Type of credential (None, token, ssh, amqp, ...)
Returns: A
cfme.base.credential.Credential
instance.
-
get_detail
(*ident)[source]¶ Gets details from the details infoblock
The function first ensures that we are on the detail page for the specific provider.
Parameters: *ident – An SummaryTable title, followed by the Key name, e.g. “Relationships”, “Images” Returns: A string representing the contents of passed field value.
-
get_provider_details
(provider_id)[source]¶ Returns the name, and type associated with the provider_id
-
get_template_details
(template_id)[source]¶ Returns the name, type, and guid associated with the template_id
-
get_template_guids
(template_dict)[source]¶ Returns a list of tuples. The inner tuples are formated so that each guid is in index 0, and its provider’s name is in index 1. Expects a dictionary mapping a provider to its templates
-
get_vm_details
(vm_id)[source]¶ Returns the name, type, vendor, host_id, and power_state associated with the vm_id.
-
id
¶ ” Return the ID associated with the specified provider name
-
is_refreshed
(*args, **kwargs)¶
-
last_refresh_date
(*args, **kwargs)¶
-
load_details
(refresh=False)[source]¶ To be compatible with the Taggable and PolicyProfileAssignable mixins.
Returns: ProviderDetails view
-
mgmt
¶
-
one_of
(*classes)[source]¶ Returns true if provider is an instance of any of the classes or sublasses there of
-
classmethod
process_credential_yaml_key
(cred_yaml_key, cred_type=None)[source]¶ Function that detects if it needs to look up credentials in the credential yaml and acts as expected.
If you pass a dictionary, it assumes it does not need to look up in the credentials yaml file. If anything else is passed, it continues with looking up the credentials in the yaml file.
Parameters: cred_yaml_key – Either a string pointing to the credentials.yaml or a dictionary which is considered as the credentials. Returns: cfme.base.credential.Credential
instance
-
refresh_provider_relationships
(*args, **kwargs)¶
-
refresh_provider_relationships_ui
= None¶
-
type
¶
-
update
(updates, cancel=False, validate_credentials=True)[source]¶ Updates a provider in the UI. Better to use utils.update.update context manager than call this directly.
Parameters: - updates (dict) – fields that are changing.
- cancel (boolean) – whether to cancel out of the update.
- validate_credentials (boolean) – whether credentials have to be validated
-
validate_stats
(ui=False)[source]¶ Validates that the detail page matches the Providers information.
This method logs into the provider using the mgmt_system interface and collects a set of statistics to be matched against the UI. The details page is then refreshed continuously until the matching of all items is complete. A error will be raised if the match is not complete within a certain defined time period.
-
version
¶
-
-
class
cfme.common.provider.
CANDUEndpoint
(**kwargs)[source]¶ Bases:
cfme.common.provider.DefaultEndpoint
-
credential_class
¶ alias of
CANDUCredential
-
name
= 'candu'¶
-
view_value_mapping
¶
-
-
class
cfme.common.provider.
CloudInfraProvider
(*args, **kwargs)[source]¶ Bases:
cfme.common.provider.BaseProvider
,cfme.common.PolicyProfileAssignable
,cfme.common.WidgetasticTaggable
-
db_types
= ['CloudManager', 'InfraManager']¶
-
detail_page_suffix
= 'provider'¶
-
edit_page_suffix
= 'provider_edit'¶
-
hostname
¶
-
ip_address
¶
-
load_all_provider_templates
()[source]¶ Loads the list of images that are available under the provider.
-
num_template
(*args, **kwargs)¶
-
num_template_ui
= None¶
-
num_vm
(*args, **kwargs)¶
-
num_vm_ui
= None¶
-
refresh_text
= 'Refresh Relationships and Power States'¶
-
template_name
= ''¶
-
vm_name
= ''¶
-
-
class
cfme.common.provider.
DefaultEndpoint
(**kwargs)[source]¶ Bases:
object
-
credential_class
¶ alias of
Credential
-
name
= 'default'¶
-
view_value_mapping
¶
-
-
class
cfme.common.provider.
DefaultEndpointForm
(parent, logger=None, **kwargs)[source]¶ Bases:
widgetastic.widget.View
-
change_password
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
confirm_password
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
hostname
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
password
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
username
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
validate
¶ This class handles instantiating and caching of the widgets on view.
It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.
It also acts as a counter, so you can then order the widgets by their “creation” stamp.
-
-
class
cfme.common.provider.
EventsEndpoint
(**kwargs)[source]¶ Bases:
cfme.common.provider.DefaultEndpoint
-
credential_class
¶ alias of
EventsCredential
-
name
= 'events'¶
-
view_value_mapping
¶
-