cfme.infrastructure.host module¶
A model of an Infrastructure Host in CFME.
-
class
cfme.infrastructure.host.
Add
(obj, navigate_obj)[source]¶ Bases:
utils.appliance.implementations.ui.CFMENavigateStep
-
VIEW
¶ alias of
HostAddView
-
prerequisite
¶ This is a helper descriptor for navigation destinations which are linked to the same class.
For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.
-
-
class
cfme.infrastructure.host.
All
(obj, navigate_obj)[source]¶ Bases:
utils.appliance.implementations.ui.CFMENavigateStep
-
VIEW
¶ alias of
HostsView
-
prerequisite
¶ This is a helper descriptor for destinations which are linked to an attribute of the object.
For instance, imagine you have an object that has an attribute(parent) which has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToAttribute as a helper, supplying only the name of the attribute which stores the object to be used in the navigation, and the destination name. This will set prerequisite to be a callable that will navigate to the prerequisite step.
-
-
class
cfme.infrastructure.host.
Details
(obj, navigate_obj)[source]¶ Bases:
utils.appliance.implementations.ui.CFMENavigateStep
-
VIEW
¶ alias of
HostDetailsView
-
prerequisite
¶ This is a helper descriptor for navigation destinations which are linked to the same class.
For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.
-
-
class
cfme.infrastructure.host.
Discover
(obj, navigate_obj)[source]¶ Bases:
utils.appliance.implementations.ui.CFMENavigateStep
-
VIEW
¶ alias of
HostDiscoverView
-
prerequisite
¶ This is a helper descriptor for navigation destinations which are linked to the same class.
For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.
-
-
class
cfme.infrastructure.host.
Edit
(obj, navigate_obj)[source]¶ Bases:
utils.appliance.implementations.ui.CFMENavigateStep
-
VIEW
¶ alias of
HostEditView
-
prerequisite
¶ This is a helper descriptor for navigation destinations which are linked to the same class.
For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.
-
-
class
cfme.infrastructure.host.
Host
(name=None, hostname=None, ip_address=None, custom_ident=None, host_platform=None, ipmi_address=None, mac_address=None, credentials=None, ipmi_credentials=None, interface_type='lan', provider=None, appliance=None)[source]¶ Bases:
utils.update.Updateable
,utils.pretty.Pretty
,utils.appliance.Navigatable
,cfme.common.PolicyProfileAssignable
Model of an infrastructure host in cfme.
Parameters: - name – Name of the host.
- hostname – Hostname of the host.
- ip_address – The IP address as a string.
- custom_ident – The custom identifiter.
- host_platform – Included but appears unused in CFME at the moment.
- ipmi_address – The IPMI address.
- mac_address – The mac address of the system.
- credentials (
Credential
) – see Credential inner class. - ipmi_credentials (
Credential
) – see Credential inner class.
Usage:
myhost = Host(name='vmware', credentials=Provider.Credential(principal='admin', secret='foobar')) myhost.create()
-
class
Credential
(**kwargs)[source]¶ Bases:
cfme.base.credential.Credential
,utils.update.Updateable
Provider credentials
Parameters: **kwargs – If using IPMI type credential, ipmi = True
-
Host.
compliance_status
¶ Returns the title of the compliance SummaryTable. The title contains datetime so it can be compared.
Returns: NoneType
if no title is present (no compliance checks before), otherwise str
-
Host.
create
(cancel=False, validate_credentials=False)[source]¶ Creates a host in the UI.
Parameters:
-
Host.
delete
(cancel=True)[source]¶ Deletes this host from CFME.
Parameters: cancel (bool) – Whether to cancel the deletion, defaults to True
-
Host.
equal_drift_results
(drift_section, section, *indexes)[source]¶ Compares drift analysis results of a row specified by it’s title text.
Parameters: Note
There have to be at least 2 drift results available for this to work.
Returns: bool
-
Host.
get_datastores
()[source]¶ Gets list of all datastores used by this host.
Returns:
list
of datastores names
-
Host.
get_db_id
¶
-
Host.
get_detail
(title, field)[source]¶ Gets details from the details summary tables.
Parameters: Returns: A string representing the entities of the SummaryTable’s value.
-
Host.
load_details
(refresh=False)[source]¶ To be compatible with the Taggable and PolicyProfileAssignable mixins.
Parameters: refresh (bool) – Whether to perform the page refresh, defaults to False
-
Host.
pretty_attrs
= ['name', 'hostname', 'ip_address', 'custom_ident']¶
-
Host.
refresh
(cancel=False)[source]¶ Perform ‘Refresh Relationships and Power States’ for the host.
Parameters: cancel (bool) – Whether the action should be cancelled, default to False
-
Host.
run_smartstate_analysis
()[source]¶ Runs smartstate analysis on this host.
Note
The host must have valid credentials already set up for this to work.
-
Host.
update
(updates, validate_credentials=False)[source]¶ Updates a host in the UI. Better to use utils.update.update context manager than call this directly.
Parameters: updates (dict) – fields that are changing.
-
Host.
update_credentials_rest
(credentials)[source]¶ Updates host’s credentials via rest api
Parameters: credentials (dict) – credentials from yaml file Returns:
True
if credentials are saved and valid;False
otherwise
-
class
cfme.infrastructure.host.
PolicyAssignment
(obj, navigate_obj)[source]¶ Bases:
utils.appliance.implementations.ui.CFMENavigateStep
-
VIEW
¶ alias of
HostManagePoliciesView
-
prerequisite
¶ This is a helper descriptor for navigation destinations which are linked to the same class.
For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.
-
-
class
cfme.infrastructure.host.
Provision
(obj, navigate_obj)[source]¶ Bases:
utils.appliance.implementations.ui.CFMENavigateStep
-
prerequisite
¶ This is a helper descriptor for navigation destinations which are linked to the same class.
For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.
-
-
class
cfme.infrastructure.host.
Timelines
(obj, navigate_obj)[source]¶ Bases:
utils.appliance.implementations.ui.CFMENavigateStep
-
VIEW
¶ alias of
HostTimelinesView
-
prerequisite
¶ This is a helper descriptor for navigation destinations which are linked to the same class.
For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.
-
-
cfme.infrastructure.host.
get_all_hosts
()[source]¶ Returns names list of all hosts.
Returns: names list of all hosts Return type: list
-
cfme.infrastructure.host.
get_from_config
(provider_config_name)[source]¶ Creates a Host object given a yaml entry in cfme_data.
Usage:
get_from_config('esx')
Returns: A Host object that has methods that operate on CFME