# neutron_lib.objects.common_types module

class neutron_lib.objects.common_types.DictOfMiscValues

  Bases: `FieldType`

  DictOfMiscValues custom field

  This custom field is handling dictionary with miscellaneous value types, including integer, float, boolean and list and nested dictionaries.

  coerce(obj, attr, value)

    This is called to coerce (if possible) a value on assignment.

    This method should convert the value given into the designated type, or throw an exception if this is not possible.

    Parameters:

      - obj – The VersionedObject on which an attribute is being set

      - attr – The name of the attribute being set

      - value – The value being set

    Returns:

      A properly-typed value

  from_primitive(obj, attr, value)

    This is called to deserialize a value.

    This method should deserialize a value from the form given by to_primitive() to the designated type.

    Parameters:

      - obj – The VersionedObject on which the value is to be set

      - attr – The name of the attribute which will hold the value

      - value – The serialized form of the value

    Returns:

      The natural form of the value

  stringify(value)

    Returns a short stringified version of a value.

  to_primitive(obj, attr, value)

    This is called to serialize a value.

    This method should serialize a value to the form expected by from_primitive().

    Parameters:

      - obj – The VersionedObject on which the value is set

      - attr – The name of the attribute holding the value

      - value – The natural form of the value

    Returns:

      The serialized form of the value

class neutron_lib.objects.common_types.DictOfMiscValuesField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.DictOfMiscValues object>

class neutron_lib.objects.common_types.DomainName

  Bases: `String`

  coerce(obj, attr, value)

    This is called to coerce (if possible) a value on assignment.

    This method should convert the value given into the designated type, or throw an exception if this is not possible.

    Parameters:

      - obj – The VersionedObject on which an attribute is being set

      - attr – The name of the attribute being set

      - value – The value being set

    Returns:

      A properly-typed value

class neutron_lib.objects.common_types.DomainNameField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.DomainName object>

class neutron_lib.objects.common_types.DscpMark(valid_values=None, **kwargs)

  Bases: `IntegerEnum`

class neutron_lib.objects.common_types.DscpMarkField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.DscpMark object>

class neutron_lib.objects.common_types.EtherTypeEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.FloatingIPStatusEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.FlowDirectionAndAnyEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.FlowDirectionEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.HARouterEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.IPNetwork

  Bases: `FieldType`

  IPNetwork custom field.

  This custom field is different from the one provided by oslo.versionedobjects library: it does not reset string representation for the field.

  coerce(obj, attr, value)

    This is called to coerce (if possible) a value on assignment.

    This method should convert the value given into the designated type, or throw an exception if this is not possible.

    Parameters:

      - obj – The VersionedObject on which an attribute is being set

      - attr – The name of the attribute being set

      - value – The value being set

    Returns:

      A properly-typed value

  from_primitive(obj, attr, value)

    This is called to deserialize a value.

    This method should deserialize a value from the form given by to_primitive() to the designated type.

    Parameters:

      - obj – The VersionedObject on which the value is to be set

      - attr – The name of the attribute which will hold the value

      - value – The serialized form of the value

    Returns:

      The natural form of the value

  to_primitive(obj, attr, value)

    This is called to serialize a value.

    This method should serialize a value to the form expected by from_primitive().

    Parameters:

      - obj – The VersionedObject on which the value is set

      - attr – The name of the attribute holding the value

      - value – The natural form of the value

    Returns:

      The serialized form of the value

class neutron_lib.objects.common_types.IPNetworkField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.IPNetwork object>

class neutron_lib.objects.common_types.IPNetworkPrefixLen(**kwargs)

  Bases: `RangeConstrainedInteger`

  IP network (CIDR) prefix length custom Enum

class neutron_lib.objects.common_types.IPNetworkPrefixLenField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.IPNetworkPrefixLen object>

class neutron_lib.objects.common_types.IPV6ModeEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.IPVersionEnum(**kwargs)

  Bases: `IntegerEnum`

  IP version integer Enum

class neutron_lib.objects.common_types.IPVersionEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.IPVersionEnum object>

class neutron_lib.objects.common_types.IntegerEnum(valid_values=None, **kwargs)

  Bases: `Integer`

  coerce(obj, attr, value)

    This is called to coerce (if possible) a value on assignment.

    This method should convert the value given into the designated type, or throw an exception if this is not possible.

    Parameters:

      - obj – The VersionedObject on which an attribute is being set

      - attr – The name of the attribute being set

      - value – The value being set

    Returns:

      A properly-typed value

