ironic.objects.portgroup module

ironic.objects.portgroup module

class ironic.objects.portgroup.Portgroup(context=None, **kwargs)[source]

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

VERSION = '1.4'
address
create(context=None)[source]

Create a Portgroup record in 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.: Portgroup(context)
Raises:DuplicateName, MACAlreadyExists, PortgroupAlreadyExists
created_at
dbapi = <oslo_db.api.DBAPI object>
destroy(context=None)[source]

Delete the Portgroup 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.: Portgroup(context)
Raises:PortgroupNotEmpty, PortgroupNotFound
extra
fields = {'address': MACAddress(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'extra': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'internal_info': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'mode': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'name': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'node_id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'properties': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'standalone_ports_supported': Boolean(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}
classmethod get(context, portgroup_ident)[source]

Find a portgroup based on its id, uuid, name or address.

Parameters:
  • portgroup_ident – The id, uuid, name or address of a portgroup.
  • context – Security context
Returns:

A Portgroup object.

Raises:

InvalidIdentity

classmethod get_by_address(context, address)[source]

Find portgroup by address and return a Portgroup object.

Parameters:
  • cls – the Portgroup
  • context – Security context
  • address – The MAC address of a portgroup.
Returns:

A Portgroup object.

Raises:

PortgroupNotFound

classmethod get_by_id(context, portgroup_id)[source]

Find a portgroup by its integer ID and return a Portgroup object.

Parameters:
  • cls – the Portgroup
  • context – Security context
  • portgroup_id – The ID of a portgroup.
Returns:

A Portgroup object.

Raises:

PortgroupNotFound

classmethod get_by_name(context, name)[source]

Find portgroup based on name and return a Portgroup object.

Parameters:
  • cls – the Portgroup
  • context – Security context
  • name – The name of a portgroup.
Returns:

A Portgroup object.

Raises:

PortgroupNotFound

classmethod get_by_uuid(context, uuid)[source]

Find a portgroup by UUID and return a Portgroup object.

Parameters:
  • cls – the Portgroup
  • context – Security context
  • uuid – The UUID of a portgroup.
Returns:

A Portgroup object.

Raises:

PortgroupNotFound

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

Return a list of Portgroup objects.

Parameters:
  • cls – the Portgroup
  • 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 Portgroup object.

Raises:

InvalidParameterValue

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

Return a list of Portgroup objects associated with a given node ID.

Parameters:
  • cls – the Portgroup
  • context – Security context.
  • node_id – The ID of the node.
  • 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 Portgroup object.

Raises:

InvalidParameterValue

mode
name
node_id
properties
refresh(context=None)[source]

Loads updates for this Portgroup.

Loads a portgroup with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded portgroup 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.: Portgroup(context)
Raises:PortgroupNotFound
save(context=None)[source]

Save updates to this Portgroup.

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.: Portgroup(context)
Raises:PortgroupNotFound, DuplicateName, MACAlreadyExists
standalone_ports_supported
updated_at
uuid
class ironic.objects.portgroup.PortgroupCRUDNotification(context=None, **kwargs)[source]

Bases: ironic.objects.notification.NotificationBase

Notification when ironic creates, updates or deletes a portgroup.

VERSION = '1.0'
created_at
event_type
fields = {'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'event_type': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'level': NotificationLevel(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False,valid_values=('debug', 'info', 'warning', 'error', 'critical')), 'payload': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'publisher': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}
level
payload
publisher
updated_at
class ironic.objects.portgroup.PortgroupCRUDPayload(portgroup, node_uuid)[source]

Bases: ironic.objects.notification.NotificationPayloadBase

SCHEMA = {'address': ('portgroup', 'address'), 'created_at': ('portgroup', 'created_at'), 'extra': ('portgroup', 'extra'), 'mode': ('portgroup', 'mode'), 'name': ('portgroup', 'name'), 'properties': ('portgroup', 'properties'), 'standalone_ports_supported': ('portgroup', 'standalone_ports_supported'), 'updated_at': ('portgroup', 'updated_at'), 'uuid': ('portgroup', 'uuid')}
VERSION = '1.0'
address
created_at
extra
fields = {'address': MACAddress(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'extra': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'mode': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'name': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'node_uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'properties': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'standalone_ports_supported': Boolean(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}
mode
name
node_uuid
properties
standalone_ports_supported
updated_at
uuid
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.