How to use the node-opcua-service-discovery.RegisterServer2Request function in node-opcua-service-discovery

To help you get started, we’ve selected a few node-opcua-service-discovery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-server / source / register_server_manager.ts View on Github external
function constructRegisterServer2Request(
  server: any,
  isOnline: boolean
): RegisterServer2Request {

    const discoveryUrls = server.getDiscoveryUrls();
    assert(!isOnline || discoveryUrls.length >= 1, "expecting some discoveryUrls if we go online ....");

    return new RegisterServer2Request({

        server: {
            // The globally unique identifier for the Server instance. The serverUri matches
            // the applicationUri from the ApplicationDescription defined in 7.1.
            serverUri: server.serverInfo.applicationUri,

            // The globally unique identifier for the Server product.
            productUri: server.serverInfo.productUri,
            serverNames: [
                { locale: "en", text: server.serverInfo.productName }
            ],
            serverType: server.serverType,

            discoveryUrls,
            gatewayServerUri: null,
            isOnline,