ironic.objects.port module¶
- class ironic.objects.port.Port(context=None, **kwargs)[source]¶
Bases:
IronicObject,VersionedObjectDictCompat- VERSION = '1.16'¶
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 address¶
- property available_for_dynamic_portgroup¶
- property category¶
- create(context=None)[source]¶
Create a Port 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.: Port(context)
- Raises:
MACAlreadyExists if ‘address’ column is not unique
- Raises:
PortAlreadyExists if ‘uuid’ column is not unique
- property created_at¶
- dbapi = <oslo_db.api.DBAPI object>¶
- property description¶
- destroy(context=None)[source]¶
Delete the Port 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.: Port(context)
- Raises:
PortNotFound
- property extra¶
- fields = {'address': MACAddress(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'available_for_dynamic_portgroup': Boolean(default=True,nullable=False), 'category': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'description': String(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), 'is_smartnic': Boolean(default=False,nullable=True), 'local_link_connection': FlexibleDict(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), 'portgroup_id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'pxe_enabled': 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), 'vendor': String(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(context, port_id)[source]¶
Find a port.
Find a port based on its id or uuid or name or MAC address and return a Port object.
- Parameters:
context – Security context
port_id – the id or uuid or name or MAC address of a port.
- Returns:
a
Portobject.- Raises:
InvalidIdentity
- classmethod get_by_address(context, address, owner=None, project=None)[source]¶
Find a port based on address and return a
Portobject.
- classmethod get_by_id(context, port_id)[source]¶
Find a port based on its integer ID and return a Port object.
- property id¶
- property internal_info¶
- property is_smartnic¶
- classmethod list(context, limit=None, marker=None, sort_key=None, sort_dir=None, owner=None, project=None, conductor_groups=None, filters=None)[source]¶
Return a list of Port 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”.
owner – DEPRECATED a node owner to match against
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
Portobject.- Raises:
InvalidParameterValue
- classmethod list_by_node_id(context, node_id, limit=None, marker=None, sort_key=None, sort_dir=None, owner=None, project=None, filters=None)[source]¶
Return a list of Port objects associated with a given node ID.
- Parameters:
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”.
owner – DEPRECATED a node owner to match against
project – a node owner or lessee to match against
filters – Filters to apply, defaults to None
- Returns:
a list of
Portobject.
- classmethod list_by_node_shards(context, shards, limit=None, marker=None, sort_key=None, sort_dir=None, project=None, filters=None)[source]¶
Return a list of Port 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”.
project – a node owner or lessee to match against
filters – Filters to apply, defaults to None
- Returns:
a list of
Portobject.
- classmethod list_by_portgroup_id(context, portgroup_id, limit=None, marker=None, sort_key=None, sort_dir=None, owner=None, project=None, filters=None)[source]¶
Return a list of Port objects associated with a given portgroup ID.
- Parameters:
context – Security context.
portgroup_id – the ID of the portgroup.
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”.
owner – DEPRECATED a node owner to match against
project – a node owner or lessee to match against
filters – Filters to apply, defaults to None
- Returns:
a list of
Portobject.
- property local_link_connection¶
- property name¶
- property node_id¶
- property node_uuid¶
- property physical_network¶
- property portgroup_id¶
- property pxe_enabled¶
- refresh(context=None)[source]¶
Loads updates for this Port.
Loads a port with the same uuid from the database and checks for updated attributes. Updates are applied from the loaded port 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.: Port(context)
- Raises:
PortNotFound
- save(context=None)[source]¶
Save updates to this Port.
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.: Port(context)
- Raises:
PortNotFound
- Raises:
MACAlreadyExists if ‘address’ column is not unique
- set_local_link_connection(key, value)[source]¶
Set a local_link_connection value.
Setting a local_link_connection dict value via this method ensures that this field will be flagged for saving.
- Parameters:
key – Key of item to set
value – Value of item to set
- classmethod supports_is_smartnic()[source]¶
Return whether is_smartnic field is supported.
- Returns:
Whether is_smartnic field is supported
- Raises:
ovo_exception.IncompatibleObjectVersion
- classmethod supports_physical_network()[source]¶
Return whether the physical_network field is supported.
- Returns:
Whether the physical_network field is supported
- Raises:
ovo_exception.IncompatibleObjectVersion
- property updated_at¶
- property uuid¶
- property vendor¶
- class ironic.objects.port.PortCRUDNotification(context=None, **kwargs)[source]¶
Bases:
NotificationBaseNotification emitted when ironic creates, updates or deletes a port.
- 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.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 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:fieldpairs.For example:
fields = { 'foo': obj_fields.IntegerField(), 'bar': obj_fields.StringField(), }
- property level¶
- property payload¶
- property publisher¶
- property updated_at¶
- class ironic.objects.port.PortCRUDPayload(port, node_uuid, portgroup_uuid)[source]¶
Bases:
NotificationPayloadBase- SCHEMA = {'address': ('port', 'address'), 'available_for_dynamic_portgroup': ('port', 'available_for_dynamic_portgroup'), 'category': ('port', 'category'), 'created_at': ('port', 'created_at'), 'description': ('port', 'description'), 'extra': ('port', 'extra'), 'is_smartnic': ('port', 'is_smartnic'), 'local_link_connection': ('port', 'local_link_connection'), 'name': ('port', 'name'), 'physical_network': ('port', 'physical_network'), 'pxe_enabled': ('port', 'pxe_enabled'), 'updated_at': ('port', 'updated_at'), 'uuid': ('port', 'uuid'), 'vendor': ('port', 'vendor')}¶
- VERSION = '1.8'¶
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 address¶
- property available_for_dynamic_portgroup¶
- property category¶
- property created_at¶
- property description¶
- property extra¶
- fields = {'address': MACAddress(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'available_for_dynamic_portgroup': Boolean(default=True,nullable=False), 'category': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'description': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'extra': FlexibleDict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'is_smartnic': Boolean(default=False,nullable=True), 'local_link_connection': FlexibleDict(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), 'portgroup_uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'pxe_enabled': 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), 'vendor': String(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(), }
- property is_smartnic¶
- property local_link_connection¶
- property name¶
- property node_uuid¶
- property physical_network¶
- property portgroup_uuid¶
- property pxe_enabled¶
- property updated_at¶
- property uuid¶
- property vendor¶