Flow Forwarding API.
Created Nov 12, 2024 at 10:02 PM

Overview

Overview

The documentation pages in this section describe the RESTful APIs included with FlowGateway Product. It is assumed that the reader has practical knowledge of RESTful APIs, so the documentation does not go into detail about what REST is and how to use it. Instead the documentation focuses on what data can be accessed, how to configure and clear it.

The following operations can be performed via the API:

  • Display Flow Forwarding and Filter settings
  • Configure Flow Forwarding and Filter settings
  • Delete Flow Forwarding and Filter settings

Details about REST resources can be found in the Resources section. This overview continues with how to run these API's.

Authentication

All REST requests must be authenticated. The Authentication section of the Common API describes which authentication methods are presently supported.

Resources

Settings: Display Settings

Displays flow forwarding & flow forwarding filter settings.

GET https://{device}/api/mgmt.flow_forwarding/1.0/settings
Authorization

This request requires authorization.

Response Body

On success, the server returns a response body with the following structure:

  • JSON
[
  {
    "dst_ip": string,
    "dst_port": number,
    "flow_type": string,
    "rewrite_src": boolean,
    "router_ip": [
      string
    ]
  }
]

Example:
[
  {
    "dst_ip": "10.1.1.1", 
    "dst_port": 1234, 
    "flow_type": "NetFlow", 
    "rewrite_src": true, 
    "router_ip": [
      "10.1.1.4", 
      "10.1.1.5"
    ]
  }, 
  {
    "dst_ip": "10.1.1.2", 
    "dst_port": 2345, 
    "flow_type": "sFlow", 
    "rewrite_src": false, 
    "router_ip": [
      "10.1.1.6", 
      "10.1.1.7"
    ]
  }
]
Property Name Type Description Notes
CurrentSettings <array of <object>> List of flow forwarding and filter current settings.
CurrentSettings[CurrentSetting] <object> Flow forwarding and filters. Optional
CurrentSettings[CurrentSetting].dst_ip <string> Destination IP address.
CurrentSettings[CurrentSetting].dst_port <number> Destination Port.
CurrentSettings[CurrentSetting].
flow_type
<string> Flow Type.
CurrentSettings[CurrentSetting].
rewrite_src
<boolean> Overwrite Source.
CurrentSettings[CurrentSetting].
router_ip
<array of <string>> Flow Sources Filter.
CurrentSettings[CurrentSetting].
router_ip[item]
<string> Source IP address. Optional

Settings: Configure Settings

Configures flow forwarding & flow forwarding filter settings.

POST https://{device}/api/mgmt.flow_forwarding/1.0/settings
Authorization

This request requires authorization.

Request Body

Provide a request body with the following structure:

  • JSON
[
  {
    "dst_ip": string,
    "dst_port": number,
    "flow_type": string,
    "rewrite_src": boolean,
    "router_ip": [
      string
    ]
  }
]

Example:
[
  {
    "dst_ip": "10.1.1.1", 
    "dst_port": 1234, 
    "flow_type": "NetFlow", 
    "rewrite_src": true, 
    "router_ip": [
      "10.1.1.4", 
      "10.1.1.5"
    ]
  }, 
  {
    "dst_ip": "10.1.1.2", 
    "dst_port": 2345, 
    "flow_type": "sFlow", 
    "rewrite_src": false, 
    "router_ip": [
      "10.1.1.6", 
      "10.1.1.7"
    ]
  }
]
Property Name Type Description Notes
NewSettings <array of <object>> List of flow forwarding and filter new settings.
NewSettings[NewSetting] <object> Flow forwarding and filters. Optional
NewSettings[NewSetting].dst_ip <string> Destination IP address.
NewSettings[NewSetting].dst_port <number> Destination Port.
NewSettings[NewSetting].flow_type <string> Flow Type.
NewSettings[NewSetting].rewrite_src <boolean> Overwrite Source.
NewSettings[NewSetting].router_ip <array of <string>> Flow Sources Filter.
NewSettings[NewSetting].router_ip[item] <string> Source IP address. Optional
Response Body

On success, the server does not provide any body in the responses.

Settings: Delete Settings

Deletes flow forwarding & flow forwarding filter settings.

DELETE https://{device}/api/mgmt.flow_forwarding/1.0/settings
Authorization

This request requires authorization.

Request Body

Provide a request body with the following structure:

  • JSON
[
  {
    "dst_ip": string,
    "dst_port": number,
    "flow_type": string,
    "rewrite_src": boolean,
    "router_ip": [
      string
    ]
  }
]

Example:
[
  {
    "dst_ip": "10.1.1.1", 
    "dst_port": 1234, 
    "flow_type": "NetFlow", 
    "rewrite_src": true, 
    "router_ip": [
      "10.1.1.4", 
      "10.1.1.5"
    ]
  }, 
  {
    "dst_ip": "10.1.1.2", 
    "dst_port": 2345, 
    "flow_type": "sFlow", 
    "rewrite_src": false, 
    "router_ip": [
      "10.1.1.6", 
      "10.1.1.7"
    ]
  }
]
Property Name Type Description Notes
DeleteSettings <array of <object>> List of Flow Forwarding and filter settings to be deleted.
DeleteSettings[DeleteSetting] <object> Flow forwarding and filters. Optional
DeleteSettings[DeleteSetting].dst_ip <string> Destination IP address.
DeleteSettings[DeleteSetting].dst_port <number> Destination Port.
DeleteSettings[DeleteSetting].flow_type <string> Flow Type.
DeleteSettings[DeleteSetting].
rewrite_src
<boolean> Overwrite Source.
DeleteSettings[DeleteSetting].router_ip <array of <string>> Flow Sources Filter.
DeleteSettings[DeleteSetting].router_ip
[item]
<string> Source IP address. Optional
Response Body

On success, the server does not provide any body in the responses.

Error Codes

In the event that an error occurs while processing a request, the server will respond with appropriate HTTP status code and additional information in the response body:

{
     "error_id":   "{error identifier}",
     "error_text": "{error description}",
     "error_info": {error specific data structure, optional}
}

The table below lists the possible errors and the associated HTTP status codes that may returned.

Error ID HTTP Status Comments
BAD_REQUEST 400 Invalid argument.
AUTH_REQUIRED 401 Authentication required.
AUTH_INVALID_CREDENTIALS 401 Make sure the user name is correct and type your password again. Be sure to use the correct case for the user name and password.
HTTP_INVALID_METHOD 405 Requested method is not available for this resource.
INTERNAL_ERROR 500 Internal error.