Bridge API

Prev Next

The swXtchBridge API base URL for is http://{swXtchBridge-ctrl-ip}:{port}

Adaptors

adaptors/add

  • Adds new unicast adaptor configuration.

Endpoint:

<base_url>/swx/adaptors/add

Request:

json

{
  "protocolCode": "udp",
  "directionCode": "ingress",
  "streamIp": "239.1.1.1",
  "streamPort": 5000,
  "socketIp": "10.0.1.100",
  "socketPort": 5001,
  "listenerPort": 6000,
  "options": [
    {
      "name": "bufferSize",
      "value": "65536"
    },
    {
      "name": "ttl", 
      "value": "64"
    }
  ]
}

Response:

json / { "id": "adaptor-uuid-123" }

Error Responses:

  • 400 - Fanout not enabled or validation failed

  • 409 - Adaptor already exists

Example Response →

$ curl 172.51.128.132/swx/adaptors/add -d '{
  "protocolCode": "udp",
  "directionCode": "ingress",
  "streamIp": "239.1.1.1",
  "streamPort": 5000,
  "socketIp": "10.0.1.100",
  "socketPort": 5001,
  "listenerPort": 6000,
  "options": [
    {
      "name": "bufferSize",
      "value": "65536"
    },
    {
      "name": "ttl",
      "value": "64"
    }
  ]
}'
{"id":"12415546857077395231"}


adaptors/remove

  • Removes one or more adaptor configurations.

Endpoint:

<base_url>/swx/adaptors/remove

Request:

json / { "ids": ["adaptor-uuid-123", "adaptor-uuid-456"] }

Response:

  • 200 - Success (no body)

  • json / {"errorCode":12005,"errorMessage":"The given adaptors don't exist.","data":"adaptor-uuid-123"}

Example Response →

$ curl 172.51.128.132/swx/adaptors/remove -d '{ "ids": [ "12415546857077395231" ] }'
$

adaptors/show

  • Returns the current adaptors configuration.

Endpoint:

<base_url>/swx/adaptors/show

Request:

Empty

Response:

json

{
  "adaptors": {
    "adaptor-uuid-123": {
      "id": "adaptor-uuid-123",
      "protocolCode": "udp",
      "directionCode": "ingress",
      "streamIp": "239.1.1.1",
      "streamPort": 5000,
      "socketIp": "10.0.1.100",
      "socketPort": 5001,
      "listenerPort": 6000,
      "options": [
        {
          "name": "bufferSize",
          "value": "65536"
        }
      ]
    }
  }
}

Example Response →

$ curl 172.51.128.132/swx/adaptors/show
{"adaptors":{"3875045238777959178":{"id":"3875045238777959178","protocolCode":"udp","directionCode":"ingress","streamIp":"239.1.1.1","streamPort":5000,"socketIp":"10.0.1.100","socketPort":5001,"listenerPort":6000,"options":[{"name":"bufferSize","value":"65536"},{"name":"ttl","value":"64"}]},"9444164746505921829":{"id":"9444164746505921829","protocolCode":"udp","directionCode":"ingress","streamIp":"239.1.1.1","streamPort":10020,"socketIp":null,"socketPort":null,"listenerPort":10021,"options":[]}}}

adaptors/state

  • Returns the runtime statistics for all adaptors.

Endpoint:

<base_url>/swx/adaptors/state

Request:

Empty

Response:

json

{
  "adaptor-uuid-123": {
    "id": "adaptor-uuid-123",
    "isConnected": true,
    "isActive": true,
    "stats": {
      "239.1.1.1:5000": {
        "packets": 1000000,
        "bytes": 1500000000,
        "packetsRate": 1000,
        "bytesRate": 1500000,
        "timestamp": 1642248600,
        "protocolId": 1,
        "protocolName": "UDP"
      }
    },
    "config": {
      "id": "adaptor-uuid-123",
      "protocolCode": "udp",
      "directionCode": "ingress"
    }
  }
}

Example Response →

