pynml.spec

NML specification definition and generation module.

Variables

pynml.spec.NML_SPEC

NML Specification as a Python dictionary

{u'classes': [{u'abstract': True,
               u'attributes': [{u'default': u"'{}({})'.format(\n                self.__class__.__name__, str(id(self))\n            )",
                                u'default_arg': u'None',
                                u'doc': u'Human readable string name',
                                u'name': u'name',
                                u'nml_attribute': u'name',
                                u'property': True,
                                u'semantic_type': u'string',
                                u'type': u'str',
                                u'validation': u'%s'},
                               {u'default': u'str(id(self))',
                                u'default_arg': u'None',
                                u'doc': u'Persistent globally unique URI',
                                u'name': u'identifier',
                                u'nml_attribute': u'id',
                                u'property': True,
                                u'semantic_type': u'URI',
                                u'type': u'str',
                                u'validation': u'is_valid_uri(%s)'},
                               {u'default': u'datetime.now().replace(microsecond=0).isoformat()',
                                u'default_arg': u'None',
                                u'doc': u'Time stamp formatted as ISO 8601',
                                u'name': u'version',
                                u'nml_attribute': u'version',
                                u'property': True,
                                u'semantic_type': u'timestamp',
                                u'type': u'str',
                                u'validation': None}],
               u'brief': u'The basic class from other instances inherit from',
               u'doc': u'No NetworkObject instances can be created because this class is abstract',
               u'name': u'Network Object',
               u'parent': None,
               u'relations': [{u'cardinality': u'+',
                               u'doc': u'FIXME: Document existsDuring relation',
                               u'name': u'existsDuring',
                               u'with': [u'Lifetime']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document isAlias relation',
                               u'name': u'isAlias',
                               u'with': [u'Network Object']},
                              {u'cardinality': u'1',
                               u'doc': u'FIXME: Document locatedAt relation',
                               u'name': u'locatedAt',
                               u'with': [u'Location']}]},
              {u'abstract': False,
               u'attributes': [],
               u'brief': u'A Node object represents a device in a network',
               u'doc': u'Physical or virtual devices can be represented by instances of this class',
               u'name': u'Node',
               u'parent': u'Network Object',
               u'relations': [{u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasInboundPort relation',
                               u'name': u'hasInboundPort',
                               u'with': [u'Port', u'Port Group']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasOutboundPort relation',
                               u'name': u'hasOutboundPort',
                               u'with': [u'Port', u'Port Group']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasService relation',
                               u'name': u'hasService',
                               u'with': [u'Switching Service']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document implementedBy relation',
                               u'name': u'implementedBy',
                               u'with': [u'Node']}]},
              {u'abstract': False,
               u'attributes': [{u'default': u'unset',
                                u'default_arg': u'None',
                                u'doc': u'Format of the data streaming through the port as an URI',
                                u'name': u'encoding',
                                u'nml_attribute': u'encoding',
                                u'property': True,
                                u'semantic_type': u'URI',
                                u'type': u'str',
                                u'validation': u'is_valid_uri(%s)'}],
               u'brief': u'Endpoint of an unidirectional connection',
               u'doc': u'Can represent physical or virtual ports. Needs a proper linking instance to connect to other ports',
               u'name': u'Port',
               u'parent': u'Network Object',
               u'relations': [{u'cardinality': u'1',
                               u'doc': u'FIXME: Document hasLabel relation',
                               u'name': u'hasLabel',
                               u'with': [u'Label']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasService relation',
                               u'name': u'hasService',
                               u'with': [u'Adaptation Service',
                                         u'De-adaptation Service']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document isSink relation',
                               u'name': u'isSink',
                               u'with': [u'Link']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document isSource relation',
                               u'name': u'isSource',
                               u'with': [u'Link']}]},
              {u'abstract': False,
               u'attributes': [{u'default': u'unset',
                                u'default_arg': u'None',
                                u'doc': u'Format of the data streaming through the link as an URI',
                                u'name': u'encoding',
                                u'nml_attribute': u'encoding',
                                u'property': True,
                                u'semantic_type': u'URI',
                                u'type': u'str',
                                u'validation': u'is_valid_uri(%s)'}],
               u'brief': u'Connects a source object with a sink one',
               u'doc': u'Sources and sinks have specified isSource or isSink relations with the Link instance but not vice versa',
               u'name': u'Link',
               u'parent': u'Network Object',
               u'relations': [{u'cardinality': u'1',
                               u'doc': u'FIXME: Document hasLabel relation',
                               u'name': u'hasLabel',
                               u'with': [u'Label']}]},
              {u'abstract': True,
               u'attributes': [],
               u'brief': u'Base class for services that a network may provide',
               u'doc': u'No Service instances can be created because this class is abstract',
               u'name': u'Service',
               u'parent': u'Network Object',
               u'relations': []},
              {u'abstract': False,
               u'attributes': [{u'default': u'unset',
                                u'default_arg': u'None',
                                u'doc': u'Format of the data streaming through the service as an URI',
                                u'name': u'encoding',
                                u'nml_attribute': u'encoding',
                                u'property': True,
                                u'semantic_type': u'URI',
                                u'type': u'str',
                                u'validation': u'is_valid_uri(%s)'}],
               u'brief': u'Shows that the network can create new links between certain ports',
               u'doc': u'An instance of this class shows that the network is capable of creating new Links or LinkGroups between its inbound and outbound ports. These Links or LinkGroups are identified by being related to the SwitchingService instance with a providesLink relation',
               u'name': u'Switching Service',
               u'parent': u'Service',
               u'relations': [{u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasInboundPort relation',
                               u'name': u'hasInboundPort',
                               u'with': [u'Port', u'Port Group']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasOutboundPort relation',
                               u'name': u'hasOutboundPort',
                               u'with': [u'Port', u'Port Group']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document providesLink relation',
                               u'name': u'providesLink',
                               u'with': [u'Link', u'Link Group']}]},
              {u'abstract': False,
               u'attributes': [{u'default': None,
                                u'default_arg': None,
                                u'doc': u'Function for multiplexing',
                                u'name': u'adaptation_function',
                                u'nml_attribute': u'adaptationFunction',
                                u'property': False,
                                u'semantic_type': None,
                                u'type': None,
                                u'validation': None}],
               u'brief': u'Shows that the network can embed data from one or more Ports or PortGroups into other Ports or PortGroups',
               u'doc': u'An instance of this class shows that data from one or more Ports can be embedded in the data encoding of other Port or Ports. This class has an adaptationFunction attribute that should describe the kind of embedding that is used by the AdaptationService instance',
               u'name': u'Adaptation Service',
               u'parent': u'Service',
               u'relations': [{u'cardinality': u'+',
                               u'doc': u'FIXME: Document canProvidePort relation',
                               u'name': u'canProvidePort',
                               u'with': [u'Port', u'Port Group']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document existsDuring relation',
                               u'name': u'existsDuring',
                               u'with': [u'Lifetime']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document providesPort relation',
                               u'name': u'providesPort',
                               u'with': [u'Port', u'Port Group']}]},
              {u'abstract': False,
               u'attributes': [{u'default': None,
                                u'default_arg': None,
                                u'doc': u'Function for multiplexing',
                                u'name': u'adaptation_function',
                                u'nml_attribute': u'adaptationFunction',
                                u'property': False,
                                u'semantic_type': None,
                                u'type': None,
                                u'validation': None}],
               u'brief': u'Shows that the network can extract data from one or more Ports or PortGroups encoding',
               u'doc': u'An instance of this class shows that data from one or more Ports can be extracted from the data encoding of other Port or Ports. This class has an adaptationFunction attribute that should describe the kind of extraction that is used by the DeadaptationService instance',
               u'name': u'De-adaptation Service',
               u'parent': u'Service',
               u'relations': [{u'cardinality': u'+',
                               u'doc': u'FIXME: Document canProvidePort relation',
                               u'name': u'canProvidePort',
                               u'with': [u'Port', u'Port Group']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document existsDuring relation',
                               u'name': u'existsDuring',
                               u'with': [u'Lifetime']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document providesPort relation',
                               u'name': u'providesPort',
                               u'with': [u'Port', u'Port Group']}]},
              {u'abstract': True,
               u'attributes': [],
               u'brief': u'A collection of objects',
               u'doc': u'Any object can be part of a Group, even another Group. An object can be part of multiple Groups',
               u'name': u'Group',
               u'parent': u'Network Object',
               u'relations': []},
              {u'abstract': False,
               u'attributes': [],
               u'brief': u'A set of connected or connectable Network objects',
               u'doc': u'One or more Link or LinkGroup objects can provide the connection between the Topology Network Objects',
               u'name': u'Topology',
               u'parent': u'Group',
               u'relations': [{u'cardinality': u'+',
                               u'doc': u'FIXME: Document existsDuring relation',
                               u'name': u'existsDuring',
                               u'with': [u'Lifetime']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasNode relation',
                               u'name': u'hasNode',
                               u'with': [u'Node']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasInboundPort relation',
                               u'name': u'hasInboundPort',
                               u'with': [u'Port', u'Port Group']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasOutboundPort relation',
                               u'name': u'hasOutboundPort',
                               u'with': [u'Port', u'Port Group']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasService relation',
                               u'name': u'hasService',
                               u'with': [u'Switching Service']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasEnvironment relation',
                               u'name': u'hasEnvironment',
                               u'with': [u'Environment']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasTopology relation',
                               u'name': u'hasTopology',
                               u'with': [u'Topology']}]},
              {u'abstract': False,
               u'attributes': [],
               u'brief': u'A unordered set of Ports',
               u'doc': u'FIXME: Document PortGroup',
               u'name': u'Port Group',
               u'parent': u'Group',
               u'relations': [{u'cardinality': u'+',
                               u'doc': u'FIXME: Document existsDuring relation',
                               u'name': u'existsDuring',
                               u'with': [u'Lifetime']},
                              {u'cardinality': u'1',
                               u'doc': u'FIXME: Document hasLabelGroup relation',
                               u'name': u'hasLabelGroup',
                               u'with': [u'Lifetime']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasPort relation',
                               u'name': u'hasPort',
                               u'with': [u'Port', u'Port Group']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document isSink relation',
                               u'name': u'isSink',
                               u'with': [u'Link Group']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document isSource relation',
                               u'name': u'isSource',
                               u'with': [u'Link Group']}]},
              {u'abstract': False,
               u'attributes': [],
               u'brief': u'A unordered set of Links',
               u'doc': u'FIXME: Document LinkGroup',
               u'name': u'Link Group',
               u'parent': u'Group',
               u'relations': [{u'cardinality': u'+',
                               u'doc': u'FIXME: Document existsDuring relation',
                               u'name': u'existsDuring',
                               u'with': [u'Lifetime']},
                              {u'cardinality': u'1',
                               u'doc': u'FIXME: Document hasLabelGroup relation',
                               u'name': u'hasLabelGroup',
                               u'with': [u'Lifetime']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document hasLink relation',
                               u'name': u'hasLink',
                               u'with': [u'Port', u'Port Group']},
                              {u'cardinality': u'+',
                               u'doc': u'FIXME: Document isSerialCompoundLink relation',
                               u'name': u'isSerialCompoundLink',
                               u'with': [u'Port', u'Port Group']}]},
              {u'abstract': False,
               u'attributes': [],
               u'brief': u'A group of two unidirectional Ports or PortGroups',
               u'doc': u'The purpose of this class is to provide a convenient representation of a bidirectional Port. This is needed because NML is a unidirectional specification',
               u'name': u'Bidirectional Port',
               u'parent': u'Group',
               u'relations': [{u'cardinality': u'+',
                               u'doc': u'FIXME: Document existsDuring relation',
                               u'name': u'existsDuring',
                               u'with': [u'Lifetime']},
                              {u'cardinality': u'2',
                               u'doc': u'FIXME: Document hasPort relation',
                               u'name': u'hasPort',
                               u'with': [u'Port', u'Port Group']}]},
              {u'abstract': False,
               u'attributes': [],
               u'brief': u'A group of two unidirectional Links or LinkGroups',
               u'doc': u'The purpose of this class is to provide a convenient representation of a bidirectional Link. This is needed because NML is a unidirectional specification',
               u'name': u'Bidirectional Link',
               u'parent': u'Group',
               u'relations': [{u'cardinality': u'+',
                               u'doc': u'FIXME: Document existsDuring relation',
                               u'name': u'existsDuring',
                               u'with': [u'Lifetime']},
                              {u'cardinality': u'2',
                               u'doc': u'FIXME: Document hasLink relation',
                               u'name': u'hasLink',
                               u'with': [u'Link', u'Link Group']}]},
              {u'abstract': False,
               u'attributes': [],
               u'brief': u'Describes attributes inherent to the environment',
               u'doc': u'Attributes to be attached to the environment the topology is in.',
               u'name': u'Environment',
               u'parent': None,
               u'relations': []},
              {u'abstract': False,
               u'attributes': [{u'default': u"'{}<{}>'.format(\n                self.__class__.__name__, str(id(self))\n            )",
                                u'default_arg': u'None',
                                u'doc': u'Human readable string name',
                                u'name': u'name',
                                u'nml_attribute': u'name',
                                u'property': True,
                                u'semantic_type': u'string',
                                u'type': u'str',
                                u'validation': u'%s'},
                               {u'default': u'str(id(self))',
                                u'default_arg': u'None',
                                u'doc': u'Persistent globally unique URI',
                                u'name': u'identifier',
                                u'nml_attribute': u'id',
                                u'property': True,
                                u'semantic_type': u'URI',
                                u'type': u'str',
                                u'validation': u'is_valid_uri(%s)'},
                               {u'default': u'unset',
                                u'default_arg': u'None',
                                u'doc': u'Longitude in WGS84 and in decimal degrees',
                                u'name': u'longitude',
                                u'nml_attribute': u'long',
                                u'property': True,
                                u'semantic_type': u'WGS84',
                                u'type': u'str',
                                u'validation': None},
                               {u'default': u'unset',
                                u'default_arg': u'None',
                                u'doc': u'Latitude in WGS84 and in decimal degrees',
                                u'name': u'latitude',
                                u'nml_attribute': u'lat',
                                u'property': True,
                                u'semantic_type': u'WGS84',
                                u'type': u'str',
                                u'validation': None},
                               {u'default': u'unset',
                                u'default_arg': u'None',
                                u'doc': u'Altitude in WGS84 and in decimal meters',
                                u'name': u'altitude',
                                u'nml_attribute': u'alt',
                                u'property': True,
                                u'semantic_type': u'WGS84',
                                u'type': u'str',
                                u'validation': None},
                               {u'default': u'unset',
                                u'default_arg': u'None',
                                u'doc': u'UN/LOCODE location identifier',
                                u'name': u'unlocode',
                                u'nml_attribute': u'unlocode',
                                u'property': True,
                                u'semantic_type': u'UN/LOCODE',
                                u'type': u'str',
                                u'validation': None},
                               {u'default': u'unset',
                                u'default_arg': u'None',
                                u'doc': u'A vCard ADR property',
                                u'name': u'address',
                                u'nml_attribute': u'address',
                                u'property': True,
                                u'semantic_type': u'vCard ADR',
                                u'type': u'str',
                                u'validation': None}],
               u'brief': u'Describes where the object is physically located',
               u'doc': u'An instance of this class can be related to other objects that are to be represented as being present in the same place',
               u'name': u'Location',
               u'parent': None,
               u'relations': []},
              {u'abstract': False,
               u'attributes': [{u'default': u'datetime.now().replace(microsecond=0).isoformat()',
                                u'default_arg': u'None',
                                u'doc': u'Date and time formatted as ISO 8601 calendar date compact representation with UTC timezone (YYYYMMDDThhmmssZ)',
                                u'name': u'start',
                                u'nml_attribute': u'start',
                                u'property': True,
                                u'semantic_type': u'timestamp',
                                u'type': u'str',
                                u'validation': None},
                               {u'default': u'datetime.now().replace(microsecond=0).isoformat()',
                                u'default_arg': u'None',
                                u'doc': u'Date and time formatted as ISO 8601 calendar date compact representation with UTC timezone (YYYYMMDDThhmmssZ)',
                                u'name': u'end',
                                u'nml_attribute': u'end',
                                u'property': True,
                                u'semantic_type': u'timestamp',
                                u'type': u'str',
                                u'validation': None}],
               u'brief': u'A time interval where the object is active',
               u'doc': u'An object can have multiple Lifetimes, if so, it will be active in a time interval equivalent to the union of all its Lifetimes time intervals',
               u'name': u'Lifetime',
               u'parent': None,
               u'relations': []},
              {u'abstract': False,
               u'attributes': [{u'default': None,
                                u'default_arg': None,
                                u'doc': u'A technology-specific labelset',
                                u'name': u'labeltype',
                                u'nml_attribute': u'labeltype',
                                u'property': False,
                                u'semantic_type': None,
                                u'type': None,
                                u'validation': None},
                               {u'default': None,
                                u'default_arg': None,
                                u'doc': u'A specific value taken from a labelset',
                                u'name': u'value',
                                u'nml_attribute': u'value',
                                u'property': False,
                                u'semantic_type': None,
                                u'type': None,
                                u'validation': None}],
               u'brief': u'A value that specifies a single data stream among many',
               u'doc': u'A Label is technology-specific, so a Label used to identify a VLAN would be different from a Label used to identify a wavelength',
               u'name': u'Label',
               u'parent': None,
               u'relations': []},
              {u'abstract': False,
               u'attributes': [{u'default': None,
                                u'default_arg': None,
                                u'doc': u'A technology-specific labelset',
                                u'name': u'labeltype',
                                u'nml_attribute': u'labeltype',
                                u'property': False,
                                u'semantic_type': None,
                                u'type': None,
                                u'validation': None},
                               {u'default': None,
                                u'default_arg': None,
                                u'doc': u'A specific value taken from a labelset',
                                u'name': u'value',
                                u'nml_attribute': u'value',
                                u'property': False,
                                u'semantic_type': None,
                                u'type': None,
                                u'validation': None}],
               u'brief': u'A unordered set of Labels',
               u'doc': u'FIXME: Document LabelGroup',
               u'name': u'Label Group',
               u'parent': None,
               u'relations': []},
              {u'abstract': False,
               u'attributes': [],
               u'brief': u'An ordered list of Network Objects',
               u'doc': u'Instances of this class are used to describe a path in the network along with the isSerialCompoundLink relation',
               u'name': u'Ordered List',
               u'parent': None,
               u'relations': []},
              {u'abstract': False,
               u'attributes': [],
               u'brief': u'An element of an OrderedList',
               u'doc': u'Is a syntax-dependent object used to represent elements in an OrderedList',
               u'name': u'List Item',
               u'parent': None,
               u'relations': []}]}