lordgamez commented on code in PR #2265:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2265#discussion_r4588465011
##########
extensions/opc/tests/OpcUaTestServer.h:
##########
@@ -136,17 +223,171 @@ class OpcUaTestServer {
}
private:
- UA_NodeId addObject(const char *name, UA_NodeId parent) {
+ static std::string nodeIdToString(const UA_NodeId& id) {
+ if (id.identifierType == UA_NODEIDTYPE_STRING) {
+ return std::string(reinterpret_cast<const
char*>(id.identifier.string.data), id.identifier.string.length);
+ } else if (id.identifierType == UA_NODEIDTYPE_NUMERIC) {
+ return std::to_string(id.identifier.numeric);
+ } else if (id.identifierType == UA_NODEIDTYPE_GUID) {
+ char guid_str[37];
+ snprintf(guid_str,
+ sizeof(guid_str),
+ "%08x-%04x-%04x-%04x-%012" PRIx64,
+ id.identifier.guid.data1,
+ id.identifier.guid.data2,
+ id.identifier.guid.data3,
+ (id.identifier.guid.data4[0] << 8) | id.identifier.guid.data4[1],
+ (gsl::narrow<uint64_t>(id.identifier.guid.data4[2]) << 40) |
(gsl::narrow<uint64_t>(id.identifier.guid.data4[3]) << 32) |
+ (gsl::narrow<uint64_t>(id.identifier.guid.data4[4]) << 24) |
(gsl::narrow<uint64_t>(id.identifier.guid.data4[5]) << 16) |
+ (gsl::narrow<uint64_t>(id.identifier.guid.data4[6]) << 8) |
gsl::narrow<uint64_t>(id.identifier.guid.data4[7]));
Review Comment:
Good point, but there is a `UA_Guid_print` function available which seems to
be cleaner, updated it in
https://github.com/apache/nifi-minifi-cpp/pull/2265/commits/f9c277f97a2cf469a5c3cd057dc1d09af57e18d7
##########
PROCESSORS.md:
##########
@@ -1089,6 +1090,53 @@ In the list below, the names of required properties
appear in bold. Any other pr
| failure | An error occurred processing |
+## FetchOPCHistory
+
+### Description
+
+Fetches OPC-UA node history between the start and end timestamps. A history
entry is only fetched once, on every trigger only the not yet fetched entries
are returned.
+
+### Properties
+
+In the list below, the names of required properties appear in bold. Any other
properties (not in bold) are considered optional. The table also indicates any
default values, and whether a property supports the NiFi Expression Language.
+
+| Name | Default Value | Allowable Values
| Description
|
+|---------------------------------|---------------|----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **OPC server endpoint** | |
| Specifies the address, port and relative path of an OPC endpoint
|
+| Application URI | |
| Application URI of the client in the format
'urn:unconfigured:application'. Mandatory, if using Secure Channel and must
match the URI included in the certificate's Subject Alternative Names.
|
+| Username | |
| Username to log in with.
|
+| Password | |
| Password to log in with.<br/>**Sensitive Property: true**
|
+| Certificate path | |
| Path to the DER-encoded cert file
|
+| Key path | |
| Path to the DER-encoded key file
|
+| Trusted server certificate path | |
| Comma separated list of paths to the DER-encoded trusted server
certificates
|
+| Path reference types | |
| Specify the reference types between nodes in the path if Path Node ID
type is used. If not provided, all reference types are assumed to be Organizes.
The format is 'referenceType1/referenceType2/.../referenceTypeN' and the
supported reference types are Organizes, HasComponent, HasProperty, and
HasSubtype. |
+| **Node ID type** | |
Path<br/>Int<br/>String<br/>Guid | Specifies the type of the provided node ID
|
+| **Node ID** | |
| Specifies the ID of the root node to fetch history for. In case of a
Path Node ID Type, the path should be provided in the format of 'path/to/node'.
|
+| **Namespace index** | 0 |
| The index of the namespace.
|
+| Start timestamp | |
| Timestamp after which the events should be returned. If not specified
entries are returned from the beginning of the history.
|
+| End timestamp | |
| Timestamp before which the events should be returned. If not specified
entries are returned until the current time.
|
+| Batch size | |
| Maximum number entries to read and return in a single batch. If set to
zero or empty all available entries are returned.
|
+| **History read type** | Raw | Raw<br/>Audit
| Whether to fetch raw historical values or the audit trail of
modifications to historical values
|
+| Record set writer | |
| Specifies the Controller Service to use for writing results to a
FlowFile instead of using the default output format.
|
+
+### Relationships
+
+| Name | Description |
+|---------|----------------------------------------------------|
+| success | Successfully retrieved OPC-UA node history entries |
+
+### Output Attributes
+
+| Attribute | Relationship | Description
|
+|------------------------|--------------|-----------------------------------------------------------------------------------------|
+| NodeID | success | ID of the node.
|
+| Namespace index | success | Namespace index of the node.
|
+| Sourcetimestamp | success | The timestamp of when the node was
created in the server as 'YYYY-MM-DDTHH:MM:SS.sssZ'. |
+| ModificationUsername | success | Username of the user who modified
the node. |
+| ModificationTime | success | Timestamp of when the node was
modified. |
+| ModificationUpdateType | success | Type of modification performed on
the node. |
Review Comment:
Generally yes, but we already use this style in the FetchOPCProcessor and I
wanted to keep the format consistent within the extension.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]