$ curl 172.51.128.132/swx/adaptors/state
{"3875045238777959178":{"id":"3875045238777959178","isConnected":false,"isActive":false,"stats":{},"config":{"id":"3875045238777959178","protocolCode":"udp","directionCode":"ingress","streamIp":"239.1.1.1","streamPort":5000,"socketIp":"10.0.1.100","socketPort":5001,"listenerPort":6000,"options":[{"name":"bufferSize","value":"65536"},{"name":"ttl","value":"64"}]}},"9444164746505921829":{"id":"9444164746505921829","isConnected":false,"isActive":false,"stats":{},"config":{"id":"9444164746505921829","protocolCode":"udp","directionCode":"ingress","streamIp":"239.1.1.1","streamPort":10020,"socketIp":null,"socketPort":null,"listenerPort":10021,"options":[]}}}

adaptors/update

  • Updates existing adaptor configuration.

NOTE

Only SRT adaptros that are currently in use can be updated. Also, only the POST type. For a complete list

Endpoint:

<base_url>/swx/adaptors/update

Request:

json

{
  "id": "adaptor-uuid-123",
  "options": [
    {
      "name": "bufferSize",
      "value": "131072"
    },
    {
      "name": "ttl",
      "value": "32"
    }
  ]
}

Response:

  • 200 - Success (no body)

  • json / {"errorCode":12005,"errorMessage":"The given adaptors don't exist.","data":null}

Example Response →

$ curl 172.51.128.132/swx/adaptors/update -d '{
  "id": "3875045238777959178",
  "options": [
    {
      "name": "bufferSize",
      "value": "131072"
    },
    {
      "name": "ttl",
      "value": "32"
    }
  ]
}'

Monitoring

monitoring

  • Returns monitoring information for all of the components.  

Endpoint:

<base_url>/swx/monitoring/components

Request:

Empty

Response:

json

Example Response →

