Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
10 views

Cubro Packetmaster RestAPI User Guide

This document provides a summary of the REST API for Cubro Packetmaster devices. The API allows management of apps, bypass configuration, device settings like IP and name, port configuration, rules, groups, and more. Resources are accessed via HTTP methods at paths beginning with /rest. Responses are typically JSON and support dynamic parameters, authentication is also described.

Uploaded by

Lee Hiếu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Cubro Packetmaster RestAPI User Guide

This document provides a summary of the REST API for Cubro Packetmaster devices. The API allows management of apps, bypass configuration, device settings like IP and name, port configuration, rules, groups, and more. Resources are accessed via HTTP methods at paths beginning with /rest. Responses are typically JSON and support dynamic parameters, authentication is also described.

Uploaded by

Lee Hiếu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

20.09.

22, 09:13 Cubro Packetmaster RestAPI User Guide

EXWui REST API Documentation


Base URL: /rest, Version: 1636041515

Description of the REST API interfaces of the Cubro Packetmaster devices. This document can be applied to the
G4 family (EX32, EX32+, EX484-3, EX48400 and EX20400), G6 family (EX5-3, EX6-3) and Aggreator C32.

Some notes:
Path
An URL as used by REST is made up of the scheme (e.g. "http"), the host (e.g. "192.168.0.200"), the base path
(here "/rest") and the specific path (e.g. "/rules/all"), this results in e.g. http://192.168.0.200/rest/rules/all
(http://192.168.0.200/rest/rules/all).

Dynamic Parameters
In this document, parameters/Keys written in all-caps and in parentheses (e.g. '(EXAMPLE)') are placeholders
for keys with dynamic names. Three dots after it '...' additionally indicate that multiple such fields are expected.

Parameter Casing
Most parameters are in snake case (e.g. "snake_case") but some can also be addressed using camel case
(camelCase) or lower case (lowercase).

JSON parameter format


All function using the default HTTP parameter format also support JSON as an input format format if the content
type of the request is "application/json". x=1 is equivalent to {"x":1} , x[]=1&x[]=2 to {"x":[1,2]} , and
x[a]=1 to {"x":{"a":1}} .

Authentication and Access Checks


If UAC (user authentication and access control) is activated the REST interface can only be used if
authenticated through an existing web UI user account. Authentication is possible through either HTTP basic
authentication or by setting the parameters 'username' and 'password'. Note that the console and web/REST
users are totally seperate. The default web/REST user account has the username 'admin' and password 'cubro'
(both without quotes).

An user account has a certain access level and REST methods might have minimum level required. Three user
level exist: READ (1), WRITE (7) and SUPER (31); in the brackets are the numeric representations. Every level
encompasses the levels below it. A user is at least level 1 (READ).

Types
Sometimes, multiple types are possible for a parameter or returned in a response, the type mentioned here
always represents the most likely type used, e.g. a numeric value for throughputs even if it can be 'n/a' in case
the port does yet not exist for long enough.

Errors
Errors are normally returned using an error object with an 'error' field but in some cases it is possible that it is
actually simply in the 'result' field of an result object. This is normally only the case if the error is not likely to be
dire for the user.

HTTP Methods
Instead of using the HTTP methods PUT/DELETE there is the possibility of using POST together with the HTTP
header X-HTTP-Method-Override:<METHOD> (where <METHOD> stands for the PUT/DELETE to represent)
instead.
file:///C:/Users/fabia/Downloads/rest_api (1).html 1/80
20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Default response content-types: application/json


Schemes: http

Summary
Path Operation Description

DELETE Stops a running app

GET Returns all apps


/apps
POST Starts an app

PUT Modifies the parameters of an app instance

/apps/action POST Calls a custom app action

/apps/running GET Returns all app instances

/bypass/portstate GET Gets bypass-related port configuration and states

GET Gets various bypass-related things


/bypass/state
POST Sets the state of various switches.

/device/apilevel GET Returns the device API level

DELETE Deletes the given controller.

/device/controller GET Returns the configured controller

POST Adds the given controller.

GET Returns the device label and notes


/device/customident
POST Sets the device label and device notes

/device/dpid GET Returns the device Openflow Datapath ID

/device/environment GET Returns environment information

/device/generation GET Returns the generation

GET Returns a map of all supported group select hash keys and
their states
/device/grouphash
POST Sets whether certain group select hash keys should be used or
not

/device/https POST Sets the HTTPS setting

GET Gets the device ID LED status


/device/idled
POST Sets the device ID LED

/device/imageversion GET Returns the version of the active image

GET Returns the IP config


/device/ipconfig
POST Sets the IP config

/device/loadaverage GET Returns load information

/device/memoryusage GET Returns memory usage

file:///C:/Users/fabia/Downloads/rest_api (1).html 2/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Path Operation Description

/device/model GET Returns the device model

GET Returns the device label


/device/name
POST Sets the device label

GET Sets name resolution settings


/device/nameresolution
POST Sets the name resolution settings.

GET Returns state of permanent mode


/device/permanentrulesmode
POST Sets the permanent mode

/device/reboot POST Device reboot

/device/restartwebserver POST Restarts the webserver without a reboot.

GET Returns the rule storage mode setting


/device/rulestoragemode
POST Sets the rule storage mode

/device/serialno GET Returns the serial number

/device/serverrevision GET Returns the revision

/device/setlicense POST Adds a license for this device

GET Gets the device ID LED status


/device/telnet
POST Gets the device ID LED status

DELETE Deletes a group

/groups POST Adds a group

PUT Modifies a group

DELETE Deletes all active groups


/groups/all
GET Returns all currently active groups on the device

GET Returns port configurations


/ports/config
POST Configures a port

/ports/info GET Returns status of the ports

/ports/sfpstatus GET Returns information about the SFPs

/ports/stats GET Returns the counters of all ports

DELETE Deletes a rule

/rules POST Adds a rule

PUT Modifies a rule

DELETE Deletes all rules


/rules/all
GET Returns all rules

/rules/counters DELETE Resets all rule counters

/savepoints GET Returns all rule and port save-points

file:///C:/Users/fabia/Downloads/rest_api (1).html 3/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Path Operation Description

PUT
/savepoints/activeportsavepoint
Activates a port save-point

/savepoints/activerulesavepoint PUT Activates a rule save-point

/savepoints/defaultrulesavepoint PUT Sets a rule save-point to be loaded on boot

/savepoints/export GET Returns selected rule and port save-points

/savepoints/modportsavepoint POST Modifies an existing port save-point

/savepoints/modrulesavepoint POST Modifies an existing rule save-point

DELETE Deletes a port save-point


/savepoints/portsavepoint
POST Creates a new port save-point from current port settings

PUT From current rules/groups creates a 'Quicksave' rule save-point


/savepoints/quicksaverules
set to load on boot

DELETE Deletes a rule save-point


/savepoints/rulesavepoint
POST Creates a new rule save-point from current rules/groups

DELETE Deletes an user

GET Returns all users


/users
POST Adds an user

PUT Modifies an user

GET Gets the RADIUS config


/users/radius
POST Sets the RADIUS config

GET Returns the UAC state


/users/uac
POST Sets the UAC state

Security
Read_Rights_Required
Type: basic

Description:

Read-only access to everything. Any user has at least this rights level.

Numeric level: 1

Write_Rights_Required
Type: basic

Description:

file:///C:/Users/fabia/Downloads/rest_api (1).html 4/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Can add/​change/​remove rules/​groups/apps, add/​change/​remove rule save-points and set them as load-on-
boot, reset counters, and change group hashing methods used.

Numeric level: 7

Super_Rights_Required
Type: basic

Description:

Can do everything, therefore has the ability to e.g. change port settings, add/​change/​remove port save-
points, import save-points, upgrade/​reboot device, change IP/​label/​description, add/​change/​remove users,
enable/​disable user access checks and change any setting/​mode like the special protocol transparency
settings.

Numeric level: 31

Paths
DELETE /apps Stops a running app

DESCRIPTION
Stops an app instance.

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Name Description Type Data type

pid PID of the app instance to be killed. query integer required

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

file:///C:/Users/fabia/Downloads/rest_api (1).html 5/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

SECURITY

Schema Scopes

Write_Rights_Required

GET /apps Returns all apps

DESCRIPTION
Returns a list of all available apps

RESPONSES
Uses default content-types: application/json

200 OK
Map with apps with the keys being the app names. (APPNAME) is a placeholder for the unique name of the
app.

PROPERTIES
(APPNAME): App

default
Error state.

Error

POST /apps Starts an app

DESCRIPTION
Starts an available app, creating a new instance.

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Name Description Type Data type

name Name of the app to start an instance of. query string

user_description Custom description for the new instance of the app. query string

file:///C:/Users/fabia/Downloads/rest_api (1).html 6/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Name Description Type Data type

(PARAM)... (PARAM) is a placeholder for any app-specific parameter. query string

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

PUT /apps Modifies the parameters of an app instance

DESCRIPTION
Modifies the parameters of an already running app.

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Data
Name Description Type type

pid PID of the app instance. query integer required

user_description Custom description for the new instance of the app. query string

(PARAM)... App parameter to change. (PARAM) is a placeholder for query string


any app-specific parameter.

file:///C:/Users/fabia/Downloads/rest_api (1).html 7/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

POST /apps/action Calls a custom app action

DESCRIPTION
Calls a custom app action.

An user level as required by the app might be necessary.

REQUEST PARAMETERS

Name Description Type Data type

pid PID of the app instance query integer required

action_name Name of the action to be called. query string

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

file:///C:/Users/fabia/Downloads/rest_api (1).html 8/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

default
Error state.

Error

GET /apps/running Returns all app instances

DESCRIPTION
Returns all running apps (app instances)

RESPONSES
Uses default content-types: application/json

200 OK
Map with app instances with the keys being the PIDs. (PID) is a placeholder for the unique ID of an app
instance.

PROPERTIES
(PID): App

default
Error state.

Error

GET /bypass/portstate Gets bypass-related port configuration and states

DESCRIPTION
Returns the state and configuration of ports relevant to the bypass functionality.

Only for use on EX400 Bypass series devices.

RESPONSES
Uses default content-types: application/json

200 OK
State of the related ports.

PROPERTIES
(PORT_NO): object

file:///C:/Users/fabia/Downloads/rest_api (1).html 9/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

PROPERTIES
split: boolean
Whether the port is split

link: boolean
Whether the link is up.

speed: string
Text description of link speed and configured speed (latter in parentheses). Auto means that the
speed is to be determined through protocol negotiation.

GET /bypass/state Gets various bypass-related things

DESCRIPTION
Returns the state of the bypass-related switches, relevant ports and relevant configuration.

Only for use on EX400 Bypass series devices.

RESPONSES
Uses default content-types: application/json

200 OK
States of various bypass-related switches, relevant ports and relevant configuration.

PROPERTIES
state: object
State of the bypass itself.

PROPERTIES
hw: boolean
State of the hardware-based switch bypass.

sw: boolean[]
ITEMS
boolean
DESCRIPTION
States of the software-based route bypass switches.

backup: boolean
Whether using the backup appliance in the hot-standby scenario.

maintenance: boolean
Whether in maintenance mode where automated switching is not happening.

file:///C:/Users/fabia/Downloads/rest_api (1).html 10/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

valid: boolean
Whether the port configuration is valid, also in regards to the selected scenario.

portState: object
State of a related port of the bypass.

PROPERTIES
(PORT_NO): object
(PORT_NO) refers to the physical port in question, 1 is QS1 and so on…

PROPERTIES
split: boolean
Whether the port is split

link: boolean
Whether the link is up.

speed: string
Text description of link speed and configured speed (latter in parentheses). Auto means that the
speed is to be determined through protocol negotiation.

toolOnlineState: boolean[]
ITEMS
boolean
DESCRIPTION
List of online states of the appliances according to selected trigger (REST/heartbeat
packets/pings) or depending on the setting the state of the related link (if applicable).

config: object
Bypass-related configs.

PROPERTIES
maintenanceMode: boolean
Whether the maintenance mode is enabled, the mode for manual control of the bypass switches
and the backup switch (in hot-standby mode). While maintenance is enabled no checks for
appliance on/offline status are performed and no automatic switching happens.

swBypass(N): boolean
Whether a route (software-based) bypass is in effect.

(N) is replaced with the number of the particular route bypass.

backupMode: boolean
Whether the backup appliance is used.

Only plays a role in a hot-standby scenario.

onceLiveAfterSetup: boolean

file:///C:/Users/fabia/Downloads/rest_api (1).html 11/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Maintenance mode has been turned off at least once since the last time it got configured, i.e. the
current setup is or was live.

expectToolPortsSplit: boolean
The appliance (AKA tool) ports are expected to be split, e.g. using a break-out box or cables are
100G interface is split into four independent 25G interfaces.

expectLivePortsSplit: boolean
The live ports are expected to be split, e.g. using a break-out box or cables are 100G interface is
split into four independent 25G interfaces.

baseScenario: integer , x ∈ { "1" , "2" , "4" }


The main scenario for the bypass refered to by numbers:

1: Simple bypassing of one or up to four appliances independently.


2: Hot-Standby, with a main and a backup appliance.
4: Load Balancing

Note that the exact scenario also depends on whether the tool or live ports are split.

swapToolPorts: boolean
In a hot-standby scenario means that ports 1 and 2 are swapped in regards to the priority of the
appliances, i.e. port 2 then has the main appliance and 1 the backup appliance.

No effect in other scenarios.

trigger: string , x ∈ { "none" , "ping" , "heartbeat" , "rest" }


Main trigger method by which it an appliance is determined to be up (and working) or not.

restTimeout: integer
Maximal amount of seconds to wait for a request to the particular URL until an appliance is
considered down.

Only applies if REST (timeout) is configured as a trigger.

pingTarget(N): string
IPv4 address of the target to ping.

(N) is to be replaced with the number of the particular appliance from 1 (the first) through 4 (the
forth). Note that in a hot-standy scenario 1 is the main and 2 the backup appliance.

Only applies if ping (timeout) is configured as a trigger and the number of appliances depends on
the configured scenario.

pingInterval: integer
Time in seconds to wait after a successful ping before sending another one.

Only applies if ping (timeout) is configured as a trigger.

pingTimeout: integer
Maximal amount of seconds to wait for a reply to a ping until an appliance is considered down.

Only applies if ping (timeout) is configured as a trigger.

file:///C:/Users/fabia/Downloads/rest_api (1).html 12/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

heartbeatInterval: integer
Time in seconds between heartbeat packets being sent out.

Only applies if heartbeat packets are configured.

heartbeatTimeout: integer
Seconds of no heartbeat until an appliance is considered down.

Only applies if heartbeat packets are configured.

heartbeatProtocol: string , x ∈ { "udp" , "icmp" , "arpreq" , "arpresp" }


Which types of packages to send as heartbeart packets.

Only applies if heartbeat packets are configured.

heartbeatSrcMAC: string
The source or first target MAC address (former in hot-standby mode).

Only applies if heartbeat packets are configured.

heartbeatDstMAC: string
The destination or second target MAC address (former in hot-standby mode).

Only applies if heartbeat packets are configured.

heartbeatSrcIP: string
The source or first target IPv4 address (former in hot-standby mode).

Only applies if heartbeat packets are configured.

heartbeatDstIP: string
The destination or second target IPv4 address (former in hot-standby mode).

Only applies if heartbeat packets are configured.

heartbeatSrcUdpPort: integer
The source or first target UDP port (former in hot-standby mode).

Only applies if heartbeat packets in the UDP format are configured.

heartbeatDstUdpPort: integer
The destination or second target UDP port (former in hot-standby mode).

Only applies if heartbeat packets in the UDP format are configured.

heartbeatDirectionOption: integer , x ∈ { "0" , "1" , "2" }


In which direction the heartbeat packets should be sent towards the inline appliance with 0 being a
bidirectional configuration (1 🡘 Tool 🡘 2), 1 the unidirectional config in normal (or ascending)
direction (1 🡒 Tool 🡒 2), and 2 meaning that it is configured for reversed (or descending) direction
(1 🡐 Tool 🡐 2).

Configuration state might not apply, e.g. because a trigger other than heartbeats is used.

autoResetBypass: boolean

file:///C:/Users/fabia/Downloads/rest_api (1).html 13/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Whether the an activated bypass is automatically resetted into the off state on resumption of
ping/heartbeat packets/REST for keeping bypass off.

Does not apply if there is no non-additional trigger.

triggerOnLinkLoss: boolean
Whether the additional trigger which makes the online/offline state of an appliance also dependent
on the corresponding link state, i.e. if the link with the main appliance goes down then depending
on the backup appliance state switches to the backup appliance or activates the bypass.

default
Error state.

Error

POST /bypass/state Sets the state of various switches.

DESCRIPTION
Sets the state of various switches.

Only for use on EX400 Bypass series devices.

REQUEST PARAMETERS

Data
Name Description Type type

hw Change the state of the hardware-based switch bypass. query boolean

backup Change the state of backup mode switch. In backup mode the query boolean
backup appliance instead of the main appliance mode is used.
Only applies to the hot-standby scenario.

maintenance Change the state of the maintenance mode. In maintenance mode query boolean
no automatic switching is happening.

sw(N) Change the state of the software-based route bypasses. Replace query boolean
(N) with the index of the bypass starting with 1.

The number of route bypass switches depends on the particular


configuration.

RESPONSES
Uses default content-types: application/json

file:///C:/Users/fabia/Downloads/rest_api (1).html 14/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

200 OK
Result state.

Result

default
Error state.

Error

GET /device/apilevel Returns the device API level

DESCRIPTION
Returns the device API level.

RESPONSES
Uses default content-types: application/json

200 OK
Device API level.

PROPERTIES
name: string

default
Error state.

Error

DELETE /device/controller Deletes the given controller.

DESCRIPTION
Deletes the given controller.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

file:///C:/Users/fabia/Downloads/rest_api (1).html 15/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Name Description Type Data type

connection Connection type of the controller. Either "tcp" or "ssl" query string

ip IP address of the controller. query string

port TCP port of the controller. query string

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

GET /device/controller Returns the configured controller

DESCRIPTION
Returns the configured controller details

RESPONSES
Uses default content-types: application/json

200 OK
Configured controller details

PROPERTIES
connection: string
tcp or ssl

file:///C:/Users/fabia/Downloads/rest_api (1).html 16/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

ip: string

port: integer

role: string

status: string

default
Error state.

Error

POST /device/controller Adds the given controller.

DESCRIPTION
Adds the given controller.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

connection Connection type of the controller. Either "tcp" or "ssl" query string

ip IP address of the controller. query string

port TCP port of the controller. query string

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

file:///C:/Users/fabia/Downloads/rest_api (1).html 17/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

SECURITY

Schema Scopes

Super_Rights_Required

GET /device/customident Returns the device label and notes

DESCRIPTION
Returns the web UI device label and notes.

RESPONSES
Uses default content-types: application/json

200 OK
Device label and notes.

PROPERTIES
name: string
Device label.

notes: string
Device notes.

default
Error state.

Error

POST /device/customident Sets the device label and device notes

DESCRIPTION
Sets the device label and device notes used in the web UI.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

file:///C:/Users/fabia/Downloads/rest_api (1).html 18/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Name Description Type Data type

name New device label. query string required

notes New device notes. query string required

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

GET /device/dpid Returns the device Openflow Datapath ID

DESCRIPTION
Returns the device Datapath ID.

RESPONSES
Uses default content-types: application/json

200 OK
Datapath ID.

PROPERTIES
name: string

default
Error state.

file:///C:/Users/fabia/Downloads/rest_api (1).html 19/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Error

GET /device/environment Returns environment information

DESCRIPTION
Returns various information about physical characteristics, namely status of the fans, PSU and temperature
sensors.

RESPONSES
Uses default content-types: application/json

200 OK
Load information.

PROPERTIES
fan: object[]
ITEMS
object
PROPERTIES
index: string

status: string
Information about the status of the fan unit.

speed_rate: string
Speed rate of the fan in percent.

mode: string
Information about the running mode of the fan.

psu: object[]
ITEMS
object
PROPERTIES
index: integer

status: string
Information about whether the PSU is present or not. Can be either PRESENT or ABSENT.

power: string
Information about the power state of the PSU. Can be either OK, FAIL or - (latter if the PSU is
absent).

file:///C:/Users/fabia/Downloads/rest_api (1).html 20/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

type: string
Information about the type of the PSU. Can be either AC, DC or - (if the PSU is absent or
unplugged).

alert: string
Information about whether the PSU is in an alert state. Can be either NO (everything is running
fine) or ALERT (power failure).

temp_sensors: object[]
ITEMS
object
PROPERTIES
index: integer

temp: integer
Current temperature reported by the temperature sensor.

lower_alarm: integer
Lower temperature threshold (degree C) at which alarm will be raised.

upper_alarm: integer
Upper temperature threshold (degree C) at which alarm will be raised.

critical_limit: integer
Temperature limit (degree C) at which device will turn off.

position: string
Location of the sensor if known, e.g. "AROUND_CHIP", can be an empty string.

default
Error state.

Error

GET /device/generation Returns the generation

DESCRIPTION
Returns the device model generation.

RESPONSES
Uses default content-types: application/json

file:///C:/Users/fabia/Downloads/rest_api (1).html 21/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

200 OK
Device model generation information.

PROPERTIES
generation: string
Generation of the model of device in use.

default
Error state.

Error

GET /device/grouphash Returns a map of all supported group select hash keys and their states

DESCRIPTION
Returns a map of all supported group select hash keys and their states. The key is an hash key available
on this device. The boolean value indicates whether that hash key is used (true = it is used).

RESPONSES
Uses default content-types: application/json

200 OK
map of all group select hash keys.

PROPERTIES
macsa: boolean
Boolean value indicating whether MAC source address is used as a key.

macda: boolean
Boolean value indicating whether MAC destination address is used as a key.

ethertype: boolean
Boolean value indicating whether the ethertype value is used as a key.

ipsa: boolean
Boolean value indicating whether the IP source address is used as a key.

ipda: boolean
Boolean value indicating whether the IP destination address is used as a key.

ip_protocol: boolean
Boolean value indicating whether the IP protocol number is used as a key.

file:///C:/Users/fabia/Downloads/rest_api (1).html 22/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

src_port: boolean
Boolean value indicating whether the source port is used as a key.

dst_port: boolean
Boolean value indicating whether the destination port is used as a key.

default
Error state.

Error

POST /device/grouphash Sets whether certain group select hash keys should be used or not

DESCRIPTION
Sets whether certain group select hash keys should be used or not.

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Data
Name Description Type type

macsa Boolean value indicating whether MAC source address should be query boolean
used as a key.

macda Boolean value indicating whether MAC destination address should query boolean
be used as a key.

ether_type Boolean value indicating whether the ethertype value should be used query boolean
as a key.

ipsa Boolean value indicating whether the IP source address should be query boolean
used as a key.

ipda Boolean value indicating whether the IP destination address should query boolean
be used as a key.

ip_protocol Boolean value indicating whether the IP protocol number should be query boolean
used as a key.

src_port Boolean value indicating whether the source port should be used as query boolean
a key.

file:///C:/Users/fabia/Downloads/rest_api (1).html 23/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Data
Name Description Type type

dst_port Boolean value indicating whether the destination port should be used query boolean
as a key.

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

POST /device/https Sets the HTTPS setting

DESCRIPTION
Sets the HTTPS setting.

REQUEST PARAMETERS

Name Description Type Data type

https_enabled Whether to enable HTTPS query boolean required

ssl_password Password for certificate/key in plain text. query string required

RESPONSES
Uses default content-types: application/json

file:///C:/Users/fabia/Downloads/rest_api (1).html 24/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

200 OK
Result state.

Result

default
Error state.

Error

GET /device/idled Gets the device ID LED status

DESCRIPTION
Shows whether the device ID LED is activated or not

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

PROPERTIES
activated: boolean

POST /device/idled Sets the device ID LED

DESCRIPTION
Activates or deactivates the device ID LED

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Name Description Type Data type

activated true enables the LED, false disables it. query boolean required

RESPONSES
Uses default content-types: application/json

file:///C:/Users/fabia/Downloads/rest_api (1).html 25/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

GET /device/imageversion Returns the version of the active image

DESCRIPTION
Returns the version of the active image.

RESPONSES
Uses default content-types: application/json

200 OK
Image version information.

PROPERTIES
version: string
Version of image in use.

default
Error state.

Error

GET /device/ipconfig Returns the IP config

file:///C:/Users/fabia/Downloads/rest_api (1).html 26/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

DESCRIPTION
Returns the current and stored IP configuration of the management port.

RESPONSES
Uses default content-types: application/json

200 OK
IP configuration information.

PROPERTIES
current_ip: string
Current IP address of the management port

current_netmask: string
Current netmask of the management port

current_gateway: string
Current default gateway of the management port

stored_ip: string
IP address of the management port after reboot

stored_netmask: string
Netmask of the management port after reboot

stored_gateway: string
Default gateway of the management port after reboot

default
Error state.

Error

POST /device/ipconfig Sets the IP config

DESCRIPTION
Sets the current and stored (the one loaded on boot) IP configuration

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Data
Name Description Type type

file:///C:/Users/fabia/Downloads/rest_api (1).html 27/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Data
Name Description Type type

ip New IP address of the management port, e.g. '192.168.0.200' or query string required
'169.254.254.42'.

mask New network mask of the management port, e.g. '255.255.0.0'. query string required

gw New default gateway of the management port, e.g. '192.168.0.1'. query string required

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

GET /device/loadaverage Returns load information

DESCRIPTION
Returns various information about the load on the OS, namely CPU usage.

RESPONSES
Uses default content-types: application/json

200 OK
Load information.

PROPERTIES

file:///C:/Users/fabia/Downloads/rest_api (1).html 28/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

average_1m: number (double)


Average CPU load over 1 minute.

average_5m: number (double)


Average CPU load over 5 minutes.

average_15m: number (double)


Average CPU load over 15 minutes.

proc_no_running: integer
Number of currenty running processes.

proc_no_total: integer
Total number of processes.

default
Error state.

Error

GET /device/memoryusage Returns memory usage

DESCRIPTION
Returns total and free amount of memory.

RESPONSES
Uses default content-types: application/json

200 OK
Memory usage information.

PROPERTIES
total: integer
Total memory in Kibibyte.

free: integer
Free memory in Kibibyte.

default
Error state.

Error

file:///C:/Users/fabia/Downloads/rest_api (1).html 29/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

GET /device/model Returns the device model

DESCRIPTION
Returns the device model.

RESPONSES
Uses default content-types: application/json

200 OK
Device model information.

PROPERTIES
model: string
Model of the device.

default
Error state.

Error

GET /device/name Returns the device label

DESCRIPTION
Returns the device label used in the web UI.

RESPONSES
Uses default content-types: application/json

200 OK
Device label.

PROPERTIES
name: string

default
Error state.

Error

file:///C:/Users/fabia/Downloads/rest_api (1).html 30/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

POST /device/name Sets the device label

DESCRIPTION
Sets the device label used in the web UI, the one displayed in the right-left there.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

device_name New device name. query string required

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

GET /device/nameresolution Sets name resolution settings

DESCRIPTION
Returns the name resolution settings, namely the DNS servers.

RESPONSES
Uses default content-types: application/json

200 OK
file:///C:/Users/fabia/Downloads/rest_api (1).html 31/80
20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

DNS servers (up to three).

PROPERTIES
dns: string[]
IP address of the DNS server.

ITEMS
string

default
Error state.

Error

POST /device/nameresolution Sets the name resolution settings.

DESCRIPTION
Sets the name resolution settings, namely the DNS servers. If empty sets to default values ("8.8.8.8" and
"8.8.4.4")

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Data
Name Description Type type

dns1 IP address of the first name server, e.g. 8.8.8.8 . It is queried first. query string

dns2 IP address of the second name server, e.g. 8.8.4.4 . It is queried after query string
the first server.

dns3 IP address of the third name server. It is queried after the second server. query string

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
file:///C:/Users/fabia/Downloads/rest_api (1).html 32/80
20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

GET /device/permanentrulesmode Returns state of permanent mode

DESCRIPTION
Returns the state of the permanent mode. Permanent mode means that the active rules/groups are always
permanent and remain throughout reboots.

RESPONSES
Uses default content-types: application/json

200 OK
Permanent rules mode.

PROPERTIES
state: boolean

default
Error state.

Error

POST /device/permanentrulesmode Sets the permanent mode

DESCRIPTION
Sets the permanent mode.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

file:///C:/Users/fabia/Downloads/rest_api (1).html 33/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Name Description Type Data type

state New state of permanent mode, true = on. query boolean required

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

POST /device/reboot Device reboot

DESCRIPTION
Reboots the device right away.

User level has to be higher or equal to SUPER.

RESPONSES
Uses default content-types: application/json

200 OK
Result state (device might reboot before returning it)

Result

default
Error state.

Error

file:///C:/Users/fabia/Downloads/rest_api (1).html 34/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

SECURITY

Schema Scopes

Super_Rights_Required

POST /device/restartwebserver Restarts the webserver without a reboot.

DESCRIPTION
Restarts the webserver right away.

User level has to be higher or equal to SUPER.

RESPONSES
Uses default content-types: application/json

200 OK
Result state (webserver might be restarting before returning it)

Result

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

GET /device/rulestoragemode Returns the rule storage mode setting

DESCRIPTION
Returns the rule storage mode setting.

RESPONSES

file:///C:/Users/fabia/Downloads/rest_api (1).html 35/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Uses default content-types: application/json

200 OK
Rule storage mode ("simple"/"ipv6").

PROPERTIES
modeCurrent: string , x ∈ { "simple" , "ipv6" }
Currently active rule storage mode.

modeNext: string , x ∈ { "simple" , "ipv6" }


Rule storage mode after reboot.

default
Error state.

Error

POST /device/rulestoragemode Sets the rule storage mode

DESCRIPTION
Sets the rule storage mode, might affect the matching and action capabilities of some devices, e.g.
concerning IPv6.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

mode New rule storage mode ('simple' or 'ipv6'). query string , x ∈ { "simple" , "ipv6" } required

RESPONSES
Uses default content-types: application/json

200 OK
Rule storage mode ('simple' or 'ipv6').

PROPERTIES
modeCurrent: string , x ∈ { "simple" , "ipv6" }
Currently active rule storage mode (the newly activated one)

modeNext: string , x ∈ { "simple" , "ipv6" }


Rule storage mode after reboot.

file:///C:/Users/fabia/Downloads/rest_api (1).html 36/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

GET /device/serialno Returns the serial number

DESCRIPTION
Returns the serial number of the device.

RESPONSES
Uses default content-types: application/json

200 OK
Serial number information.

PROPERTIES
generation: string
Serial no. of the device in use.

default
Error state.

Error

GET /device/serverrevision Returns the revision

DESCRIPTION
Returns the revision.

RESPONSES

file:///C:/Users/fabia/Downloads/rest_api (1).html 37/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Uses default content-types: application/json

200 OK
Revision information.

PROPERTIES
revision: string
Revision of cch machinery in use.

default
Error state.

Error

POST /device/setlicense Adds a license for this device

DESCRIPTION
Adds and validates a license for this device

REQUEST PARAMETERS

Data
Name Description Type type

id ID of the license query boolean required

validUntil date until the license is valid. Is not verified here. E.g. "2019- query boolean required
09-07"

serialNumber Serial number of the device. Needs to be the same as the query boolean required
serial number on this device

signature base64(md5(id+";"+serialNumber+";"+validUntil+";"+signature)) query boolean required

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

file:///C:/Users/fabia/Downloads/rest_api (1).html 38/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

default
Error state.

Error

GET /device/telnet Gets the device ID LED status

DESCRIPTION
Shows whether the device ID LED is activated or not

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

PROPERTIES
activated: boolean

POST /device/telnet Gets the device ID LED status

DESCRIPTION
Shows whether the device ID LED is activated or not

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

PROPERTIES
activated: boolean

DELETE /groups Deletes a group

DESCRIPTION

file:///C:/Users/fabia/Downloads/rest_api (1).html 39/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Deletes an existing group specified by the group id given in 'gid'.

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Name Description Type Data type

group_id ID of the group to be deleted. query integer required

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

POST /groups Adds a group

DESCRIPTION
Adds a group. Also deletes all rules which have this group as an action.

User level has to be higher or equal to WRITE.

REQUEST BODY
application/json

Groups JSON

GroupInput

file:///C:/Users/fabia/Downloads/rest_api (1).html 40/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

PUT /groups Modifies a group

DESCRIPTION
Modifies an existing group matched by its group ID.

User level has to be higher or equal to WRITE.

REQUEST BODY
application/json

Groups JSON

GroupInput

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

file:///C:/Users/fabia/Downloads/rest_api (1).html 41/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

DELETE /groups/all Deletes all active groups

DESCRIPTION
Deletes all active groups. Also deletes all rules which have any group as an action.

User level has to be higher or equal to WRITE.

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

GET /groups/all Returns all currently active groups on the device

DESCRIPTION
file:///C:/Users/fabia/Downloads/rest_api (1).html 42/80
20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Returns all currently active groups on the device.

RESPONSES
Uses default content-types: application/json

200 OK
Object with active groups.

PROPERTIES
rules: object[]
ITEMS
GroupOutput

default
Error state.

Error

GET /ports/config Returns port configurations

DESCRIPTION
Returns the configuration of all ports.

RESPONSES
Uses default content-types: application/json

200 OK
Port configs.

PROPERTIES
port_config: PortConfig

default
Error state.

Error

POST /ports/config Configures a port

file:///C:/Users/fabia/Downloads/rest_api (1).html 43/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

DESCRIPTION
Sets the configuration of one port to the given values.

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Name Description Type Data type

if_name Interface Name, e.g. "eth-0-1/1" query string required

speed Speed setting, can be "10", "100", query string , x ∈ { "10" ,


"1000", "10G", "40G", "100G", or "auto" "100" , "1000" , "10G" ,
"40G" , "100G" , "auto"
}

duplex Duplex setting, can be full, half, or auto. query string , x ∈ { "full" ,
"half" , "auto" }

unidirectional Whether to be in unidirectional mode query boolean


where TX is forced to be up, irrespective
of the actual link state.

crc_check Whether to accept incoming packets query boolean


with invalid checksums.

crc_recalculation Whether to correct the checksum of query boolean


outgoing packets (e.g. after
modifications like truncations).

xg_speed Speed level, 1G/XG (XG normally query string , x ∈ { "1G" ,


means 10G) for devices which need to "XG" }
reboot for it to take effect

shutdown Boolean controlling whether interface is query boolean


shut down, otherwise it is up

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

file:///C:/Users/fabia/Downloads/rest_api (1).html 44/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Error

SECURITY

Schema Scopes

Write_Rights_Required

GET /ports/info Returns status of the ports

DESCRIPTION
Returns status and other information about the ports. Don't use if performance is a concern!

RESPONSES
Uses default content-types: application/json

200 OK
Port info.

EXAMPLE

{
"result": [
{
"properties": {
"admin_status": "PORT_UP",
"duplex": "Full (auto)",
"if_name": "eth-0-1",
"link_status": "LINK_UP",
"mac_addr": "00:1e:08:0a:0d:78",
"port_no": 1,
"speed": "1Gb (auto)"
},
"type": "object"
}
]
}

PROPERTIES
result: object
PROPERTIES
port_no: string
Port ID, e.g. 1.

EXAMPLE

file:///C:/Users/fabia/Downloads/rest_api (1).html 45/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

if_name: string
Interface name, e.g. eth-0-1.

EXAMPLE

"eth-0-1"

admin_status: string , x ∈ { "PORT_UP" , "PORT_DOWN" }


Set port status

link_status: string , x ∈ { "LINK_UP" , "LINK_DOWN" }


Link status.

duplex: string
Current duplex status, and duplex setting in parentheses

mac_addr: string
MAC address of the interface, hex bytes separated using colons

speed: string
Current speed, and speed setting in parentheses, e.g. 1Gb (auto)

EXAMPLE

"1Gb (auto)"

default
Error state.

Error

GET /ports/sfpstatus Returns information about the SFPs

DESCRIPTION
Returns the status of all SFPs.

RESPONSES
Uses default content-types: application/json

200 OK
Port counters.
file:///C:/Users/fabia/Downloads/rest_api (1).html 46/80
20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

EXAMPLE

{
"result": "Port port-6 transceiver info: \nTransceiver Type: 1000BASE-T\n
\\ Transceiver Vendor Name : CISCO-FINISAR \n Transceiver PN \\ : GE
GB3RC-C \n Transceiver S/N : EC1501064242\\ \nTransceiver Out
put Wavelength: N/A\nSupported Link Type and\\ Length: \n Link Length for
copper: 100 m\nDigital diagnostic\\ is not implemented.\n"
}

PROPERTIES
result: string
All the SFP info formatted for fixed-width display (e.g. a terminal)

default
Error state.

Error

GET /ports/stats Returns the counters of all ports

DESCRIPTION
Returns the counters of all ports.

RESPONSES
Uses default content-types: application/json

200 OK
Port counters.

ITEMS
object
PROPERTIES
portnum: string
ID of the port

rxpkts: integer
Number of received packets

rxbytes: integer
Number of received bytes

file:///C:/Users/fabia/Downloads/rest_api (1).html 47/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

rxdrop: integer
Number of packets dropped on receiving

rxerrs: integer
Total number of packets dropped due to rx errors (sum or greater than rxframe+rxover+rxcrc)

rxframe: integer
Number of packets dropped due to frame alignment errors

rxover: integer
Number of packets dropped due to rx overrun

rxcrc: integer
Number of packets dropped due to CRC errors

txpkts: integer
Number of transmitted packets

txbytes: integer
Number of transmitted bytes

txdrop: integer
Number of packets dropped on sending

txerrs: integer
Total number of packets dropped due to tx errors (equal or greater than txcoll)

txcoll: integer
Number of packets dropped due to collisions

default
Error state.

Error

DELETE /rules Deletes a rule

DESCRIPTION
Deletes the specified rule. A rule is identified by all match fields (including priority), all other fields are
ignored and can be omitted.

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

file:///C:/Users/fabia/Downloads/rest_api (1).html 48/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Data
Name Description Type type

priority Priority of the rule to delete. query integer required


,{x∈
ℤ|0≤
x≤
65535
}

match[(MATCH_FIELD)]... (MATCH_FIELD) is placeholder for fields like query string required


'in_port' which make up the match of a rule
and this way unambiguously identify it
(together with the priority).

Depending on the match field in question the


value might not matter and can be set to ''.

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

POST /rules Adds a rule

DESCRIPTION
Adds the given rule.

User level has to be higher or equal to WRITE.

file:///C:/Users/fabia/Downloads/rest_api (1).html 49/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

REQUEST PARAMETERS

Data
Name Description Type type

name Name of the rule. query string

cookie Optional cookie value for identification. query string

description Description of the rule. query string required

priority Priority of the rule. Higher priority rules are query integer required
tried first, each packet can only be matched ,{x∈
by a single rule. ℤ|0≤
x≤
65535
}

match[(MATCH_FIELD)]... (MATCH_FIELD) is placeholder for fields like query string required


'in_port' which make up the match of a rule
and this way unambiguously identify it
(together with the priority).

actions String with all actions (order matters!) query string required
separated by ','.

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

file:///C:/Users/fabia/Downloads/rest_api (1).html 50/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

PUT /rules Modifies a rule

DESCRIPTION
Modifies an existing rule. Modifies the actions, the name or the description of a specified rule. The rule is
identified by its match fields (including priority). The match (including priority) cannot be modified.

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Data
Name Description Type type

name New name of the rule. query string

cookie Cookie value for identification. query string required

description New description of the rule. query string required

priority Priority of the rule to edit. If empty 32768 is query integer


assumed. ,{x∈
ℤ|0≤
x≤
65535
}

match[(MATCH_FIELD)]... (MATCH_FIELD) is placeholder for fields like query string required


'in_port' which make up the match of a rule
and this way unambiguously identify it
(together with the priority).

Depending on the match field in question the


value might not matter and can be set to ''.

actions New string of all actions (order matters!), query string required
separated by ','.

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

file:///C:/Users/fabia/Downloads/rest_api (1).html 51/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Error

SECURITY

Schema Scopes

Write_Rights_Required

DELETE /rules/all Deletes all rules

DESCRIPTION
Deletes all active rules.

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

GET /rules/all Returns all rules

DESCRIPTION
Returns all active rules on this device.

RESPONSES

file:///C:/Users/fabia/Downloads/rest_api (1).html 52/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Uses default content-types: application/json

200 OK
An object containing all active rules on this device.

PROPERTIES
rules: object[]
ITEMS
RuleOutput

used_flows: integer
Number of TCAM flows utilized.

default
Error state.

Error

DELETE /rules/counters Resets all rule counters

DESCRIPTION
Resets the packet and byte counters of all rules.

User level has to be higher or equal to WRITE.

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

file:///C:/Users/fabia/Downloads/rest_api (1).html 53/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Schema Scopes

Write_Rights_Required

GET /savepoints Returns all rule and port save-points

DESCRIPTION
Returns all rule and port save-points.

RESPONSES
Uses default content-types: application/json

200 OK
Rule and port save-points.

PROPERTIES
RuleSavePoints: object[]
ITEMS
RuleSavePoint

PortSavePoints: object[]
ITEMS
PortSavePoint

default
Error state.

Error

PUT /savepoints/activeportsavepoint Activates a port save-point

DESCRIPTION
Activates a port save-point with the given name.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

file:///C:/Users/fabia/Downloads/rest_api (1).html 54/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Name Description Type Data type

name Name of the port save point to activate. query string required

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

PUT /savepoints/activerulesavepoint Activates a rule save-point

DESCRIPTION
Activates a rule save-point with the given name making all rules and group active (or at least trying to,
success depends on e.g. whether it matches the current port settings). Does not make the rule save-point
permanent.

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Name Description Type Data type

name Name of the port save point to activate query string required

RESPONSES
Uses default content-types: application/json

200 OK
file:///C:/Users/fabia/Downloads/rest_api (1).html 55/80
20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

PUT /savepoints/defaultrulesavepoint Sets a rule save-point to be loaded on boot

DESCRIPTION
Sets the rule save-point with the given name to be loaded on boot Does not make it active before next
boot. There can be only one to be loaded on boot.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

name Name of the port save point to set to be loaded on boot query string required

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

file:///C:/Users/fabia/Downloads/rest_api (1).html 56/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

SECURITY

Schema Scopes

Super_Rights_Required

GET /savepoints/export Returns selected rule and port save-points

DESCRIPTION
Returns selected rule and port save-points (selected by names).

REQUEST PARAMETERS

Name Description Type Data type

rule_save_point_names Rule save-points to be exported. query string[]

port_save_point_names Port save-points to be exported. query string[]

RESPONSES
Uses default content-types: application/json

200 OK
Rule and port save-points.

PROPERTIES
meta_data: object
PROPERTIES
device: string
Device Model of the Device this Savepoint was created on.

software_version: string
Software Version of the Device this Savepoint was created on.

RuleSavePoints: object[]
ITEMS
RuleSavePoint

PortSavePoints: object[]
ITEMS
PortSavePoint

file:///C:/Users/fabia/Downloads/rest_api (1).html 57/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

default
Error state.

Error

POST /savepoints/modportsavepoint Modifies an existing port save-point

DESCRIPTION
Renames the port save-point with the given name given in "oldname" to the name given in "newname". If
the "override" parameter is equal to "true" the the currently active ports get saved into this port save point,
thereby overwriting all existing ports in that save-point. Also modifies the description to the and the
description given in "description". The description will not be modified if the "description" parameter is not
set or "null".

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Data
Name Description Type type

old_name Existing name of the port save point query string required

new_name New name of the port save point query string required

description Description of port save point (default is empty) query string

override If "true" (which is the default), save the currently active ports query boolean
into this save-point

RESPONSES
Uses default content-types: application/json

200 OK
Port save point in question.

PROPERTIES
portSavePoints: object[]
ITEMS
PortSavePoint

default

file:///C:/Users/fabia/Downloads/rest_api (1).html 58/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

POST /savepoints/modrulesavepoint Modifies an existing rule save-point

DESCRIPTION
Modifies an existing rule save-point. Renames the rule save-point with the given name given in "oldname"
to the name given in "newname". If the "override" parameter is equal to "true" the the currently active rules
get saved into this rule save point, thereby overwriting all existing rules in that save-point. Also modifies the
description to the and the description given in "description". The description will not be modified if the
"description" parameter is not set or "null".

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Data
Name Description Type type

old_name Existing name of the rule save point query string required

new_name New name of the rule save point query string required

description Description of rule save point (default is empty) query string

override If "true" (which is the default), save the currently active rules query boolean
into this save-point

RESPONSES
Uses default content-types: application/json

200 OK
Rule save point in question.

RuleSavePoint

file:///C:/Users/fabia/Downloads/rest_api (1).html 59/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

DELETE /savepoints/portsavepoint Deletes a port save-point

DESCRIPTION
Deletes the port save-point with the given name if it exists.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

name Name of the port save point to delete query string required

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

file:///C:/Users/fabia/Downloads/rest_api (1).html 60/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Schema Scopes

Super_Rights_Required

POST /savepoints/portsavepoint Creates a new port save-point from current port settings

DESCRIPTION
Saves the current port config into a new port save-point with the name given in "name" and the description
given in "description". Returns the new port save-point.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

name Name of new rule save point. query string

description Description of new rule save point. query string

RESPONSES
Uses default content-types: application/json

200 OK
New port save point.

PortSavePoint

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

PUT From current rules/groups creates a 'Quicksave' rule save-point set to load on boot
/savepoints/quicksaverules
file:///C:/Users/fabia/Downloads/rest_api (1).html 61/80
20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

DESCRIPTION
Saves the currently active rules and groups into a rule save-point with the name 'Quicksave' which will be
set to load on boot. Any already existing rule save-point by this name will be replaced. User level has to be
higher or equal to WRITE.

RESPONSES
Uses default content-types: application/json

200 OK
The rule save-point in question.

PROPERTIES
RuleSavePoints: object[]
ITEMS
RuleSavePoint

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

DELETE /savepoints/rulesavepoint Deletes a rule save-point

DESCRIPTION
Deletes the rule save-point with the given name if it exists.

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Name Description Type Data type

name Name of the rule save point to delete query string required

file:///C:/Users/fabia/Downloads/rest_api (1).html 62/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

POST /savepoints/rulesavepoint Creates a new rule save-point from current rules/groups

DESCRIPTION
Saves the currently active rules and groups into a new rule save-point with the name given in "name" and
the description given in "description". Returns the new rule save-point.

User level has to be higher or equal to WRITE.

REQUEST PARAMETERS

Name Description Type Data type

name Name of new rule save point. query string

description Description of new rule save point. query string

RESPONSES
Uses default content-types: application/json

200 OK
New rule save point.

RuleSavePoint

file:///C:/Users/fabia/Downloads/rest_api (1).html 63/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

default
Error state.

Error

SECURITY

Schema Scopes

Write_Rights_Required

DELETE /users Deletes an user

DESCRIPTION
Deletes a web UI user account.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

name User name of the account to delete. query string required

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

file:///C:/Users/fabia/Downloads/rest_api (1).html 64/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Schema Scopes

Super_Rights_Required

GET /users Returns all users

DESCRIPTION
Returns all web UI user accounts.

RESPONSES
Uses default content-types: application/json

200 OK
User accounts.

PROPERTIES
(USER_NAME): object
User name info object, (USER_NAME) stands for the user in question.

PROPERTIES
userid: integer
Internal user ID.

username: string
Username.

accesslevel: integer , x ∈ { "1" , "7" , "31" }


Access level; 1 = READ, 7 = WRITE, 31 = SUPER.

description: string
User account description.

default
Error state.

Error

POST /users Adds an user

DESCRIPTION
Adds a web UI user account.
file:///C:/Users/fabia/Downloads/rest_api (1).html 65/80
20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

username New user name. query string required

accesslevel New access level; 1 = READ, 7 = WRITE, 31 = query integer , x ∈ { "1" required
SUPER. , "7" , "31" }

password New password. query string required

description New user account descriptions. query string required

radius If this is true, this user's password is checked query boolean required
against the RADIUS server.

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

PUT /users Modifies an user

DESCRIPTION
Modifies an existing web UI user account.

file:///C:/Users/fabia/Downloads/rest_api (1).html 66/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Name Description Type Data type

username Current user name. query string required

new_username New user name. query string required

password New password. query string

description New user account description. query string required

access_level New access level; 1 = READ, 7 = WRITE, 31 = query integer , x ∈ {


SUPER. "1" , "7" , "31" }

radius If this is true, this user's password is checked query boolean required
against the RADIUS server.

RESPONSES
Uses default content-types: application/json

200 OK
Result state.

Result

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

GET /users/radius Gets the RADIUS config

DESCRIPTION

file:///C:/Users/fabia/Downloads/rest_api (1).html 67/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Gets the RADIUS basic configuration.

User level has to be higher or equal to SUPER.

RESPONSES
Uses default content-types: application/json

200 OK
UAC state.

PROPERTIES
enabled: boolean
Whether the RADIUS setting is enabled.

server: string
IP address or hostname of the RADIUS server.

port: integer
UDP port of the RADIUS server.

secret: string
RADIUS secret required to communicate with the RADIUS server.

radius_login_level: integer
RADIUS login level, either of [0 (No access), 1 (read access), 7 (write access), 31 (super user
access)] Determines what user access level any user has, that loggs in via RADIUS, but does not
have a local user profile.

refresh_rate: integer
Determines how many seconds a RADIUS session will be cached.

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

POST /users/radius Sets the RADIUS config

file:///C:/Users/fabia/Downloads/rest_api (1).html 68/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

DESCRIPTION
Sets the basic RADIUS configuration.

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Data
Name Description Type type

server IP address or hostname of the RADIUS server. query string required

port UDP port of the RADIUS server. query integer required

secret RADIUS secret required to communicate with the query string required
RADIUS server.

radius_login_level RADIUS login level, either of [0 (No access), 1 (read query integer required
access), 7 (write access), 31 (super user access)]
Determines what user access level any user has, that
loggs in via RADIUS, but does not have a local user
profile.

refresh_rate Determines how many seconds a RADIUS session query integer required
will be cached.

RESPONSES
Uses default content-types: application/json

200 OK
UAC state.

PROPERTIES
state: boolean
Boolean value indicating whether user access control is activated (true = on).

default
Error state.

Error

SECURITY

Schema Scopes

file:///C:/Users/fabia/Downloads/rest_api (1).html 69/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Schema Scopes

Super_Rights_Required

GET /users/uac Returns the UAC state

DESCRIPTION
Returns the state of the UAC (mandatory user authentication and access control) setting, whether it is
enabled or not.

RESPONSES
Uses default content-types: application/json

200 OK
UAC state.

PROPERTIES
state: boolean
Boolean value indicating whether user access control is activated (true = on).

default
Error state.

Error

POST /users/uac Sets the UAC state

DESCRIPTION
Sets the state of UAC (mandatory user authentication and access control).

User level has to be higher or equal to SUPER.

REQUEST PARAMETERS

Data
Name Description Type type

state New UAC state, true = active mandatory auth. and access query boolean required
control

file:///C:/Users/fabia/Downloads/rest_api (1).html 70/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

RESPONSES
Uses default content-types: application/json

200 OK
UAC state.

PROPERTIES
state: boolean
Boolean value indicating whether user access control is activated (true = on).

default
Error state.

Error

SECURITY

Schema Scopes

Super_Rights_Required

Schema definitions
App: object

PROPERTIES
canBeInstantiated: boolean
Whether an instance of the app can be started. False e.g. for apps which for which there can be only one
instance running at the same time and this currently being the case.

paramFormat: object[]
Tuple consisting of:

Internal unique parameter name.


Human-readable name of the parameter.
Input Type.
Help text.
JS code. If the result of executing this code is false then this field is to be hidden.
Default value of this field.

ITEMS
object

name: string
Name of the app.
file:///C:/Users/fabia/Downloads/rest_api (1).html 71/80
20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

actions: object[]
ITEMS
object

description: string
Description of the app.

Error: object

PROPERTIES
error: string
Error info

GroupInput: string

DESCRIPTION
(GID) stands for the group number.

EXAMPLE

{
"(GID)": {
"buckets": [
{
"actions": "<Actions for that bucket, similar to rule actions, sep
erated using commas>",
"watch_port": "<ID of the watch port>"
}
],
"group_id": "<Unique ID of the group>",
"type": "<'select' for loadbalancing; 'ff' for fast failover; 'all' clones
the traffic and executes all buckets>"
}
}

GroupOutput: object

EXAMPLE

file:///C:/Users/fabia/Downloads/rest_api (1).html 72/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

{
"buckets": [
{
"actions": "push_vlan:0x8100, set_field:4->vlan_vid, output:2",
"watch_port": 3
},
{
"actions": "push_vlan:0x8100, set_field:7->vlan_vid, output:5",
"watch_port": 6
}
],
"description": "test",
"group_id": 1,
"type": "ALL"
}

PROPERTIES
group_id: integer
Unique integer ID of the group

type: string
select for loadbalancing, ff for fast failover, all for cloning the traffic and executing all buckets

buckets: object[]
Bucket-related properties

ITEMS
object
PROPERTIES
watch_port: string
ID of the watch_port

actions: string
String containing all actions of that bucket

PortConfig: object

DESCRIPTION
Port config.

EXAMPLE

file:///C:/Users/fabia/Downloads/rest_api (1).html 73/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

{
"duplex": "auto",
"ifName": "1",
"mediaType": "auto-select",
"shutdown": false,
"speed": "auto",
"type": 1
}

PROPERTIES
if_name: string required
Interface Name, e.g. "eth-0-1" or "eth-0-1/1".

EXAMPLE

"eth-0-1/1"

type: integer , { x ∈ ℤ | 1 ≤ x ≤ 11 } required


1. RJ45;
2. SFP, 1G only;
3. Switchabe RJ45 to SFP, 1G only;
4. SFP, 1G or 10G, changing speed requires reboot;
5. SFP, 10G only;
6. QSFP, 40G, splittable to 4x10G or 4x1G (breakout cable). Splitting requires reboot;
7. QSFP, 40G or 100G, splittable to 4x10G or 4x1G (breakout cable). Splitting requires reboot;
8. QSFP, 40G, splittable to 4x10G or 4x1G (breakout cable or SFP port). Splitting requires reboot;
9. Split version of type 8, split to SFP port. 1G or 10G. Unsplitting requires reboot;
10. Split version of port 6, 7 or 8, split to breakout cable. 1G or 10G. Unsplitting requires reboot;
11. SFP, 1G or 10G, changing speed does not require reboot

media_type: string , x ∈ { "sfp" , "rj45" , "auto" }


Optional field media type, any of ["sfp", "rj45", "auto"]

speed: string , x ∈ { "10" , "100" , "1000" , "10G" , "100G" , "auto" }


Speed setting, can be "10", "100", "1000", "10G", "40G", "100G", or "auto"

duplex: string , x ∈ { "full" , "half" , "auto" }


Duplex setting, can be full, half, or auto

xg_speed: object
Speed level, 1G/XG (XG normally means 10G) for devices which need to reboot for it to take effect

PROPERTIES
currSetting: string , x ∈ { "1G" , "XG" }
Current setting.

nextSetting: string , x ∈ { "1G" , "XG" }


Setting after reboot.

file:///C:/Users/fabia/Downloads/rest_api (1).html 74/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

split: string , x ∈ { "break-out" , "sfp" , "default" }


Whether splittable port is split, can be break-out (split to breakout cable, type 6/7/8 only), sfp (split to
breakout cable, type 8 only), or default

shutdown: boolean required


Boolean controlling whether interface is shut down, otherwise it is up

PortSavePoint: object

DESCRIPTION
(PORT_SAVE_POINT) is a placeholder for the name of the port save-point

PROPERTIES
(PORT_SAVE_POINT)...: object
PROPERTIES
name: string , x ∈ { "(PORT_SAVE_POINT)" }

ports: object[]
ITEMS
PortConfig

readonly: boolean
true if the port save-point cannot be edited/deleted.

type: string , x ∈ { "PortSavePoint" }

description: string
Port save-point description

Result: object

EXAMPLE

{
"result": "OK"
}

PROPERTIES
result: string
Result info, on success often just 'OK'

RuleOutput: object

file:///C:/Users/fabia/Downloads/rest_api (1).html 75/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

EXAMPLE

{
"actions": "output:2",
"cookie": 1152921504606847000,
"datarate": "0 bit/s",
"datarate_raw": 0,
"description": "just an example",
"match": {
"in_port": 1
},
"n_bytes": 0,
"n_packets": 0,
"name": "example",
"priority": 32768,
"real_flow_ct": 1
}

PROPERTIES
cookie: integer
internal ID, maps information like name and description to a rule

name: string
Name of the rule

description: string
Description of the rule

priority: string
Priority value. Higher priority rules are tried first, each packet can only be matched by a single rule.

match: object
Match object with fields that make up match. Some match fields have are only keys, so their values will
simply be empty strings.

ADDITIONAL PROPERTIES
object

actions: string
Actions of this rule in a string seperated using commas

datarate: string
Data rate in a human-readable format

n_bytes: string
Total byte size of all packets matched by this rule

n_packets: string
Number of packets that were handled by this rule

real_flow_ct: integer

file:///C:/Users/fabia/Downloads/rest_api (1).html 76/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

Number of TCAM flows used

RuleSavePoint: object

DESCRIPTION
(RULE_SAVE_POINT) is a placeholder for the name of the rule save-point

EXAMPLE

file:///C:/Users/fabia/Downloads/rest_api (1).html 77/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

{
"Factory Default": {
"description": "Taps the connection between ports 1 and 2 to port 3. Also
taps the connection between ports 5 and 6 to port 4. Does not affect the port con
figuration.",
"flowusage": 4,
"groups": [
{
"buckets": [
{
"actions": "output:1",
"watch_port": "1"
}
],
"description": "",
"group_id": "1",
"type": "ALL"
}
],
"groupusage": 1,
"readonly": false,
"rules": [
{
"actions": [
"output:2",
"output:3"
],
"cookie": "1152921504606846982",
"description": "",
"duration": "49s",
"duration_raw": "49.145",
"hard_age": "",
"match": {
"in_port": "1"
},
"n_bytes": "0",
"n_packets": "0",
"name": "",
"priority": "32768",
"real_flow_ct": 1,
"table": "0"
},
{
"actions": [
"output:4",
"output:5"
],
"cookie": "1152921504606846980",
"description": "",
"duration": "61s",
"duration_raw": "61.094",
"hard_age": "",
"match": {
"in_port": "6"
},
"n_bytes": "0",
file:///C:/Users/fabia/Downloads/rest_api (1).html 78/80
20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

"n_packets": "0",
"name": "",
"priority": "32768",
"real_flow_ct": 1,
"table": "0"
},
{
"actions": [
"output:4",
"output:6"
],
"cookie": "1152921504606846981",
"description": "",
"duration": "55s",
"duration_raw": "55.819",
"hard_age": "",
"match": {
"in_port": "5"
},
"n_bytes": "0",
"n_packets": "0",
"name": "",
"priority": "32768",
"real_flow_ct": 1,
"table": "0"
},
{
"actions": [
"output:1",
"output:3"
],
"cookie": "1152921504606846983",
"description": "",
"duration": "45s",
"duration_raw": "45.061",
"hard_age": "",
"match": {
"in_port": "2"
},
"n_bytes": "0",
"n_packets": "0",
"name": "",
"priority": "32768",
"real_flow_ct": 1,
"table": "0"
}
],
"type": "RuleSavePoint"
}
}

PROPERTIES
(RULE_SAVE_POINT)...: object
PROPERTIES

file:///C:/Users/fabia/Downloads/rest_api (1).html 79/80


20.09.22, 09:13 Cubro Packetmaster RestAPI User Guide

name: string , x ∈ { "(RULE_SAVE_POINT)" }

rules: object[]
ITEMS
RuleOutput

groupusage: integer
How many groups this rule save-point utilizes.

readonly: boolean
true if the port save-point cannot be edited/deleted.

groups: object[]
ITEMS
GroupOutput

type: string , x ∈ { "RuleSavePoint" }

flowusage: integer
How many TCAM flows this rule save-point utilizes.

description: string
Rule save-point description

file:///C:/Users/fabia/Downloads/rest_api (1).html 80/80

You might also like