cfme.infrastructure.host module¶
A model of an Infrastructure Host in CFME.
-
class
cfme.infrastructure.host.Add(obj, navigate_obj)[source]¶ Bases:
cfme.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:
cfme.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:
cfme.utils.appliance.implementations.ui.CFMENavigateStep-
VIEW¶ alias of
HostDetailsView
-
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.Discover(obj, navigate_obj)[source]¶ Bases:
cfme.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:
cfme.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(parent, name, provider=None, hostname=None, ip_address=None, custom_ident=None, host_platform=None, ipmi_address=None, mac_address=None, credentials=NOTHING, ipmi_credentials=None, interface_type='lan')[source]¶ Bases:
cfme.modeling.base.BaseEntity,cfme.utils.update.Updateable,cfme.utils.pretty.Pretty,cfme.common.PolicyProfileAssignable,cfme.common.TaggableModel 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.
- Combines three types of credentials - 'default', 'remote_login', (credentials) – ‘web_services’, all three can be passed.
Each contains (
Credential): see Credential inner class. - ipmi_credentials (
Credential) – see Credential inner class.
Usage:
myhost = Host(name='vmware', credentials={ 'default': Provider.Credential(principal='admin', secret='foobar')}) myhost.create()
-
class
Credential(**kwargs)[source]¶ Bases:
cfme.base.credential.Credential,cfme.utils.update.UpdateableProvider credentials
Parameters: **kwargs – If using IPMI type credential, ipmi = True
-
Host.__ge__(other)¶ Automatically created by attrs.
-
Host.__gt__(other)¶ Automatically created by attrs.
-
Host.__le__(other)¶ Automatically created by attrs.
-
Host.__lt__(other)¶ Automatically created by attrs.
-
Host.__ne__(other)¶ Check equality and either forward a NotImplemented or return the result negated.
-
Host.__repr__()¶ Automatically created by attrs.
-
Host.compliance_status¶ Returns the title of the compliance SummaryTable. The title contains datetime so it can be compared.
Returns: NoneTypeif no title is present (no compliance checks before), otherwise str
-
Host.db_id= None¶
-
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
-
classmethod
Host.get_credentials_from_config(credentials_config)[source]¶ Retrieves the credentials from the credentials yaml.
Parameters: credentials_config – a dict with host credentials in the credentials yaml. Returns: A dict with credential types and cfme.base.credential.Credentialinstances
-
Host.get_datastores()[source]¶ Gets list of all datastores used by this host.
Returns:
listof datastores names
-
Host.get_db_id¶
-
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(wait_for_task_result=False)[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:
Trueif credentials are saved and valid;Falseotherwise
-
Host.wait_candu_data_available(timeout=900)[source]¶ Waits until C&U data are available for this Host
Parameters: timeout – Timeout passed to utils.wait.wait_for()
-
class
cfme.infrastructure.host.HostCollection(parent, filters=NOTHING)[source]¶ Bases:
cfme.modeling.base.BaseCollectionCollection object for the
cfme.infrastructure.host.Host.-
__ge__(other)¶ Automatically created by attrs.
-
__gt__(other)¶ Automatically created by attrs.
-
__le__(other)¶ Automatically created by attrs.
-
__lt__(other)¶ Automatically created by attrs.
-
__ne__(other)¶ Check equality and either forward a NotImplemented or return the result negated.
-
__repr__()¶ Automatically created by attrs.
-
create(name, provider=None, credentials=None, hostname=None, ip_address=None, host_platform=None, custom_ident=None, ipmi_address=None, mac_address=None, ipmi_credentials=None, cancel=False, validate_credentials=False, interface_type='lan')[source]¶ Creates a host in the UI.
Parameters:
-
create_from_config(host_key)[source]¶ Creates a Host object given a yaml entry in cfme_data.
Usage:
create_from_config('esx')
Returns: A Host object that has methods that operate on CFME
-
-
class
cfme.infrastructure.host.Provision(obj, navigate_obj)[source]¶ Bases:
cfme.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:
cfme.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.
-
-
class
cfme.infrastructure.host.Utilization(obj, navigate_obj)[source]¶ Bases:
cfme.utils.appliance.implementations.ui.CFMENavigateStep-
VIEW¶ alias of
HostInfraUtilizationView
-
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.
-