The ironic.objects.chassis Module

class ironic.objects.chassis.Chassis(context=None, **kwargs)[source]

Bases: ironic.objects.base.IronicObject, oslo_versionedobjects.base.VersionedObjectDictCompat

create(context=None)[source]

Create a Chassis record in the DB.

Column-wise updates will be made based on the result of self.what_changed(). If target_power_state is provided, it will be checked against the in-database copy of the chassis before updates are made.

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.: Chassis(context)
destroy(context=None)[source]

Delete the Chassis from the DB.

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.: Chassis(context)
classmethod get(context, chassis_id)[source]

Find a chassis based on its id or uuid and return a Chassis object.

Parameters:chassis_id – the id or uuid of a chassis.
Returns:a Chassis object.
classmethod get_by_id(context, chassis_id)[source]

Find a chassis based on its integer id and return a Chassis object.

Parameters:chassis_id – the id of a chassis.
Returns:a Chassis object.
classmethod get_by_uuid(context, uuid)[source]

Find a chassis based on uuid and return a Chassis object.

Parameters:
  • uuid – the uuid of a chassis.
  • context – Security context
Returns:

a Chassis object.

classmethod list(context, limit=None, marker=None, sort_key=None, sort_dir=None)[source]

Return a list of Chassis objects.

Parameters:
  • context – Security context.
  • limit – maximum number of resources to return in a single result.
  • marker – pagination marker for large data sets.
  • sort_key – column to sort results by.
  • sort_dir – direction to sort. “asc” or “desc”.
Returns:

a list of Chassis object.

refresh(context=None)[source]

Loads and applies updates for this Chassis.

Loads a Chassis with 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.: Chassis(context)
save(context=None)[source]

Save updates to this Chassis.

Updates will be made column by column based on the result of self.what_changed().

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.: Chassis(context)

Project Source

This Page