ironic.objects.portgroup module

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

Bases: IronicObject, VersionedObjectDictCompat

VERSION = '1.9'

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 .Z element is reserved for stable branch backports. The .Z is ignored for the purposes of triggering a backport, which means anything changed under a .Z must be additive and non-destructive such that a node that knows about X.Y can consider X.Y.Z equivalent.

property address
property category
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

property 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

property dynamic_portgroup
property extra
fields = {'address': MACAddress(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'category': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'dynamic_portgroup': Boolean(default=False,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), 'node_uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'physical_network': String(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)}

The fields present in this object as key:field pairs.

For example:

fields = {
    'foo': obj_fields.IntegerField(),
    'bar': obj_fields.StringField(),
}
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, project=None)[source]

Find portgroup by address and return a Portgroup object.

Parameters:
  • cls – the Portgroup

  • context – Security context

  • address – The MAC address of a portgroup.

  • project – a node owner or lessee to match against.

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

property id
property internal_info
classmethod list(context, limit=None, marker=None, sort_key=None, sort_dir=None, project=None, conductor_groups=None, filters=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”.

  • project – a node owner or lessee to match against.

  • conductor_groups – A list of conductor groups to filter by, defaults to None

  • filters – Filters to apply, defaults to None

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, project=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”.

  • project – a node owner or lessee to match against.

Returns:

A list of Portgroup object.

Raises:

InvalidParameterValue

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

Return a list of Portgroup objects associated with nodes in shards.

Parameters:
  • context – Security context.

  • shards – A list of shards.

  • 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.

property mode
property name
property node_id
property node_uuid
property physical_network
property 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

property standalone_ports_supported
update_physical_network(new_physical_network, context=None)[source]

Updates the phyiscal_network for this Portgroup and its Ports.

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

property updated_at
property uuid
class ironic.objects.portgroup.PortgroupCRUDNotification(context=None, **kwargs)[source]

Bases: NotificationBase

Notification when ironic creates, updates or deletes a portgroup.

VERSION = '1.0'

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 .Z element is reserved for stable branch backports. The .Z is ignored for the purposes of triggering a backport, which means anything changed under a .Z must be additive and non-destructive such that a node that knows about X.Y can consider X.Y.Z equivalent.

property created_at
property 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)}

The fields present in this object as key:field pairs.

For example:

fields = {
    'foo': obj_fields.IntegerField(),
    'bar': obj_fields.StringField(),
}
property level
property payload
property publisher
property updated_at
class ironic.objects.portgroup.PortgroupCRUDPayload(portgroup, node_uuid)[source]

Bases: NotificationPayloadBase

SCHEMA = {'address': ('portgroup', 'address'), 'category': ('portgroup', 'category'), 'created_at': ('portgroup', 'created_at'), 'dynamic_portgroup': ('portgroup', 'dynamic_portgroup'), 'extra': ('portgroup', 'extra'), 'mode': ('portgroup', 'mode'), 'name': ('portgroup', 'name'), 'physical_network': ('portgroup', 'physical_network'), 'properties': ('portgroup', 'properties'), 'standalone_ports_supported': ('portgroup', 'standalone_ports_supported'), 'updated_at': ('portgroup', 'updated_at'), 'uuid': ('portgroup', 'uuid')}
VERSION = '1.3'

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 .Z element is reserved for stable branch backports. The .Z is ignored for the purposes of triggering a backport, which means anything changed under a .Z must be additive and non-destructive such that a node that knows about X.Y can consider X.Y.Z equivalent.

property address
property category
property created_at
property dynamic_portgroup
property extra
fields = {'address': MACAddress(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'category': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'dynamic_portgroup': Boolean(default=False,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), 'physical_network': String(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=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}

The fields present in this object as key:field pairs.

For example:

fields = {
    'foo': obj_fields.IntegerField(),
    'bar': obj_fields.StringField(),
}
property mode
property name
property node_uuid
property physical_network
property properties
property standalone_ports_supported
property updated_at
property uuid