Merge routers

Base URL

The base URL for all requests is:

https://<MACHINE-ADDRESS>/ms-mapDiagnostics/v1/api/mergeRouters

where MACHINE-ADDRESS is the AFA server IP.

Back to top

Retrieve merged routers

Retrieves a list of merged routers with the status "MERGED" only. Merged routers with the status "OUTDATED_MERGED" are excluded.

Resource URL: /mergeRouters/list

Resource Method: GET

Authentication: Cookie with session ID.

Response:

Element

Type

Description

mergedRouters

Array of MergedRoutersData (see MergedRoutersData type )

A list of merged routers with status "MERGED" only.

Response example:

[
   {
      "id":35,
      "name":"router1",
      "status":"MERGED",
      "domainId":0,
      "routersToMerge":[   //List of the the stubs that "router1" contains.
         {
            "id":11,
            "minIp":3628449016,
            "maxIp":3628449016,
            "display":"216.69.188.248",
            "displayRange":"216.69.188.248",
            "optimalDisplay":[
               "216.69.188.248"
            ],
            "singleIP":true,
            "cidr":true,
            "any":false
         },
         {
            "id":10,
            "minIp":175019786,
            "maxIp":175019786,
            "display":"10.110.151.10",
            "displayRange":"10.110.151.10",
            "optimalDisplay":[
               "10.110.151.10"
            ],
            "singleIP":true,
            "cidr":true,
            "any":false
         }
      ],
      "creationTime":1528194887856
   }
]

Back to top

Retrieve merged router statuses

Retrieve the status of the current or the last running process of merged stubs. This request is usually used for an asynchronous process.

Resource URL: /mergeRouters/status

Resource Method: GET

Authentication: Cookie with session ID.

Response:

Element

Type

Description

MergeRouterJobStatus

String

Status of current or last run process of merged routers:

  • RUNNING - Router is in a merge process.
  • MERGED - Router is merged.
  • UNMERGED - Unmerged router.
  • ERROR - Merge process failed.
  • OUTDATED_MERGED - Router merged before or after the last execution. A list of the status for merged routers.

Back to top

Merge routers

Merges routers:

  • Stub routers into a merged router.
  • Merges merged routers into another merged router.
  • Adds stub routers and/or merged routers into a merged router.

Routers that are merged with the API are stored in the DB table 'merge_router_job' and can only be unmerged using the /unmerge API.

Resource URL: /mergeRouters/merge

Resource Method: POST

Authentication: Cookie with session ID.

Request Body Formats:For stub routers:

Parameter

Type

Description

forms

Array of StubsToMerge (see StubsToMerge Type )

List of name for new merged router and IPs of stub routers to add.

async

Boolean

Whether to run the merge process in the background.

To merge merged routers:

Parameter

Type

Description

forms

Array of MergedRoutersToMerge (see MergedRoutersToMerge Type )

List of name of merged router with list of merged routers to add.

async

Boolean

Whether to run the merge process in the background.

To add stub routers and/or merged routers to a merged router.:

Parameter

Type

Description

async

Boolean

Whether to run the merge process in the background.

forms

MixedMergedRouters (see MixedMergedRouters Type )

List of the name of the merged router and the stub and/or mergers routers to add.

Response:

Element

Type

Description

Status

String

Status of merge.

Request examples:

// Merge stub routers
{
  "forms": [
            {
                "name":"mergedRouter1",
                "routerIps":["10.20.1.8/8","192.168.1.1"]
              }
        ],
  "async":true //when true, the merge process will run in the background.
}

// Merge merged routers
{
   "forms":[
      {
         "name":"mergedRouter3",
         "mergedRoutersNames":[
            "mergedRouter1",
            "mergedRouter2"
         ]
      }
   ],
  "async":true
}

// Merge merged routers
{
   "forms":[
      {
         "name":"mergedRouter3",
         "mergedRoutersNames":[
            "mergedRouter1",
            "mergedRouter2"
         ]
      }
   ],
  "async":true
}

// Add stub routers and/or merged routers to a merged router
{
   "async":true,
   "forms":[
      {
         "name":"mergedRouter3",
         "routerIps":[
            "64.202.161.240"
         ],
         "mergedRoutersNames":[
            "mergedRouter1"
         ]
      }
   ]
}

Back to top

Unmerge routers

Unmerges a merged router. Only routers merged by the API and stored in the merged_router_job table can be unmerged with the API.

Resource URL: /mergeRouters/unmerge

Resource Method: POST

Authentication: Cookie with session ID.

Request Body:

Parameter

Type

Description

name

String

Name of router to unmerge.

Response:

Element

Type

Description

status

String

Status of unmerge.

Request example:

{
"name:"router1"
}

Back to top