class neutron_lib.objects.common_types.IpProtocolEnum(**kwargs)

  Bases: `Enum`

  IP protocol number Enum

class neutron_lib.objects.common_types.IpProtocolEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.IpProtocolEnum object>

class neutron_lib.objects.common_types.IpamAllocationStatusEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.ListOfDictOfMiscValuesField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.List object>

class neutron_lib.objects.common_types.ListOfIPNetworksField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.List object>

class neutron_lib.objects.common_types.MACAddress

  Bases: `FieldType`

  MACAddress custom field.

  This custom field is different from the one provided by oslo.versionedobjects library: it uses netaddr.EUI type instead of strings.

  coerce(obj, attr, value)

    This is called to coerce (if possible) a value on assignment.

    This method should convert the value given into the designated type, or throw an exception if this is not possible.

    Parameters:

      - obj – The VersionedObject on which an attribute is being set

      - attr – The name of the attribute being set

      - value – The value being set

    Returns:

      A properly-typed value

  from_primitive(obj, attr, value)

    This is called to deserialize a value.

    This method should deserialize a value from the form given by to_primitive() to the designated type.

    Parameters:

      - obj – The VersionedObject on which the value is to be set

      - attr – The name of the attribute which will hold the value

      - value – The serialized form of the value

    Returns:

      The natural form of the value

  to_primitive(obj, attr, value)

    This is called to serialize a value.

    This method should serialize a value to the form expected by from_primitive().

    Parameters:

      - obj – The VersionedObject on which the value is set

      - attr – The name of the attribute holding the value

      - value – The natural form of the value

    Returns:

      The serialized form of the value

class neutron_lib.objects.common_types.MACAddressField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.MACAddress object>

class neutron_lib.objects.common_types.NetworkSegmentRangeNetworkTypeEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.NumaAffinityPoliciesEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.PortBindingStatusEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.PortHardwareOffloadTypeEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.PortRange(start=1, **kwargs)

  Bases: `RangeConstrainedInteger`

class neutron_lib.objects.common_types.PortRangeField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.PortRange object>

class neutron_lib.objects.common_types.PortRangeWith0Field(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.PortRange object>

class neutron_lib.objects.common_types.PortRanges

  Bases: `FieldType`

  coerce(obj, attr, value)

    This is called to coerce (if possible) a value on assignment.

    This method should convert the value given into the designated type, or throw an exception if this is not possible.

    Parameters:

      - obj – The VersionedObject on which an attribute is being set

      - attr – The name of the attribute being set

      - value – The value being set

    Returns:

      A properly-typed value

  get_schema()

class neutron_lib.objects.common_types.PortRangesField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.PortRanges object>

class neutron_lib.objects.common_types.RangeConstrainedInteger(start, end, **kwargs)

  Bases: `Integer`

  coerce(obj, attr, value)

    This is called to coerce (if possible) a value on assignment.

    This method should convert the value given into the designated type, or throw an exception if this is not possible.

    Parameters:

      - obj – The VersionedObject on which an attribute is being set

      - attr – The name of the attribute being set

      - value – The value being set

    Returns:

      A properly-typed value

class neutron_lib.objects.common_types.RouterStatusEnumField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Enum object>

class neutron_lib.objects.common_types.SetOfUUIDsField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <oslo_versionedobjects.fields.Set object>

class neutron_lib.objects.common_types.UUID

  Bases: `UUID`

  coerce(obj, attr, value)

    This is called to coerce (if possible) a value on assignment.

    This method should convert the value given into the designated type, or throw an exception if this is not possible.

    Parameters:

      - obj – The VersionedObject on which an attribute is being set

      - attr – The name of the attribute being set

      - value – The value being set

    Returns:

      A properly-typed value

class neutron_lib.objects.common_types.UUIDField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.UUID object>

class neutron_lib.objects.common_types.VlanIdRange(**kwargs)

  Bases: `RangeConstrainedInteger`

class neutron_lib.objects.common_types.VlanIdRangeField(nullable: bool = False, default: T | type[UnspecifiedDefault] = <class 'oslo_versionedobjects.fields.UnspecifiedDefault'>, read_only: bool = False)

  Bases: `AutoTypedField`

  AUTO_TYPE: FieldType[T] = <neutron_lib.objects.common_types.VlanIdRange object>

this page last updated: 2026-08-15 12:38:23

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

found an error? report a bug