ironic.api.controllers.v1.portgroup module

class ironic.api.controllers.v1.portgroup.Portgroup(**kwargs)[source]

Bases: ironic.api.controllers.base.APIBase

API representation of a portgroup.

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

address

MAC Address for this portgroup

Add links to the portgroup.

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 portgroup’s meta data

internal_info

This portgroup’s internal info

A list containing a self link and associated portgroup links

mode

The mode for this portgroup. See linux bonding documentation for details: https://www.kernel.org/doc/Documentation/networking/bonding.txt

name

The logical name for this portgroup

property node_uuid

The UUID of the node this portgroup belongs to

ports

Links to the collection of ports of this portgroup

properties

This portgroup’s properties

classmethod sample(expand=True)[source]

Return a sample of the portgroup.

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

standalone_ports_supported

Indicates whether ports of this portgroup may be used as single NIC ports

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 portgroup

class ironic.api.controllers.v1.portgroup.PortgroupCollection(**kwargs)[source]

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

API representation of a collection of portgroups.

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)
portgroups

A list containing portgroup objects

classmethod sample()[source]

Return a sample of the portgroup.

class ironic.api.controllers.v1.portgroup.PortgroupPatchType(**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.portgroup.PortgroupsController(*args, **kwargs)[source]

Bases: pecan.rest.RestController

REST controller for portgroups.

delete(portgroup_ident)[source]

Delete a portgroup.

Parameters

portgroup_ident – UUID or logical name of a portgroup.

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

Retrieve a list of portgroups with detail.

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

  • address – MAC address of a portgroup, to get the portgroup 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.

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

Retrieve a list of portgroups.

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

  • address – MAC address of a portgroup, to get the portgroup 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.

get_one(portgroup_ident, fields=None)[source]

Retrieve information about the given portgroup.

Parameters
  • portgroup_ident – UUID or logical name of a portgroup.

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

invalid_sort_key_list = ['extra', 'internal_info', 'properties']
patch(portgroup_ident, patch)[source]

Update an existing portgroup.

Parameters
  • portgroup_ident – UUID or logical name of a portgroup.

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

post(portgroup)[source]

Create a new portgroup.

Parameters

portgroup – a portgroup within the request body.