ironic.api.controllers.v1.port module

class ironic.api.controllers.v1.port.Port(**kwargs)[source]

Bases: ironic.api.controllers.base.APIBase

API representation of a port.

This class enforces type checking and value constraints, and converts between the internal object model and the API representation of a port.

address

MAC Address for this port

created_at

Complex type attribute definition.

Example:

class MyComplexType(wsme.types.Base):
    optionalvalue = int
    mandatoryvalue = wsattr(int, mandatory=True)
    named_value = wsattr(int, name='named.value')

After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:

class MyComplexType(wsme.types.Base):
    optionalvalue = wsattr(int)
    mandatoryvalue = wsattr(int, mandatory=True)
extra

This port’s meta data

internal_info

This port’s internal information maintained by ironic

is_smartnic

Indicates whether this port is a Smart NIC port.

A list containing a self link and associated port links

The port binding profile for the port

property node_uuid

The UUID of the node this port belongs to

physical_network

The name of the physical network to which this port is connected.

property portgroup_uuid

The UUID of the portgroup this port belongs to

pxe_enabled

Indicates whether pxe is enabled or disabled on the node.

classmethod sample(expand=True)[source]
sanitize(fields=None)[source]

Removes sensitive and unrequested data.

Will only keep the fields specified in the fields parameter.

Parameters

fields (list of str) – list of fields to preserve, or None to preserve them all

updated_at

Complex type attribute definition.

Example:

class MyComplexType(wsme.types.Base):
    optionalvalue = int
    mandatoryvalue = wsattr(int, mandatory=True)
    named_value = wsattr(int, name='named.value')

After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:

class MyComplexType(wsme.types.Base):
    optionalvalue = wsattr(int)
    mandatoryvalue = wsattr(int, mandatory=True)
uuid

Unique UUID for this port

class ironic.api.controllers.v1.port.PortCollection(**kwargs)[source]

Bases: ironic.api.controllers.v1.collection.Collection

API representation of a collection of ports.

next

Complex type attribute definition.

Example:

class MyComplexType(wsme.types.Base):
    optionalvalue = int
    mandatoryvalue = wsattr(int, mandatory=True)
    named_value = wsattr(int, name='named.value')

After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:

class MyComplexType(wsme.types.Base):
    optionalvalue = wsattr(int)
    mandatoryvalue = wsattr(int, mandatory=True)
ports

A list containing ports objects

classmethod sample()[source]
class ironic.api.controllers.v1.port.PortPatchType(**kw)[source]

Bases: ironic.api.controllers.v1.types.JsonPatchType

static internal_attrs()[source]

Returns a list of internal attributes.

Internal attributes can’t be added, replaced or removed. This method may be overwritten by derived class.

op

Complex type attribute definition.

Example:

class MyComplexType(wsme.types.Base):
    optionalvalue = int
    mandatoryvalue = wsattr(int, mandatory=True)
    named_value = wsattr(int, name='named.value')

After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:

class MyComplexType(wsme.types.Base):
    optionalvalue = wsattr(int)
    mandatoryvalue = wsattr(int, mandatory=True)
path

Complex type attribute definition.

Example:

class MyComplexType(wsme.types.Base):
    optionalvalue = int
    mandatoryvalue = wsattr(int, mandatory=True)
    named_value = wsattr(int, name='named.value')

After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:

class MyComplexType(wsme.types.Base):
    optionalvalue = wsattr(int)
    mandatoryvalue = wsattr(int, mandatory=True)
value

Complex type attribute definition.

Example:

class MyComplexType(wsme.types.Base):
    optionalvalue = int
    mandatoryvalue = wsattr(int, mandatory=True)
    named_value = wsattr(int, name='named.value')

After inspection, the non-wsattr attributes will be replaced, and the above class will be equivalent to:

class MyComplexType(wsme.types.Base):
    optionalvalue = wsattr(int)
    mandatoryvalue = wsattr(int, mandatory=True)
class ironic.api.controllers.v1.port.PortsController(*args, **kwargs)[source]

Bases: pecan.rest.RestController

REST controller for Ports.

advanced_net_fields = ['pxe_enabled', 'local_link_connection']
delete(port_uuid)[source]

Delete a port.

Parameters

port_uuid – UUID of a port.

Raises

OperationNotPermitted, HTTPNotFound

detail(node=None, node_uuid=None, address=None, marker=None, limit=None, sort_key='id', sort_dir='asc', portgroup=None)[source]

Retrieve a list of ports with detail.

Note that the ‘node_uuid’ interface is deprecated in favour of the ‘node’ interface

Parameters
  • node – UUID or name of a node, to get only ports for that node.

  • node_uuid – UUID of a node, to get only ports for that node.

  • address – MAC address of a port, to get the port which has this MAC address.

  • portgroup – UUID or name of a portgroup, to get only ports for that portgroup.

  • marker – pagination marker for large data sets.

  • limit – maximum number of resources to return in a single result. This value cannot be larger than the value of max_limit in the [api] section of the ironic configuration, or only max_limit resources will be returned.

  • sort_key – column to sort results by. Default: id.

  • sort_dir – direction to sort. “asc” or “desc”. Default: asc.

Raises

NotAcceptable, HTTPNotFound

get_all(node=None, node_uuid=None, address=None, marker=None, limit=None, sort_key='id', sort_dir='asc', fields=None, portgroup=None, detail=None)[source]

Retrieve a list of ports.

Note that the ‘node_uuid’ interface is deprecated in favour of the ‘node’ interface

Parameters
  • node – UUID or name of a node, to get only ports for that node.

  • node_uuid – UUID of a node, to get only ports for that node.

  • address – MAC address of a port, to get the port which has this MAC address.

  • marker – pagination marker for large data sets.

  • limit – maximum number of resources to return in a single result. This value cannot be larger than the value of max_limit in the [api] section of the ironic configuration, or only max_limit resources will be returned.

  • sort_key – column to sort results by. Default: id.

  • sort_dir – direction to sort. “asc” or “desc”. Default: asc.

  • fields – Optional, a list with a specified set of fields of the resource to be returned.

  • portgroup – UUID or name of a portgroup, to get only ports for that portgroup.

Raises

NotAcceptable, HTTPNotFound

get_one(port_uuid, fields=None)[source]

Retrieve information about the given port.

Parameters
  • port_uuid – UUID of a port.

  • fields – Optional, a list with a specified set of fields of the resource to be returned.

Raises

NotAcceptable, HTTPNotFound

invalid_sort_key_list = ['extra', 'internal_info', 'local_link_connection']
patch(port_uuid, patch)[source]

Update an existing port.

Parameters
  • port_uuid – UUID of a port.

  • patch – a json PATCH document to apply to this port.

Raises

NotAcceptable, HTTPNotFound

post(port)[source]

Create a new port.

Parameters

port – a port within the request body.

Raises

NotAcceptable, HTTPNotFound, Conflict

ironic.api.controllers.v1.port.hide_fields_in_newer_versions(obj)[source]