Veritas NetBackup™ WebSocket Service (NBWSS) Reference Guide

Last Published:
Product(s): NetBackup (8.1)

NBWSS message formats

To communicate with WebSocket endpoints, the NetBackup WebSocket Service (NBWSS) uses its own message format with JavaScript Object Notation (JSON). The JSON format allows NBWSS and the applications on the endpoints to keep track of messages by ID and determine their type and subtype.

The messages operate as request and response: each request has an associated response.

The following is an example of an NBWSS connection request:

{  
      "version": "1.0",
      "id": "0CEAB6C2-0BBF-4F60-974D-C1F3EF39B872",
      "type": "CONNECT",
      "subType": "REQUEST",
      "timeStamp": 1444944181,
      "payload": {
            "token": "qwerrtrtrtrt2234344==="
      }
}

An example of an application's response:

{  
      "version": "1.0",
      "id": "0CEAB6C2-0BBF-4F60-974D-C1F3EF39B872",
      "type": "CONNECT",
      "subType": "RESPONSE",
      "timeStamp": 1444944191,
      "payload": {
            "valid": true
      }
}

Note the following:

  • The message begins with a left curly bracket ({) and ends with a right curly bracket (}).

  • The response should have the same value for "id" as the request.

  • The entries consist of key:value pairs that are comma-separated.

  • The message includes a payload. For messages of type CONNECT or COMMAND, the payload contains an object within curly brackets { }. For messages of type NOTIFICATION, the payload contains an array within square brackets [ ].

  • For background on JSON formatting, see the Network Working Group memo on JavaScript Object Notation:

    http://www.ietf.org/rfc/rfc4627.txt?number=4627

Table: NBWSS message fields describes the fields in the NBWSS messages.

Table: NBWSS message fields

Key

Description

version:

The version of the message. In this release, the available version is 1.0.

id:

A unique identifier for the message.

When NBWSS sends a request message, it generates a UUID and places it in this field. When the application at the endpoint responds with a response message, NBWSS expects the response to contain the same ID as the request message. The ID allows NBWSS to map the request message to the response message.

When NBWSS receives a request message, its response message contains the same ID as the request message. The ID allows the endpoint application to map the request to the response if necessary.

type:

The message type. The available types are:

  • CONNECT

    To request a connection to an endpoint.

  • COMMAND

    To request the execution of a REST API call.

  • NOTIFICATION

    To report on the status of NetBackup events, such as the status of a backup job.

subType:

The message subtype. The available subtypes are REQUEST or RESPONSE.

timeStamp:

A numeric representation of the UNIX Epoch time (in seconds) when the message was sent.

payload:

The body of the message. The body varies with the type and subtype of the message.

The following topics include further details and examples:

See API calls over NBWSS.

See NBWSS notifications.

See Examples of NBWSS messages.