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.

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

Param:obj:

The VersionedObject on which an attribute is being set

Param:attr:

The name of the attribute being set

Param:value:

The value being set

Returns:

A properly-typed value

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

Param:obj:

The VersionedObject on which the value is to be set

Param:attr:

The name of the attribute which will hold the value

Param:value:

The serialized form of the value

Returns:

The natural form of the value

static stringify(value)

Returns a short stringified version of a value.

static 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().

Param:obj:

The VersionedObject on which the value is set

Param:attr:

The name of the attribute holding the value

Param:value:

The natural form of the value

Returns:

The serialized form of the value

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

Bases: AutoTypedField

AUTO_TYPE

alias of DictOfMiscValues

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.

Param:obj:

The VersionedObject on which an attribute is being set

Param:attr:

The name of the attribute being set

Param:value:

The value being set

Returns:

A properly-typed value

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

Bases: AutoTypedField

AUTO_TYPE = <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(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <neutron_lib.objects.common_types.DscpMark object>
class neutron_lib.objects.common_types.EtherTypeEnumField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <oslo_versionedobjects.fields.Enum object>
class neutron_lib.objects.common_types.FloatingIPStatusEnumField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <oslo_versionedobjects.fields.Enum object>
class neutron_lib.objects.common_types.FlowDirectionAndAnyEnumField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <oslo_versionedobjects.fields.Enum object>
class neutron_lib.objects.common_types.FlowDirectionEnumField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <oslo_versionedobjects.fields.Enum object>
class neutron_lib.objects.common_types.HARouterEnumField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <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.

Param:obj:

The VersionedObject on which an attribute is being set

Param:attr:

The name of the attribute being set

Param:value:

The value being set

Returns:

A properly-typed value

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

Param:obj:

The VersionedObject on which the value is to be set

Param:attr:

The name of the attribute which will hold the value

Param:value:

The serialized form of the value

Returns:

The natural form of the value

static 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().

Param:obj:

The VersionedObject on which the value is set

Param:attr:

The name of the attribute holding the value

Param:value:

The natural form of the value

Returns:

The serialized form of the value

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

Bases: AutoTypedField

AUTO_TYPE = <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(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <neutron_lib.objects.common_types.IPNetworkPrefixLen object>
class neutron_lib.objects.common_types.IPV6ModeEnumField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <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(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <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.

Param:obj:

The VersionedObject on which an attribute is being set

Param:attr:

The name of the attribute being set

Param: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(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <neutron_lib.objects.common_types.IpProtocolEnum object>
class neutron_lib.objects.common_types.IpamAllocationStatusEnumField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <oslo_versionedobjects.fields.Enum object>
class neutron_lib.objects.common_types.ListOfDictOfMiscValuesField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <oslo_versionedobjects.fields.List object>
class neutron_lib.objects.common_types.ListOfIPNetworksField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <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.

Param:obj:

The VersionedObject on which an attribute is being set

Param:attr:

The name of the attribute being set

Param:value:

The value being set

Returns:

A properly-typed value

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

Param:obj:

The VersionedObject on which the value is to be set

Param:attr:

The name of the attribute which will hold the value

Param:value:

The serialized form of the value

Returns:

The natural form of the value

static 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().

Param:obj:

The VersionedObject on which the value is set

Param:attr:

The name of the attribute holding the value

Param:value:

The natural form of the value

Returns:

The serialized form of the value

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

Bases: AutoTypedField

AUTO_TYPE = <neutron_lib.objects.common_types.MACAddress object>
class neutron_lib.objects.common_types.NetworkSegmentRangeNetworkTypeEnumField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <oslo_versionedobjects.fields.Enum object>
class neutron_lib.objects.common_types.NumaAffinityPoliciesEnumField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <oslo_versionedobjects.fields.Enum object>
class neutron_lib.objects.common_types.PortBindingStatusEnumField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <oslo_versionedobjects.fields.Enum object>
class neutron_lib.objects.common_types.PortRange(start=1, **kwargs)

Bases: RangeConstrainedInteger

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

Bases: AutoTypedField

AUTO_TYPE = <neutron_lib.objects.common_types.PortRange object>
class neutron_lib.objects.common_types.PortRangeWith0Field(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <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.

Param:obj:

The VersionedObject on which an attribute is being set

Param:attr:

The name of the attribute being set

Param:value:

The value being set

Returns:

A properly-typed value

get_schema()
class neutron_lib.objects.common_types.PortRangesField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <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.

Param:obj:

The VersionedObject on which an attribute is being set

Param:attr:

The name of the attribute being set

Param:value:

The value being set

Returns:

A properly-typed value

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

Bases: AutoTypedField

AUTO_TYPE = <oslo_versionedobjects.fields.Enum object>
class neutron_lib.objects.common_types.SetOfUUIDsField(**kwargs)

Bases: AutoTypedField

AUTO_TYPE = <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.

Param:obj:

The VersionedObject on which an attribute is being set

Param:attr:

The name of the attribute being set

Param:value:

The value being set

Returns:

A properly-typed value

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

Bases: AutoTypedField

AUTO_TYPE = <neutron_lib.objects.common_types.UUID object>
class neutron_lib.objects.common_types.VlanIdRange(**kwargs)

Bases: RangeConstrainedInteger

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

Bases: AutoTypedField

AUTO_TYPE = <neutron_lib.objects.common_types.VlanIdRange object>