53afcc83 by Michael B. Mathews

V1.1 with updated JSON and XMF types and proper references.

1 parent 561a0aa9
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2018, TeleCommunication Systems, Inc.,
a wholly-owned subsidiary of Comtech Telecommunications Corp.
and/or affiliates of TeleCommunication Systems, Inc.
All rights reserved.
TeleCommunication Systems, Inc. PROPRIETARY/CONFIDENTIAL.
Use is subject to license terms included in the distribution.
-->
<specification xmlns="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
xmlns:xid="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
identity="ApiBase.xid.xml">
<title>Tensor Microservices API Base Definitions</title>
<comment>
This document defines the common types API service interface (input and output base structures) for the Tensor microservices definitions.
</comment>
<import ref="https://xid.location.studio/Tensor/V1.1/Common.xid.xml" local="Common.xid.xml" />
<namespace name="Tensor">
<!--
*******************************
*InputBase Type Definition
*******************************
-->
<struct name="InputBase" >
<comment>Base input fields for operations supporting asynchronous transaction information.</comment>
<elem name="devid" multiplicity="0..1" type="string" ord="64">
<comment>
Optional device identifier, that provides a consistent multi-transaction identifier
for a device or equivalent (e.g. service identifier) providing the data. Any errors or issues resulting from processing the data will include this identifier
in the system logs, providing traceability. Identifier should be unique.
</comment>
</elem>
<elem name="etid" multiplicity="0..1" type="string" ord="65">
<comment>
Optional external transaction identifier for the caller to uniquely identify and track
the transaction and corresponding results. These identifiers will appear in the
service logs for traceability analysis. The format of the transaction identifier is up to the caller
and can be anything: e.g. [uuid], [id1.subid0], [numerical], etc. This data is never interpreted by
the service.
</comment>
</elem>
<elem name="directive" multiplicity="0..*" type="NameValue" ord="66">
<comment>
A set of directives to influence processing.
</comment>
</elem>
</struct>
<!--
*******************************
*OutputBase Type Definition
*******************************
-->
<struct name="OutputBase" >
<comment>Base output fields common to operations supporting asynchronous returning transaction information.</comment>
<elem name="devid" multiplicity="0..1" type="string" ord="64">
<comment>
Device identifier provided at operation input, provides a consistent identifier
for a device or equivalent (e.g. service identifier) providing the data. Any errors or issues resulting from processing the data will include this identifier
in the service logs, providing traceability.
</comment>
</elem>
<elem name="etid" multiplicity="0..1" type="string" ord="65">
<comment>
Optional external transaction identifier for the caller to uniquely identify and track
the transaction and corresponding results. These identifiers appear in the
ILP system logs for traceability analysis. The format of the transaction identifier is up to the caller
and can be anything: e.g. [uuid], [id1.subid0], [numerical], etc. This data is never interpreted by
the ILP system.
</comment>
</elem>
<elem name="resultcode" type="ResultCode" multiplicity="1" ord="66">
<comment>Result of the operation.</comment>
</elem>
<elem name="errinfo" type="Tensor.string" multiplicity="0..1" ord="67">
<comment>Error information if result was not success.</comment>
</elem>
</struct>
</namespace>
</specification>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2017, TeleCommunication Systems, Inc.,
a wholly-owned subsidiary of Comtech Telecommunications Corp.
and/or affiliates of TeleCommunication Systems, Inc.
All rights reserved.
TeleCommunication Systems, Inc. PROPRIETARY/CONFIDENTIAL.
Use is subject to license terms included in the distribution.
-->
<specification xmlns="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
xmlns:xid="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
identity="Command.xid.xml">
<title>Tensor Command</title>
<comment></comment>
<artifact></artifact>
<import ref="https://xid.location.studio/Tensor/V1.1/Common.xid.xml" local="Common.xid.xml" />
<namespace name="Tensor">
<!--
************************************
* Command API Implementation
************************************
-->
<struct name="Command">
<comment>A TPF command structure compatible with the TPF Framework Commander Component.</comment>
<elem name="name" type="Tensor.string" multiplicity="1" ord="64">
<comment>The command name including scope specifiers. Convention is to use a '.' as a scope separator
such as[component name].[command name].</comment>
</elem>
<elem name="etid" type="Tensor.string" multiplicity="0..1" ord="65">
<comment>
Optional external transaction identifier for the caller to uniquely identify and track
the command and corresponding results.
</comment>
</elem>
<elem name="argument" type="NameValue" multiplicity="0..*" ord="66">
<comment>
Each command may have zero or more arguments.
They may be name/value or oridinal/value arguments.
Both name and value are required.
</comment>
</elem>
</struct>
<struct name="CommandResponse">
<comment>
The command response structure containing information resulting from executing the
command (success or failure). Check the result code for details on status of executing the
command a value of 1 means success, value of 0 is undefined, See ResultCode for other standard
result codes. Each operation may define additional codes.
</comment>
<elem name="name" type="Tensor.string" multiplicity="1" ord="64">
<comment>
The command name including scope specifiers. Convention is to use a '.' as a scope separator
such as[component name].[command name].
</comment>
</elem>
<elem name="etid" type="Tensor.string" multiplicity="0..1" ord="65">
<comment>
Optional external transaction identifier for the caller to uniquely identify and track
the command and corresponding results.
</comment>
</elem>
<elem name="result" type="Tensor.int8" multiplicity="1" ord="66">
<comment>The processing result code. 1 is success, 0 is undefined, -1 is a failure.</comment>
</elem>
<elem name="output" type="Tensor.string" multiplicity="0..1" ord="67">
<comment>
Optional command output stored as a string. Interpeting the output data is dependent upon the
command function executed and what data formats are as an encodded string.
</comment>
</elem>
</struct>
<interface name="CommandApi">
<comment>Interface executing commands inside TPF Containers.</comment>
<operation name="Execute">
<comment>
Executes the specified command elements. Can specify whether to return responses (default true) or not using wantresponses.
</comment>
<input name="input" sid="0x0100">
<elem name="commands" multiplicity="1..*" type="Command" ord="64"/>
<elem name="wantresponses" multiplicity="1" type="Tensor.bool" ord="65" default="true"/>
</input>
<output name="output" sid="0x0101">
<elem name="lastcommand" type="Tensor.int8" multiplicity="1" ord="64">
<comment>The index of the last command executed. If this is less than the total number of commands a failure occurred.</comment>
</elem>
<elem name="lastresult" type="Tensor.int8" multiplicity="1" ord="65">
<comment>The last processing result code. 1 is success, 0 is undefined, -1 is a failure.</comment>
</elem>
<elem name="responses" type="CommandResponse" multiplicity="1..*" ord="66">
<comment>A command response for each command executed.</comment>
</elem>
</output>
</operation>
</interface>
</namespace>
</specification>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2017, TeleCommunication Systems, Inc.,
a wholly-owned subsidiary of Comtech Telecommunications Corp.
and/or affiliates of TeleCommunication Systems, Inc.
All rights reserved.
TeleCommunication Systems, Inc. PROPRIETARY/CONFIDENTIAL.
Use is subject to license terms included in the distribution.
-->
<specification xmlns="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
xmlns:xid="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
identity="Common.xid.xml">
<title>Tensor Common Definitions</title>
<comment></comment>
<artifact></artifact>
<import ref="https://xid.location.studio/Tensor/V1.1/Definitions.xid.xml" local="Definitions.xid.xml" />
<namespace name="Tensor">
<struct name="NameValue" >
<comment>A string base name value pair entry.</comment>
<elem name="name" type="Tensor.string" ord="64"/>
<elem name="value" type="Tensor.string" ord="65"/>
</struct>
<enum name="ResultCode" type="Tensor.int8" default="undefined">
<comment>General processing result codes.</comment>
<literal name="success" value="1"/>
<literal name="undefined" value="0"/>
<literal name="failure" value="-1" />
<literal name="busy" value="-2" />
<literal name="processingError" value="-3"/>
<literal name="parsingError" value="-4"/>
<literal name="malformedRequest" value="-5"/>
<literal name="encodingError" value="-6"/>
</enum>
<struct name="VoidType">
<comment>Reserved type used in various translations to preserve translation. It has no purpose but as a placeholder. This is different from type "void" in Definitions.xid</comment>
<elem name="reserved" type="Tensor.uint16" multiplicity="1" ord="64"/>
</struct>
<enum name="WirelineFormat" type="Tensor.uint8" default="undefined">
<comment>Enum defines the wireline data format of XID interactions. These are defined to facilitate standard definitions within XID interactions independent of the
specific transport protocol or XID conduit.</comment>
<literal name ="undefined" value = "0"/>
<literal name ="raw" value = "1"/>
<literal name ="base64" value = "2"/>
<literal name ="hex" value = "3"/>
</enum>
<enum name="ContentType" type="Tensor.uint8" default="undefined">
<comment>Enum defines the content type of XID interactions. These are defined to facilitate standard definitions within XID interactions independent of the
specific transport protocol or XID conduit.</comment>
<literal name ="undefined" value = "0"/>
<literal name ="dataobject" value = "1"/>
<literal name ="xmf" value = "2"/>
<literal name ="json" value = "3"/>
</enum>
<enum name="InteractionRole" type="Tensor.uint8" default="undefined">
<comment>InteractionRole defines the role of the conduit in a XID interaction.
A Conduit port must adopt either the target or initiator role to preserve
interaction continuity and conventions.</comment>
<literal name ="undefined" value = "0"/>
<literal name ="target" value = "1"/>
<literal name ="initiator" value = "2"/>
</enum>
</namespace>
</specification>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2017, TeleCommunication Systems, Inc.,
a wholly-owned subsidiary of Comtech Telecommunications Corp.
and/or affiliates of TeleCommunication Systems, Inc.
All rights reserved.
TeleCommunication Systems, Inc. PROPRIETARY/CONFIDENTIAL.
Use is subject to license terms included in the distribution.
-->
<specification xmlns="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
xmlns:xid="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
identity="Definitions.xid.xml">
<title>Tensor Defitions</title>
<comment>
Defines fundamental type mappings.
</comment>
<tag name="package" value="com.comtechtel"/>
<namespace name="Tensor">
<type name="void" size="0">
<comment>represents nothing. &lt;br/&gt;Useful in &lt;operation&gt; with no &lt;input&gt;</comment>
<lang name="c" type="void"/>
<lang name="cpp" type="void"/>
<lang name="java" type="void"/>
<lang name="node" type="void"/>
</type>
<type name="bool" size="1">
<comment>represents true/false</comment>
<lang name="c" type="bool" include="stdbool.h"/>
<lang name="cpp" type="bool"/>
<lang name="java" type="XidBool" include="com.comtechtel.tensor.xid.XidBool"/>
<lang name="node" type="XidBool"/>
</type>
<type name="uint8" size="1">
<comment>8-bit, unsigned value</comment>
<lang name="c" type="uint8_t" include="stdint.h"/>
<lang name="cpp" type="uint8_t" include="cstdint"/>
<lang name="java" type="XidByte" include="com.comtechtel.tensor.xid.XidByte" />
<lang name="node" type="XidUInt8"/>
</type>
<type name="uint16" size="2">
<comment>16-bit, unsigned value</comment>
<lang name="c" type="uint16_t" include="stdint.h"/>
<lang name="cpp" type="uint16_t" include="cstdint"/>
<lang name="java" type="XidShort" include="com.comtechtel.tensor.xid.XidShort"/>
<lang name="node" type="XidUShort"/>
</type>
<type name="uint24" size="3">
<comment>24-bit, unsigned value</comment>
<lang name="c" type="uint24_t" include="Tensor/CXMF/int24.h"/>
<lang name="cpp" type="uint24_t" include="Tensor/Types/int24.h"/>
<lang name="java" type="XidInt24" include="com.comtechtel.tensor.xid.XidInt24"/>
<lang name="node" type="XidUInt24"/>
</type>
<type name="uint32" size="4">
<comment>32-bit, unsigned value</comment>
<lang name="c" type="uint32_t" include="stdint.h"/>
<lang name="cpp" type="uint32_t" include="cstdint"/>
<lang name="java" type="XidInt" include="com.comtechtel.tensor.xid.XidInt"/>
<lang name="node" type="XidUInt"/>
</type>
<type name="uint64" size="8">
<comment>64-bit, unsigned value</comment>
<lang name="c" type="uint64_t" include="stdint.h"/>
<lang name="cpp" type="uint64_t" include="cstdint"/>
<lang name="java" type="XidLong" include="com.comtechtel.tensor.xid.XidLong"/>
<lang name="node" type="XidULong"/>
</type>
<type name="int8" size="1">
<comment>8-bit, signed value</comment>
<lang name="c" type="int8_t" include="stdint.h"/>
<lang name="cpp" type="int8_t" include="cstdint"/>
<lang name="java" type="XidByte" include="com.comtechtel.tensor.xid.XidByte"/>
<lang name="node" type="XidInt8"/>
</type>
<type name="int16" size="2">
<comment>16-bit, signed value</comment>
<lang name="c" type="int16_t" include="stdint.h"/>
<lang name="cpp" type="int16_t" include="cstdint"/>
<lang name="java" type="XidShort" include="com.comtechtel.tensor.xid.XidShort" />
<lang name="node" type="XidShort"/>
</type>
<type name="int24" size="3">
<comment>24-bit, unsigned value</comment>
<lang name="c" type="int24_t" include="Tensor/CXMF/int24.h"/>
<lang name="cpp" type="int24_t" include="Tensor/Types/int24.h"/>
<lang name="java" type="XidInt24" include="com.comtechtel.tensor.xid.XidInt24"/>
<lang name="node" type="XidInt24"/>
</type>
<type name="int32" size="4">
<comment>32-bit, signed value</comment>
<lang name="c" type="int32_t" include="stdint.h"/>
<lang name="cpp" type="int32_t" include="cstdint"/>
<lang name="java" type="XidInt" include="com.comtechtel.tensor.xid.XidInt"/>
<lang name="node" type="XidInt"/>
</type>
<type name="int64" size="8">
<comment>64-bit, signed value</comment>
<lang name="c" type="int64_t" include="stdint.h"/>
<lang name="cpp" type="int64_t" include="cstdint"/>
<lang name="java" type="XidLong" include="com.comtechtel.tensor.xid.XidLong"/>
<lang name="node" type="XidLong"/>
</type>
<!--
<type name="float16" size="4">
<comment>32-bit, IEEE 754 binary16</comment>
<comment>C/cpp usually a "float"</comment>
<artifact>https://wikipedia.org/wiki/Half-precision_floating-point_format</artifact>
</type>
-->
<type name="float32" size="4">
<comment>32-bit, IEEE 754 binary32</comment>
<artifact>https://wikipedia.org/wiki/Single-precision_floating-point_format</artifact>
<lang name="c" type="float"/>
<lang name="cpp" type="float"/>
<lang name="java" type="XidFloat" include="com.comtechtel.tensor.xid.XidFloat"/>
<lang name="node" type="XidFloat"/>
</type>
<type name="float64" size="8">
<comment>64-bit, IEEE 754 binary64</comment>
<artifact>https://wikipedia.org/wiki/Double-precision_floating-point_format</artifact>
<lang name="c" type="double"/>
<lang name="cpp" type="double"/>
<lang name="java" type="XidDouble" include="com.comtechtel.tensor.xid.XidDouble"/>
<lang name="node" type="XidDouble"/>
</type>
<!--
<type name="float128" size="8">
<comment>128-bit, IEEE 754 binary128</comment>
<artifact>https://wikipedia.org/wiki/Quadruple-precision_floating-point_format</artifact>
<lang name="cpp" type="long double"/>
</type>
-->
<type name="byte" size="1">
<comment>A single byte</comment>
<lang name="c" type="uint8_t" include="stdint.h"/>
<lang name="cpp" type="uint8_t" include="cstdint"/>
<lang name="java" type="XidByte" include="com.comtechtel.tensor.xid.XidByte"/>
<lang name="node" type="XidUInt8"/>
</type>
<type name="raw">
<comment>Variable sized collection of bytes</comment>
<!-- may change this type -->
<lang name="c" type="CXMFString" include="Tensor/CXMF/CXMFString.h"/>
<lang name="cpp" type="::Tensor::XMF::Atom" include="Tensor/XMF/Atom.h"/>
<lang name="java" type="Atom" include="com.comtechtel.tensor.xmf.Atom"/>
<lang name="node" type="Atom"/>
</type>
<type name="string">
<comment>Variable sized collection of characters</comment>
<lang name="c" type="CXMFString" include="Tensor/CXMF/CXMFString.h"/>
<lang name="cpp" type="std::string" include="string"/>
<lang name="java" type="XidString" include="com.comtechtel.tensor.xid.XidString"/>
<lang name="node" type="XidString"/>
</type>
<type name="datetime" size="8">
<comment>
nanoseconds since Jan 1, 1970 UTC.
ISO-8601 for string formats (e.g. JSON).
</comment>
<artifact>https://www.iso.org/standard/40874.html</artifact>
<artifact>https://wikipedia.org/wiki/ISO_8601</artifact>
<artifact>https://xkcd.com/1179</artifact>
<lang name="c" type="uint64_t" include="stdint.h"/>
<lang name="cpp" type="::Tensor::Types::DateTime" include="Tensor/Types/DateTime.h"/>
<lang name="java" type="XidDateTime" include="com.comtechtel.tensor.xid.XidDateTime"/>
<lang name="node" type="XidDateTime"/>
</type>
<type name="UUID" size="16">
<comment>16 byte UUID.</comment>
<artifact>https://wikipedia.org/wiki/Universally_unique_identifier</artifact>
<lang name="c" type="UUID" include="Tensor/CXMF/uuid.h"/>
<lang name="cpp" type="::Tensor::Types::UUID" include="Tensor/Types/uuid.h"/>
<lang name="java" type="XidUuid" include="com.comtechtel.tensor.xid.XidUuid"/>
<lang name="node" type="XidUuid"/>
</type>
<type name="uri">
<comment>Standard Universal Resource Identifier (URI)</comment>
<tag name="TODO" value="Define uri as a custom type. Use string for now."/>
<lang name="c" type="CXMFString" include="Tensor/CXMF/CXMFString.h"/>
<lang name="cpp" type="std::string" include="string"/>
<lang name="java" type="XidString" include="com.comtechtel.tensor.xid.XidString"/>
<lang name="node" type="XidString"/>
</type>
<type name="json">
<comment>JSON formatted/encoded string</comment>
<lang name="c" type="CXMFString" include="Tensor/CXMF/CXMFString.h"/>
<lang name="cpp" type="::Tensor::JSON::JSONObj" include="Tensor/JSON/TensorJSON.h"/>
<lang name="java" type="XidString" include="com.comtechtel.tensor.xid.XidString"/>
<lang name="node" type="XidString"/>
</type>
<type name="xmf">
<comment>XMF formatted/encoded data, this is straight XMF in XMF formatted data, and base64 encoded binary XMF in JSON formatted data. </comment>
<lang name="c" type="CAtom" include="Tensor/CXMF/GetPut.h"/>
<lang name="cpp" type="::Tensor::XMF::Atom" include="Tensor/XMF/Atom.h"/>
<lang name="java" type="Atom" include="com.comtechtel.tensor.xmf.Atom"/>
<lang name="node" type="Atom"/>
</type>
<type name="mac48" size="6">
<artifact>https://wikipedia.org/wiki/MAC_address</artifact>
<comment>6 byte IEEE MAC-48</comment>
<lang name="c" type="MacAddress48" include="Tensor/CXMF/MacAddress48.h"/>
<lang name="cpp" type="::Tensor::Types::MacAddress48" include="Tensor/Types/MacAddress48.h"/>
<lang name="java" type="XidMacAddress48" include="com.comtechtel.tensor.xid.XidMacAddress48"/>
<lang name="node" type="XidMacAddress48"/>
</type>
<!--
*******************************************************
Encoding Data Types
*******************************************************
-->
<!-- Encoding format type spec.-->
<type name="EncodingFormat" size="2">
<comment>
The encoding format determines how element data is run-time encoded within a particular element independent of the
transport encoding.
These values are specified in the "encoding" attribute for elements. Not all encoding formats
are supported by every wireline protocol implementation. Additionally, custom encodings may be
defined to support application defined encodings. Any non-standard encodings must be registered (to avoid collision)
and approved by the appropriate approving authority (e.g. Comtech). Values from 0 to 255 are reserved
for standard-encodings. Custom encodings start at 256(0x0100) and extend to 65535 (0xFFFF).\n
\n
This is not the same as defining in XID a raw datatype or json datatype which are NOT changeable are run-time.
\n
Example: \n
\t The message XMF but a field is defined to be encoded as JSON.\n
\t Likewise, the message is JSON, but a field is run-time encoded to be XMF.\n
\n
Data encoding format type. If 0, value is not encoded. See ResrvedEncodingFormats
for a list of standard format specifiers.
</comment>
<lang name="c" type="uint16_t" include="stdint.h" />
<lang name="cpp" type="uint16_t" include="cstdint" />
<lang name="java" type="XidShort" include="com.comtechtel.tensor.xid.XidShort" />
<lang name="node" type="XidUShort" />
</type>
<!-- ReservedEncodingFormats standard encoding formats.-->
<enum name="ReservedEncodingFormats" type="Tensor.uint16" default="natural">
<comment>
Reserved encoding formats define standard additional encodings known to all implementations.
</comment>
<literal name="natural" value="0">
<comment>
Data is not further encoded, it is in its natural wireline format.\n
This is the default value if not defined explicitly.
</comment>
</literal>
<literal name="raw" value="1">
<comment>
Data is in an unspecified binary format. The interpretation of the data is
falls to the producer and consumer of the information.
For textual wireline encodings like JSON, the data will be valid within the representation.
</comment>
</literal>
<literal name="xmf" value="2">
<comment>
Data is XMF binary format. The binary data is structured using atoms and atom lists.
For textual wireline encodings like JSON, this is XMF base64 encoded.
</comment>
</literal>
<literal name="json" value="3">
<comment>
Data is formatted as JSON compliant ascii text. For binary encodings like XMF, the content will be JSON instead.
</comment>
</literal>
</enum>
</namespace>
</specification>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2017, TeleCommunication Systems, Inc.,
a wholly-owned subsidiary of Comtech Telecommunications Corp.
and/or affiliates of TeleCommunication Systems, Inc.
All rights reserved.
TeleCommunication Systems, Inc. PROPRIETARY/CONFIDENTIAL.
Use is subject to license terms included in the distribution.
-->
<specification xmlns="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
xmlns:xid="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd https://xid.location.studio/schema/V1.0.0/XtensibleInterfaceDefinition.xsd"
identity="Logging.xid.xml">
<title>Tensor Logging Messages</title>
<comment>
This file contains the base type definitions for logging messages and data. All ENT micro-service compliant systems shall support these datatypes
for capturing various types of logging information including actionable messages, trace, and usage data. Logging messages are polymorphic and extensible
as needed to support various types of information.
</comment>
<import ref="https://xid.location.studio/Tensor/V1.1/Common.xid.xml" local="Common.xid.xml" />
<namespace name="Logging">
<using namespace="Tensor"/>
<!--
*******************************************************
Enumeration Definitions
*******************************************************
-->
<enum name="MessageType" type="Tensor.uint8" default="undefined">
<comment>
Message types define the base type identifiers for logging messages. These are used to
identify the type of logging data. The Message type is not a closed set and can be extended as needed.
The types defined here are common to every system. Type values below 64 are reserved for the core logging extensions
Any non-core message types should define type identifiers greater than 64.
</comment>
<literal name="undefined" value="0">
<comment>Message type is not defined. This is a reserved value and should not be used in most situations.</comment>
</literal>
<literal name="ActionMsg" value="1">
<comment>Defines a message that requires some responsive action. See Tensor.Logging.ActionMsg structure for more information.</comment>
</literal>
<literal name="TraceMsg" value="2">
<comment>Defines a message capturing software trace data typically used for debugging. See Tensor.Logging.TraceMsg structure for more information.</comment>
</literal>
<literal name="UsageMsg" value="3">
<comment>Defines a message for capturing usage data. See Tensor.Logging.UsageMsg for more information.</comment>
</literal>
<literal name="MetricMsg" value="4">
<comment>Defines a message for capturing metric data. See Tensor.Logging.MetricMsg for more information.</comment>
</literal>
</enum>
<enum name="Severity" type="int8" default="indeterminate">
<comment>
Severity is defined as part of an Tensor.Logging.ActionMsg describing the severity of the issue. This is an extensible list that can be added to as
new severities are determine. In general, try to use the core defined severities or add new core ones as needed. Custom severity should be avoided. If defined,
however, start with values > 64. Values less than 64 are reserved.
</comment>
<literal name="indeterminate" value="0">
<comment>Severity of the issue is indeterminate.</comment>
</literal>
<literal name="warning" value="1">
<comment>
Severity indicates message is a warning regarding the specified issue. Warnings describe a potental issue that
may require additional monitoring over time. However, it is not deemed as having a significant
impaction on system operation.
</comment>
</literal>
<literal name="minor" value="2">
<comment>
Message is describing a minor issue, which requires some action. A
minor issue is something that does not have a wide scale impact on system operation.
For example a minor issue might be something that would affect a single transaction.
</comment>
</literal>
<literal name="major" value="3">
<comment>
Message is describing a major issue, which requires action. A
major issue is something that affects the system in a signficant way
such as having impact on multiple transactions.
</comment>
</literal>
<literal name="critical" value="4">
<comment>
Message is describing a critical issue, which requires immediate action. Critical issues
are typically catastrophic system issues affecting all transactions in a very significant way.
</comment>
</literal>
<literal name="cleared" value="5">
<comment>Message is describing an issue has been resolved or no longer requires actions.</comment>
</literal>
</enum>
<enum name="Category" type="int8" default="processingError">
<comment>
The category decribes the general category for an ActionMsg. This is an extensible list that can be added to as
new categories are needed. In general, try to use the core defined categories or add new ones as needed. Custom categories should start with
values > 64. Values less than 64 are reserved.
</comment>
<literal name ="undefined" value ="0">
<comment>Action category is undefined or not known.</comment>
</literal>
<literal name="communications" value="1">
<comment>A communications and/or networking related issue.</comment>
</literal>
<literal name="qualityOfService" value="2">
<comment>A quality of service related issue.</comment>
</literal>
<literal name="processingError" value="3">
<comment>A processing or runtime related issue.</comment>
</literal>
<literal name="equipment" value="4">
<comment>An equipment related issue.</comment>
</literal>
<literal name="environmental" value="5">
<comment>A environment related issue.</comment>
</literal>
</enum>
<enum name="TraceLevel" type="Tensor.int8" default="undefined">
<comment>Trace level defines the level of tracing information reported. This allows for filtering of information based on rank.</comment>
<literal name="undefined" value="0">
<comment>Trace level is not defined.</comment>
</literal>
<literal name="overview" value="1">
<comment>Information contained in the trace message is high-level or summary.</comment>
</literal>
<literal name="trace" value="2">
<comment>Information contained in the trace message is related to program flow and sequencing.</comment>
</literal>
<literal name="detail" value="3">
<comment>Information contained in the trace message is detailed information.</comment>
</literal>
<literal name="debug" value="4">
<comment>Information contained in the trace message contains debugging information.</comment>
</literal>
</enum>
<struct name="DebugInfo">
<comment>
Structure captures the file and line number information for Trace Messages. This provides information about where the trace message was sent.
</comment>
<elem name="file" type="Tensor.string" multiplicity="1" ord="64">
<comment>File name where this message was logged.</comment>
</elem>
<elem name="line" type="Tensor.uint32" multiplicity="1" ord="65">
<comment>Line number in file where this message is logged.</comment>
</elem>
<elem name="thid" type="Tensor.uint64" multiplicity="1" default="0" ord="66">
<comment>Optional Thread ID, if not specified, default value is 0.</comment>
</elem>
</struct>
<!--
*******************************************************
Metric Structure Definitions
*******************************************************
-->
<enum name="MetricType" type="Tensor.uint8" default="undefined">
<literal name="undefined" value="0">
<comment>Metric type is not defined. This is a reserved value and should not be used in most situations.</comment>
</literal>
<literal name="PegCount" value="1">
<comment>Defines a simple monotonically incremented counter.</comment>
</literal>
<literal name="AppMetrics" value="2">
<comment>Defines a complex metric measuring duration and concurrency.</comment>
</literal>
</enum>
<struct name="Metric">
<elem name="metricType" type="MetricType" multiplicity="1" rttd="true" ord="64">
<comment>This specifies the type of the reported metric.</comment>
</elem>
<elem name="name" type="string" multiplicity="1" ord="65">
<comment>Name of the reported metric.</comment>
</elem>
</struct>
<struct name="PegCount" type="Metric" rttkey="Logging.MetricType.PegCount">
<elem name="value" type="uint32" multiplicity="1" ord="80">
<comment>Value of peg count since last reporting.</comment>
</elem>
</struct>
<struct name="AppMetrics" type="Metric" rttkey="Logging.MetricType.AppMetrics">
<elem name="totalCount" type="uint32" multiplicity="1" ord="80">
<comment>Total count of invocations since last reporting.</comment>
</elem>
<elem name="currentCount" type="uint32" multiplicity="1" ord="81">
<comment>concurrent invocations at time of reporting.</comment>
</elem>
<elem name="peakCount" type="uint32" multiplicity="1" ord="82">
<comment>Peak concurrent invocations since last reporting.</comment>
</elem>
<elem name="totalTime" type="uint64" multiplicity="1" ord="83">
<comment>Total time spent on invocations in nanoseconds since last reporting.</comment>
</elem>
<elem name="peakTime" type="uint64" multiplicity="1" ord="84">
<comment>Peak time for an invocation in nanoseconds since last reporting.</comment>
</elem>
<elem name="successCount" type="uint32" multiplicity="1" ord="85">
<comment>Count of successful invocations since last reporting.</comment>
</elem>
<elem name="failureCount" type="uint32" multiplicity="1" ord="86">
<comment>Count of failed invocations since last reporting.</comment>
</elem>
</struct>
<!--
*******************************************************
Message Structure Definitions
*******************************************************
-->
<struct name="MessageBase">
<comment>
Base type for all messages. This contains only the polymorphic type data. The structure Message derives from this
structure and provides common fields typically useful in logging related applications. Derive from this structure
if messages are related to logging but do not require the standard fields. It is recommended that most specializations
should start with Message as the base type.
</comment>
<elem name="type" type="MessageType" multiplicity="1" rttd="true" ord="64">
<comment> This specifies the type of message.</comment>
</elem>
<elem name="date" type="datetime" multiplicity="1" ord="65">
<comment>The date/time the message occured.</comment>
</elem>
<elem name="source" type="Tensor.uri" multiplicity="1" ord="66">
<comment>URI Identifying name of the component or process logging the message.</comment>
</elem>
<elem name="info" type="string" multiplicity="0..1" ord="67">
<comment>Optional free form string data.</comment>
</elem>
<elem name="data" type="Tensor.json" multiplicity="0..1" ord="68">
<comment>Optional structured data.</comment>
</elem>
<elem name="debug" type="DebugInfo" multiplicity="0..1" ord="69">
<comment>Optional debug information for message.</comment>
</elem>
</struct>
<!-- Message type -->
<struct name="TransactionMsg" type="MessageBase">
<comment>
Basic logging message data common to all types of logging. This specializes MessageBase and is the standard logging message. Create custom message types as needed; however, consider
specializing from the core defined sub-types of ActionMsg, Trace, or Usage depending upon need. In most cases, you should not use this message directly.
</comment>
<elem name="tid" type="Tensor.UUID" multiplicity="1" ord="80">
<comment>Unique ID identifying the internal transaction related to the message.</comment>
</elem>
<elem name="etid" type="string" multiplicity="0..1" ord="81">
<comment>Optional externally defined transaction ID.</comment>
</elem>
<elem name="acctid" type="string" multiplicity="0..1" ord="82">
<comment>Optional externally defined account/group identifier.</comment>
</elem>
<elem name="devid" type="string" multiplicity="0..1" ord="83">
<comment>Optional externally defined device identifier.</comment>
</elem>
<elem name="appid" type="string" multiplicity="0..1" ord="84">
<comment>Optional externally defined application (or application key) identifier.</comment>
</elem>
</struct>
<!-- ActionMsg type -->
<struct name="ActionMsg" type="TransactionMsg" rttkey="Logging.MessageType.ActionMsg">
<comment>
A message that requires another system/user to respond with some action.
</comment>
<elem name="id" type="Tensor.uri" multiplicity="1" ord="96">
<comment>Error code identifying the fault type</comment>
</elem>
<elem name="severity" type="Severity" multiplicity="1" ord="97"/>
<elem name="category" type="Category" multiplicity="1" ord="98"/>
<elem name="iid" type="Tensor.uri" multiplicity="0..1" ord="99">
<comment>Optional incident identifier used to identify an action instance uniquely. This is needed when there are stateful clearing events.</comment>
</elem>
</struct>
<!-- TraceMsg type -->
<struct name="TraceMsg" type="TransactionMsg" rttkey="Logging.MessageType.TraceMsg">
<comment>
Trace message for general logging and reporting of information
</comment>
<elem name="level" type="TraceLevel" multiplicity="1" ord="96">
<comment>Indicates the level of the trace: overview is the highest level and debug is the lowest</comment>
</elem>
</struct>
<!-- UsageMsg type -->
<struct name="UsageMsg" type="TransactionMsg" rttkey="Logging.MessageType.UsageMsg">
<comment>
Message capturing usage information for reporting statistical, transactional, edge, location, or other useful information generated in the normal
operation of the system.
</comment>
<elem name="uri" type="Tensor.uri" multiplicity="1" rttd="true" ord="96">
<comment> Usage id specific to a type of usage information. Can be general or application specific.</comment>
</elem>
</struct>
<!-- MetricMsg type -->
<struct name="MetricMsg" type="MessageBase" rttkey="Logging.MessageType.MetricMsg">
<elem name="start" type="datetime" multiplicity="1" ord="80">
<comment>The date/time of the start of the report interval. date is end the end of the report interval.</comment>
</elem>
<elem name="duration" type="uint16" multiplicity="1" ord="81">
<tag name="unit" value="sec"/>
<comment>The interval in seconds for the metric report.</comment>
</elem>
<elem name="metrics" type="Metric" multiplicity="1..*" polymorphic="true" ord="82">
<comment>List of metrics being reported.</comment>
</elem>
</struct>
<!--
*******************************************************
Standard Usage Definitions
*******************************************************
-->
<!--TaskReport Msg-->
<struct name="TaskReport" type="Logging.UsageMsg" rttkey='"tpf://taskrpt"'>
<comment>
Message reports processing task result data. Tasks are any execution unit the
that is deemed to have a specific beginning and end. This is a fairly generic
definition making the usage report suitable for a variety of applications.
</comment>
<elem name="taskid" type="string" multiplicity="1" ord="112">
<comment>
The unique tasks identifier. A source may have multiple tasks, this field assigns
an identifier that uniquely characterizes what the task was that was accomplished.
</comment>
</elem>
<elem name="start" type="datetime" multiplicity="1" ord="113">
<comment>
The start time at which the processor is used.
</comment>
</elem>
<elem name="duration" type="uint32" multiplicity="1" ord="114">
<tag name="unit" value="usec"/>
<comment>
The duration of the processing in microseconds.
</comment>
</elem>
<elem name="result" type="ResultCode" multiplicity="1" ord="115">
<comment>The task result code.</comment>
</elem>
</struct>
</namespace>
</specification>
# Tensor XIDs #
Tensor XIDs have all their ordinals (i.e. tags) specified and do not use packed data types. Therefore, XIDData.prop is not strictly needed but is supplied as a check-n-balance.
## Generate / Verify XIDData.prop ##
~~~sh
$ java -Xnoclassgc -jar $XIDSDK/bin/xidcg.jar \
-v \
-prop https://xid.location.studio/Tensor/V1.1/XIDData.prop \
https://xid.location.studio/Tensor/V1.1/ApiBase.xid.xml \
https://xid.location.studio/Tensor/V1.1/Command.xid.xml \
https://xid.location.studio/Tensor/V1.1/Common.xid.xml \
https://xid.location.studio/Tensor/V1.1/Definitions.xid.xml \
https://xid.location.studio/Tensor/V1.1/Logging.xid.xml
OR
$ java -Xnoclassgc -jar $XIDSDK/bin/xidcg.jar \
-v \
-prop XIDData.prop \
ApiBase.xid.xml \
Command.xid.xml \
Common.xid.xml \
Definitions.xid.xml \
Logging.xid.xml
~~~
If xidcg reports:
~~~
Generating: xidout/meta/XID/XIDData.prop
~~~
Then something has changed and XIDData.prop needs to get updated.
Ord.Logging.ActionMsg.category=98
Ord.Logging.ActionMsg.id=96
Ord.Logging.ActionMsg.iid=99
Ord.Logging.ActionMsg.severity=97
Ord.Logging.AppMetrics.currentCount=81
Ord.Logging.AppMetrics.failureCount=86
Ord.Logging.AppMetrics.peakCount=82
Ord.Logging.AppMetrics.peakTime=84
Ord.Logging.AppMetrics.successCount=85
Ord.Logging.AppMetrics.totalCount=80
Ord.Logging.AppMetrics.totalTime=83
Ord.Logging.DebugInfo.file=64
Ord.Logging.DebugInfo.line=65
Ord.Logging.DebugInfo.thid=66
Ord.Logging.MessageBase.data=68
Ord.Logging.MessageBase.date=65
Ord.Logging.MessageBase.debug=69
Ord.Logging.MessageBase.info=67
Ord.Logging.MessageBase.source=66
Ord.Logging.MessageBase.type=64
Ord.Logging.Metric.metricType=64
Ord.Logging.Metric.name=65
Ord.Logging.MetricMsg.duration=81
Ord.Logging.MetricMsg.metrics=82
Ord.Logging.MetricMsg.start=80
Ord.Logging.PegCount.value=80
Ord.Logging.TaskReport.duration=114
Ord.Logging.TaskReport.start=113
Ord.Logging.TaskReport.result=115
Ord.Logging.TaskReport.taskid=112
Ord.Logging.TraceMsg.level=96
Ord.Logging.TransactionMsg.acctid=82
Ord.Logging.TransactionMsg.appid=84
Ord.Logging.TransactionMsg.devid=83
Ord.Logging.TransactionMsg.etid=81
Ord.Logging.TransactionMsg.tid=80
Ord.Logging.UsageMsg.uri=96
Ord.Tensor.Command.argument=66
Ord.Tensor.Command.etid=65
Ord.Tensor.Command.name=64
Ord.Tensor.CommandApi.Execute.Input.commands=64
Ord.Tensor.CommandApi.Execute.Input.wantresponses=65
Ord.Tensor.CommandApi.Execute.Output.lastcommand=64
Ord.Tensor.CommandApi.Execute.Output.lastresult=65
Ord.Tensor.CommandApi.Execute.Output.responses=66
Ord.Tensor.CommandResponse.etid=65
Ord.Tensor.CommandResponse.name=64
Ord.Tensor.CommandResponse.output=67
Ord.Tensor.CommandResponse.result=66
Ord.Tensor.InputBase.devid=64
Ord.Tensor.InputBase.directive=66
Ord.Tensor.InputBase.etid=65
Ord.Tensor.NameValue.name=64
Ord.Tensor.NameValue.value=65
Ord.Tensor.OutputBase.devid=64
Ord.Tensor.OutputBase.errinfo=67
Ord.Tensor.OutputBase.etid=65
Ord.Tensor.OutputBase.resultcode=66
Ord.Tensor.VoidType.reserved=64
SID.Tensor.CommandApi.Execute.Input=256
SID.Tensor.CommandApi.Execute.Output=257
Size.Logging.ActionMsg=-1
Size.Logging.AppMetrics=-1
Size.Logging.DebugInfo=-1
Size.Logging.MessageBase=-1
Size.Logging.Metric=-1
Size.Logging.MetricMsg=-1
Size.Logging.PegCount=-1
Size.Logging.TaskReport=-1
Size.Logging.TraceMsg=-1
Size.Logging.TransactionMsg=-1
Size.Logging.UsageMsg=-1
Size.Tensor.Command=-1
Size.Tensor.CommandApi.Execute.Input=-1
Size.Tensor.CommandApi.Execute.Output=-1
Size.Tensor.CommandResponse=-1
Size.Tensor.InputBase=-1
Size.Tensor.NameValue=-1
Size.Tensor.OutputBase=-1
Size.Tensor.VoidType=-1
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!