$ curl 172.51.128.132/swx/monitoring/components -d '{ "swxtchAddresses": [ "172.51.128.88", "172.51.128.132" ] }'
{
    "172.51.128.126": {
        "metrics": {
            "ha": {
                "aggregations": null,
                "streams": []
            },
            "slp": {
                "rx": {},
                "tx": {}
            },
            "streamLinks": {},
            "totals": {
                "ens6": {
                    "rxCounters": {
                        "byteCount": 0,
                        "packetCount": 0
                    },
                    "rxDropCounters": {
                        "byteCount": 0,
                        "packetCount": 0
                    },
                    "rxRates": {
                        "byteCount": 0,
                        "packetCount": 0
                    },
                    "timestamp": 1759165816261739276,
                    "txCounters": {
                        "byteCount": 0,
                        "packetCount": 0
                    },
                    "txDropCounters": {
                        "byteCount": 0,
                        "packetCount": 0
                    },
                    "txRates": {
                        "byteCount": 0,
                        "packetCount": 0
                    }
                }
            }
        },
        "state": {
            "componentKindCode": "xnic",
            "environment": {
                "cloudName": "AWS",
                "hostname": "ip-172-51-128-126",
                "instanceTypeName": "m6i.2xlarge",
                "osDistribution": "Ubuntu 24.04",
                "regionName": "us-west-1"
            },
            "hardware": {
                "nics": {
                    "ens5": {
                        "broadcastIp": "172.51.128.255",
                        "driverName": "ena",
                        "index": 2,
                        "ip": "172.51.128.126",
                        "mac": "06:ad:0c:49:a9:87",
                        "masterOf": null,
                        "mtu": 9001,
                        "name": "ens5",
                        "pciAddress": "0000:00:05.0",
                        "publicIp": null,
                        "subnetMask": "255.255.255.0",
                        "subnetPrefix": "172.51.128.0/24",
                        "vpc": "vpc-029879464f8431389"
                    },
                    "ens6": {
                        "broadcastIp": "172.51.144.255",
                        "driverName": "ena",
                        "index": 3,
                        "ip": "172.51.144.149",
                        "mac": "06:d4:55:e3:4b:21",
                        "masterOf": null,
                        "mtu": 3900,
                        "name": "ens6",
                        "pciAddress": "0000:00:06.0",
                        "publicIp": null,
                        "subnetMask": "255.255.255.0",
                        "subnetPrefix": "172.51.144.0/24",
                        "vpc": "vpc-029879464f8431389"
                    },
                "vpcs": {
                    "ens5": "vpc-029879464f8431389",
                    "ens6": "vpc-029879464f8431389"
                }
            },
            "id": "172.51.128.126",
            "name": "ip-172-51-128-126"
        }
.
.


Subscriptions

Subscriptions are multicast addresses that are required for on-prem to cloud IGMP joins and visa versa.  Note that it is dynamic from on-prem to cloud, therefore Forward Subscriptions are not necessary, however Ground Subscriptions are necessary unless using PIM table integration.

subscriptions/addForwardSubscription

  • Adds a forward subscription to the bridge configuration.  

Endpoint:

<base_url>/swx/subscriptions/addForwardSubscription

Request:

json

{
  "groupAddress": "string",
  "swxtchAddress": {
      "ip": "string",
      "port": 0
    }
}

Response:

  • 200 - Success (no body)

  • json / {"errorMessage":"Group: string already present for swxtch: string:0."}

Example Response →

$ curl 172.51.128.152/swx/subscriptions/addForwardSubscription -d '{
  "groupAddress": "239.1.1.1",
  "swxtchAddress": {
      "ip": "172.51.128.132",
      "port": 10000
    }
}'

subscriptions/addGroundSubscription

  • Adds a ground subscription to configuration

Endpoint:

<base_url>/swx/subscriptions/addGroundSubscription

Request:

json

{
  "multicastGroups": [
    "string"
  ]
}

Response:

  • 200 - Success (no body)

Example Response →

$ curl 172.51.128.152/swx/subscriptions/addGroundSubscription -d '{
  "multicastGroups": [
    "239.1.1.1",
    "239.1.1.2"
  ]
}'

subscriptions/removeForwardSubscription

  • Removes a forward subscription configuration

Endpoint:

<base_url>/swx/subscriptions/removeForwardSubscription

Request:

json

{
  "groupAddress": "string",
  "swxtchAddress": {
      "ip": "string",
      "port": 0
    }
}

Response:

  • 200 - Success (no body)

Example Response →

$ curl 172.51.128.152/swx/subscriptions/removeForwardSubscription -d '{
  "groupAddress": "239.1.1.1",
  "swxtchAddress": {
      "ip": "172.51.128.132",
      "port": 10000
    }
}'

subscriptions/removeGroundSubscription

  • Removes ground subscriptions configuration

Endpoint:

<base_url>/swx/subscriptions/removeGroundSubscription

Request:

json

{
  "multicastGroups": [
    "string"
  ]
}

Response:

  • 200 - Success (no body)

Example Response →

$ curl 172.51.128.152/swx/subscriptions/removeGroundSubscription -d '{
  "multicastGroups": [
    "239.1.1.1",
    "239.1.1.2"
  ]
}'

subscriptions/showForwardSubscriptions

  • Returns current forward subscriptions configuration.

Endpoint:

<base_url>/swx/subscriptions/showForwardSubscriptions

Request:

Empty

Response:

  • json /  {"string:0":["string","string"]}

Example Response →

$ curl 172.51.128.152/swx/subscriptions/showForwardSubscriptions
{"172.51.128.132:10000":["239.1.1.1","239.1.1.2"]}

subscriptions/showGroundSubscriptions

  • Returns current ground subscriptions configuration.

Endpoint:

<base_url>/swx/subscriptions/showGroundSubscriptions

Request:

json

{
  "multicastGroups": [
    "string"
  ]
}

Response:

  • 200 - Success (no body)

  • json /  {"multicastGroups":["string","string"]}

Example Response →

$ curl 172.51.128.152/swx/subscriptions/showGroundSubscriptions
{"multicastGroups":["239.1.1.1:0","239.1.1.2:0"]}