Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Normal response code: 200
  • Error response code: 400 (e.g. invalid action)
  • Response Parameters

    NameInTypeDescription
    resultbodystringoperation execution result 


  • Response Example

    {
        "result": "success"
    }

...



MWAN3

SD-EWAN MWAN3 API provides support to get/create/update/delete MWAN3 Rule, Policy.

MWAN3 Policy

GET /cgi-bin/luci/sdewan/mwan3/v1/policys

...

  • Normal response codes: 200
  • Error response code: 404
  • Response Parameters

    NameInTypeDescription
    namebodystringpolicy name
    membersbodyarraypolicy members
    interfacebodystringmember interface name
    metricbodyint(optional) default: 1, members within one policy with a lower metric have precedence over higher metric members
    weightbodyint(optional) default: 1, members with same metric will distribute load based on this weight value


  • Response Example


    {

          "name": "balanced",

           "members": [

               {

                   "interface": "net1",

                   "metric" 1,

                   "weight": 2

                }

                {

                    "interface": "net2",

                    "metric" 1,

                     "weight": 1

                }

           ]

    }


POST /cgi-bin/luci/sdewan/mwan3/v1/policy

create a new policy

Request:

  • Request Parameters: same with GET's response request

  • Request Example: same with GET's response example


Response

  • Normal response codes: 201
  • Error response codes: 400, 401


PUT /cgi-bin/luci/sdewan/mwan3/v1/policy/{policy}

update a policy

Request:

  • Request Parameters:

    namebody
    NameInTypeDescription
    policypathstringpolicy name
    membersbodyarraypolicy members
    interfacebodystringmember interface name
    metricbodyint(optional) default: 1, members within one policy with a lower metric have precedence over higher metric members
    weightbodyint(optional) default: 1, members with same metric will distribute load based on this weight value


  • Request Example


    {

          "name": "balanced",

           "members": [

               {

                   "interface": "net1",

                   "metric" 1,

                   "weight": 2

                }

                {

                    "interface": "net2",

                    "metric" 1,

                     "weight": 1

                }

           ]

    }


Response

  • Normal response codes: 201204
  • Error response codes: 400, 401, 404


PUT DELETE /cgi-bin/luci/sdewan/mwan3/v1/policy/{policy}

update a new delete a policy

Request:

  • Request Parameters

    NameInTypeDescription
    policypathstringpolicy name
    membersbodyarraypolicy members
    interface


Response

  • Normal response codes: 200
  • Error response codes: 401, 404


MWAN3 Rule

GET /cgi-bin/luci/sdewan/mwan3/v1/rules

Lists all defined rules

Request: N/A

Response

  • Normal response codes: 200
  • Response Parameters

    NameInTypeDescription
    rulesbodyarraya list of defined rules


  • Response Example


    {
        "rules": [

            {

                "name":"default_rule",

                "dest_ip": "0.0.0.0/0"

                "policy": "balanced"

            }

         ]

    }



GET /cgi-bin/luci/sdewan/mwan3/v1/rule/{rule}

Get a rule

Request: N/A

  • Request Parameters

    NameInTypeDescription
    rulepathstringrule name


Response

  • Normal response codes: 200
  • Error response code: 404
  • Response Parameters

    NameInTypeDescription
    namebodystring
    member interface
    rule name
    metricbodyintdefault: 1, members within one policy with a lower metric have precedence over higher metric membersweightbodyintdefault: 1, members with same metric will distribute load based on this weight value
    Request Example

    {

           "members": [

               {

                   "interface": "net1",

                   "metric" 1,

                   "weight": 2

                }

                {

                    "interface": "net2",

                    "metric" 1,

                     "weight": 1

                }

           ]
    policybodystringpolicy used for the rule
    src_ipbodystring(optional) source ip address
    src_portbodystring(optional) source port or port range
    dest_ipbodystring(optional) destination ip address
    dest_portbodystring(optional) destination port or port range
    protobody string (optional) protocol for the rule. Valid values: "tcp", "udp", "icmp", "all"
    familybody string (optional) address family. Valid values: "ipv4", "ipv6", "all" 
    stickybody string (optional) default: 0, allow traffic from the same source ip address within the timeout limit to use same wan interface as prior session 
    timeoutbody int (optional) default: 600,  Stickiness timeout value in seconds


  • Response Example


    {

        "name":"default_rule",

        "dest_ip": "0.0.0.0/0"

         "policy": "balanced"

    }


POST /cgi-bin/luci/sdewan/mwan3/v1/rule

create a new rule

Request:

  • Request Parameters: same with GET's response request

  • Request Example: same with GET's response example


Response

  • Normal response codes: 201
  • Error response codes: 400, 401


PUT /cgi-bin/luci/sdewan/mwan3/v1/rule/{rule}

update a policy

Request:

  • Request Parameters

    NameInTypeDescription
    rulepathstringrule name
    policybodystringpolicy used for the rule
    src_ipbodystring(optional) source ip address
    src_portbodystring(optional) source port or port range
    dest_ipbodystring(optional) destination ip address
    dest_portbodystring(optional) destination port or port range
    protobody string (optional) protocol for the rule. Valid values: "tcp", "udp", "icmp", "all"
    familybody string (optional) address family. Valid values: "ipv4", "ipv6", "all" 
    stickybody string (optional) default: 0, allow traffic from the same source ip address within the timeout limit to use same wan interface as prior session 
    timeoutbody int (optional) default: 600,  Stickiness timeout value in seconds


  • Request Example


    {

        "dest_ip": "0.0.0.0/0"

         "policy": "balanced"

    }


Response

  • Normal response codes: 204
  • Error response codes: 400, 401, 404

...

DELETE /cgi-bin/luci/sdewan/mwan3/v1/policyrule/{policyrule}

delete a new policyrule

Request:

  • Request Parameters

    NameInTypeDescription
    policyrulepathstringpolicy namerule name


Response

  • Normal response codes: 200
  • Error response codes: 401, 404

...