ironic.objects.conductor module¶
- class ironic.objects.conductor.Conductor(context=None, **kwargs)[source]¶
Bases:
IronicObject,VersionedObjectDictCompat- VERSION = '1.6'¶
Object version field
Each service has its set of objects, each with a version attached. When a client attempts to call an object method, the server checks to see if the version of that object matches (in a compatible way) its object implementation. If so, cool, and if not, fail.
This version is allowed to have three parts,
X.Y.Z, where the.Zelement is reserved for stable branch backports. The.Zis ignored for the purposes of triggering a backport, which means anything changed under a.Zmust be additive and non-destructive such that a node that knows aboutX.Ycan considerX.Y.Zequivalent.
- property conductor_group¶
- property created_at¶
- dbapi = <oslo_db.api.DBAPI object>¶
- classmethod delete(context, hostname)[source]¶
Delete a conductor from the database.
- Parameters:
cls – the
Conductorcontext – Security context
hostname – the hostname of the conductor to delete
- Raises:
ConductorNotFound if the conductor doesn’t exist
- property drivers¶
- fields = {'conductor_group': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'drivers': List(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'hostname': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'online': Boolean(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}¶
The fields present in this object as
key:fieldpairs.For example:
fields = { 'foo': obj_fields.IntegerField(), 'bar': obj_fields.StringField(), }
- classmethod get_active_hardware_type_dict(context, use_groups=False)[source]¶
Provides a hardware type list as it relates to the conductors.
This method provides a pass-through call mechanism on an attached object for insight into the state of hardware managers by conductors and does so as a direct call for compatibility with lightweight API method.
- classmethod get_by_hostname(context, hostname, online=True)[source]¶
Get a Conductor record by its hostname.
- classmethod get_shard_list(context)[source]¶
Provides a shard list as it relates to conductors.
This method provides a pass-through all mechanism on an attached object for insight into the list of represented shards in a deployment which is sourced in the database combined with runtime configurations. The primary prupose of this being be lightweight and enable indirection_api call usage instead of trying to directly invoke the database.
- property hostname¶
- property id¶
- classmethod list(context, limit=None, marker=None, sort_key=None, sort_dir=None)[source]¶
Return a list of Conductor objects.
- classmethod list_hardware_type_interfaces_dict(context, names)[source]¶
Provides a list of hardware type interface names from conductors.
This method provides a pass-through call mechanism on an object as opposed to direct API call functionality.
- property online¶
- refresh(context=None)[source]¶
Loads and applies updates for this Conductor.
Loads a
Conductorwith the same uuid from the database and checks for updated attributes. Updates are applied from the loaded chassis column by column, if there are any updates.- Parameters:
context – Security context. NOTE: This should only be used internally by the indirection_api. Unfortunately, RPC requires context as the first argument, even though we don’t use it. A context should be set when instantiating the object, e.g.: Conductor(context)
- classmethod register(context, hostname, drivers, conductor_group, update_existing=False)[source]¶
Register an active conductor with the cluster.
- Parameters:
cls – the
Conductorcontext – Security context
hostname – the hostname on which the conductor will run
drivers – the list of drivers enabled in the conductor
conductor_group – conductor group to join, used for node:conductor affinity.
update_existing – When false, registration will raise an exception when a conflicting online record is found. When true, will overwrite the existing record. Default: False.
- Raises:
ConductorAlreadyRegistered
- Returns:
a
Conductorobject.
- register_hardware_interfaces(interfaces)[source]¶
Register hardware interfaces with the conductor.
- Parameters:
interfaces – List of interface to register, each entry should be a dictionary containing “hardware_type”, “interface_type”, “interface_name” and “default”, e.g. {‘hardware_type’: ‘hardware-type’, ‘interface_type’: ‘deploy’, ‘interface_name’: ‘direct’, ‘default’: True}
- touch(context=None, online=True)[source]¶
Touch this conductor’s DB record, marking it as up-to-date.
- unregister_all_hardware_interfaces()[source]¶
Unregister all hardware interfaces for this conductor.
- property updated_at¶