arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

FLOW

The below API's are used to configure flows with rules. It creates a traffic stream between the network and tool port, the traffic can be managed by configuring rule(s) to permit/deny matching traffic

hashtag
Configure Flow

Request URL

/api/config/flows

Description

Use this API to configure flow parameters for the open packet broker

hashtag
Get Flow Information

hashtag
Configure Flow Rule

Get Flow Rule Information

hashtag
Get Flow rule status

hashtag
Configure Flow Rule Override action

hashtag
Get Flow Rule Override action Information

hashtag
Delete Flow Rule

hashtag
Delete Flow Rule Override action

Delete Flow

Method

POST

Request Body

{

"alias" : "flow1",

"status" : "enable | disable",

"comment" : "test string",

"from" : ["Ethernet45_1"],

"to" : ["Ethernet46_1"],

"push-vlan" : "vlan-id",

"pop-vlan" : "enable | disable"

}

Response Body

NA

Status code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request is processed successfully

Request URL

/api/info/flows

Description

Use this API to get the configured flow parameters

Method

GET

Request Body

NA

Response Body

{

"flow1": {

"name": "flow1",

"status": "enable",

"config_mgr": "Rest-API",

"to": [ "Ethernet46_1" ],

"comment": "vlan traffic test",

"from": [ "Ethernet45_1" ]

}

}

Status code

  • SERVER_ERROR(500) if there is any error with the server

  • Response status in the pretty output format shown above

Request URL

/api/config/flow/<flow-name>/rules

Description

Use this API to configure the OPB rule specific parameters

Method

POST

Request Body

{

"rule_id" : "10",

"action" : "permit",

"comment" : "test",

"vlan" : "100",

"ethertype" : "0x8100",

"src_ip" : "1.1.1.1",

"src_mask" : "255.255.255.0",

"dst_ip" : "2.2.2.2",

"dst_mask" : "255.255.255.0",

"dscp" : "5",

"ttl" : "4",

"protocol" : "6",

"src_l4port" : "56",

"dst_l4port" : "78",

"tcpctl" : "0x5",

"tcpctl_mask" : "0xff",

"tosval" : "3",

"match_all" : "disable",

"counters" : "enable"

}

Response Body

NA

Status code

  • SERVER_ERROR(500) if there is any error with the server

  • Response status in the pretty output format shown above

Request URL

/api/info/flows/<flow-name>/rules

Or

/api/info/flows/<flow-name>/rules/<rule-id>

Description

Use this API to get the configured rules from the system

Method

GET

Request Body

NA

Response Body

{

"flow1|355": {

"ipdst": "2.2.2.2",

"src_mask": "255.255.255.0",

"match_all": "disable",

"comment": "Example-rule-created",

"ipsrc": "1.1.1.1",

"dst_mask": "255.255.255.0",

"map_name": "flow1",

"rule_id": "355",

"action": "permit",

"counters": "enable"

}

}

Status code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request completes successfully

Request URL

/api/info/flows/<flow-name>/rules/<rule-id>/status

Description

Use this API to get the configured rules hardware status and packets from the system

Method

GET

Request Body

NA

Response Body

{

"map_name": "flow1",

"rule_id": "2",

"status": "Active",

"Total-packets": "0"

}

Status code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request completes successfully

Request URL

/api/config/flows/<flow-name>/rules/<rule-id>/override

Description

Use this API to configure the OPB rule override actions

Method

POST

Request Body

{

"override-to": ["Ethernet12", "Ethernet4", "Ethernet8"],

"override-push-vlan-tag": "100",

"override-pop-vlan": "disable"

}

Response Body

NA

Status code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request completes successfully

Request URL

/api/info/flows/<flow-name>/rules/<rule-id>/override

Description

Use this API to get the configured rules override actions from the system

Method

GET

Request Body

NA

Response Body

{

"override-to": ["Ethernet12", "Ethernet4", "Ethernet8"],

"override-push-vlan-tag": "100",

"override-pop-vlan": "disable"

}

Status code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request completes successfully

Request URL

/api/config/flows/<flow-name>/rules/<rule-id>

Description

Use this API to delete the configured rule with id <rule-id> inside <flow-name>

Method

DELETE

Request Body

NA

Response Body

NA

Status code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request completes successfully

Request URL

/api/config/flows/<flow-name>/rules/<rule-id>/override

Description

Use this API to delete the overrides configured on the map rule

Method

DELETE

Request Body

NA

Response Body

NA

Status code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request completes successfully

Request URL

/api/config/flows/<flow-name>

Description

Use this API to delete the configured <flow-name> in the system

Method

DELETE

Request Body

NA

Response Body

NA

Status code

  • SERVER_ERROR(500) if there is any error with the server

  • OK(200) if the request completes successfully