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 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.
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=None, 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.WidgetasticTaggable
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
,cfme.utils.update.Updateable
Provider credentials
Parameters: **kwargs – If using IPMI type credential, ipmi = True
-
Host.
__eq__
(other)¶ Automatically created by attrs.
-
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)¶ Automatically created by attrs.
-
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: NoneType
if no title is present (no compliance checks before), otherwise str
-
Host.
credentials
= Attribute(name='credentials', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}))¶
-
Host.
custom_ident
= Attribute(name='custom_ident', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}))¶
-
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
-
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.
host_platform
= Attribute(name='host_platform', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}))¶
-
Host.
hostname
= Attribute(name='hostname', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}))¶
-
Host.
interface_type
= Attribute(name='interface_type', default='lan', validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}))¶
-
Host.
ip_address
= Attribute(name='ip_address', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}))¶
-
Host.
ipmi_address
= Attribute(name='ipmi_address', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}))¶
-
Host.
ipmi_credentials
= Attribute(name='ipmi_credentials', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}))¶
-
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.
mac_address
= Attribute(name='mac_address', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}))¶
-
Host.
name
= Attribute(name='name', default=NOTHING, validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}))¶
-
Host.
pretty_attrs
= ['name', 'hostname', 'ip_address', 'custom_ident']¶
-
Host.
provider
= Attribute(name='provider', default=None, validator=None, repr=True, cmp=True, hash=None, init=True, convert=None, metadata=mappingproxy({}))¶
-
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:
True
if credentials are saved and valid;False
otherwise
-
class
cfme.infrastructure.host.
HostCollection
(parent, filters=NOTHING)[source]¶ Bases:
cfme.modeling.base.BaseCollection
Collection object for the
cfme.infrastructure.host.Host
.-
__eq__
(other)¶ Automatically created by attrs.
-
__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)¶ Automatically created by attrs.
-
__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.
-