|
Xentara WebSocket API Specification v2.1.1
User Manual
|
| OpCode | Name | Description |
|---|---|---|
| 2 | meta_data | Gets the metadata for a Xentara Element. |
The parameter object outlined in request packet for this command includes:
| ID | Name | Optional | Description |
|---|---|---|---|
| 0 | element_uuid | no | A UUID specifying the UUID of the Xentara Element. |
| 1 | identifiers | no | An array of integers containing values from the metadata identifiers. |
The response item outlined in response packet for this command includes:
| Name | Type | Description |
|---|---|---|
| Metadata | Object | An object containing the metadata of the Xentara Element (see below). |
The metadata object contains the requested metadata identifiers as keys, paired with their respective values. For the attribute list identifier (key 2), the value is an array containing attribute metadata objects. The detailed definition of these objects is provided below:
| ID | Name | Description |
|---|---|---|
| 0 | attribute_name | A string specifying the name of the Xentara attribute. |
| 1 | attribute_id | A value consisting of integer from the attribute identifier or the attribute UUID. |
| 2 | attribute_access | An integer indicating the attribute's access level, as defined by the access identifier. |
| 3 | attribute_data_type | An integer indicating the attribute's data type, as defined by the data type identifier. |
If an error occurs, the response will include an error packet with detailed error information.
Below is the list of the potential errors that may be encountered with this command. Further details regarding errors in the Xentara WebSocket interface can be accessed here.
| Sr. No. | Error Code | Error Description |
|---|---|---|
| 1 | -32700 | Parse Error |
| 2 | -32603 | Internal Error |
| 3 | -32602 | Invalid Parameter |
| 4 | -32600 | Invalid Request |
| 5 | -32000 | Missing Client Hello Request |
| 6 | -32100 | Unknown Element |
Below is an example for the request to get the metadata of a Xentara element with the UUID "e3ee1071-4d88-4ba1-8e5d-0f1e4ce25ee8". This example makes the request for primary key, category, attribute list, and a flag indicating whether the requested Xentara Element has children, using the relevant metadata identifiers. The message id 65 is an arbitrary number assigned for this particular request.
[
0, # Request Packet
65, # Message Id
2, # Metadata OpCode
{ # Metadata Object
0: 37(h'E3EE10714D884BA18E5D0F1E4CE25EE8'), # Xentara Element UUID
1: [0,1,2,3] # Array of Metadata identifiers
}
]
Below is an example of the successful response to the aforementioned request. It indicates a package type of 1, signifying a successful response. The provided message id is intended for matching with the corresponding request. Furthermore, the response includes an object containing the primary key, element category identifier, an array of attribute metadata objects, and a flag indicating whether the requested Xentara element has children.
[
1, # Packet Type - Success Response
65, # Message Id
{ # Metadata Response Object
0: "Group 1.Data Point 1", # Primary Key of Xentara Element
1: 2, # Category Type of Xentara Element
2: [ # Array of Attribute Metadata of the Element
{0: "type", 1: 3, 2: 0, 3: 11},
{0: "category", 1: 4, 2: 0, 3: 19},
{0: "name", 1: 1, 2: 0, 3: 11},
{0: "key", 1: 0, 2: 0, 3: 11},
{0: "UUID", 1: 2, 2: 0, 3: 17},
{0: "value", 1: 11, 2: 2, 3: 0},
{0: "quality", 1: 9, 2: 0, 3: 18},
{0: "updateTime", 1: 6, 2: 0, 3: 16},
{0: "changeTime", 1: 7, 2: 0, 3: 16},
{0: "writeTime", 1: 8, 2: 0, 3: 16}
],
3: false # Flag for indicating if the requested Element has children
}
]