Policy Service (2.6.0)

Download OpenAPI specification:Download

This is the spec that defines the APIs provided by the Policy Service to configure Prefix-list, route-maps data

Health

getHealth

Get the health of the policy service.

Responses

200

OK

get/health
http://gopolicy-service:80/v1/policy/health

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "Service": "string",
  • "MessageBus": "string"
}

PrefixList

getPrefixList

Get prefix list details by type for given device IP address list

query Parameters
type
required
string
Enum: "ipv4" "ipv6"

Type of the prefix lists to retrieve

device_ips
Array of strings >= 0 items

IP addresses of the devices

Responses

200

OK

400

Bad Request.

401

Authorization information is missing or invalid.

404

A device with the specified IP address was not found.

500

Unexpected error.

default

Unexpected error

get/prefix-list
http://gopolicy-service:80/v1/policy/prefix-list

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ]
}

Prefix-List

createPrefixList

Request Body schema: application/json

Create a prefix list

prefix-list-name
string

Name of the prefix list

prefix-list-type
string
Enum: "ipv4" "ipv6"

Type of the prefix lists to create

prefix-list-rules
Array of objects (PrefixListRule)

rules to be added to prefix list

Responses

200

OK

400

Bad Request.

401

Authorization information is missing or invalid.

409

A prefix-list with the specified name already exists.

500

Unexpected error.

default

Unexpected error

post/prefix-list
http://gopolicy-service:80/v1/policy/prefix-list

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "prefix-list-name": "prefixlist_1",
  • "prefix-list-type": "ipv4",
  • "prefix-list-rules":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "prefixlist_v4",
  • "type": "ipv4",
  • "rules":
    [
    ]
}

updatePrefixList

Request Body schema: application/json

Update an existing prefix list

prefix-list-name
string

Name of the prefix list

prefix-list-type
string
Enum: "ipv4" "ipv6"

Type of the prefix lists to create

operation
string
Enum: "add-rule" "remove-rule" "add-device" "remove-device"

Update operation to be performed on prefix list

device-ips
Array of strings

IP addresses of the devices

prefix-list-rules
Array of objects (PrefixListRule)

rules to be added to prefix list

Responses

200

OK

400

Bad Request.

401

Authorization information is missing or invalid.

404

Not Found.

500

Unexpected error.

default

Unexpected error

put/prefix-list
http://gopolicy-service:80/v1/policy/prefix-list

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "prefix-list-name": "prefixlist_1",
  • "prefix-list-type": "ipv4",
  • "operation": "add-device",
  • "device-ips": "10.20.246.1",
  • "prefix-list-rules":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "prefixlist_result":
    {
    },
  • "device_result":
    {
    }
}

deletePrefixList

Delete an existing prefix list by type and name

query Parameters
name
required
string

Name of the prefix-list to be deleted

type
string
Enum: "ipv4" "ipv6"

Type of the prefix-list to be deleted

Responses

200

OK

400

Bad Request.

401

Authorization information is missing or invalid.

404

A prefix-list with the specified name and type was not found.

409

Conflict Request.

500

Unexpected error.

default

Unexpected error

delete/prefix-list
http://gopolicy-service:80/v1/policy/prefix-list

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "prefixlist_v4",
  • "type": "ipv4",
  • "rules":
    [
    ]
}

RouteMap

getRouteMap

Get routemap details for given device IP address list

query Parameters
device_ips
Array of strings >= 0 items

IP addresses of the devices

Responses

200

OK

400

Bad Request.

401

Authorization information is missing or invalid.

404

A device with the specified IP address was not found.

500

Unexpected error.

default

Unexpected error

get/route-map
http://gopolicy-service:80/v1/policy/route-map

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ]
}

createRouteMap

Request Body schema: application/json

Create a route map

name
required
string

Name of the route map

rules
required
Array of objects (RouteMapRule) non-empty

Rule information of route map - contains sequence number and action

Responses

200

OK

400

Bad Request.

401

Authorization information is missing or invalid.

409

A route-map with the specified name, action and sequence number already exists.

500

Unexpected error.

default

Unexpected error

post/route-map
http://gopolicy-service:80/v1/policy/route-map

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "routemap_1",
  • "rules":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ]
}

updateRouteMap

Request Body schema: application/json

Update an existing route map

name
string

Name of the route map

seq
integer

sequence number of route map

operation
string
Enum: "add-device" "remove-device" "update-action"

Update operation to be performed on route map

action
string
Enum: "permit" "deny"

Action of the route map

device-ips
Array of strings

IP addresses of the devices

Responses

200

OK

400

Bad Request.

401

Authorization information is missing or invalid.

404

Not Found.

500

Unexpected error.

default

Unexpected error

put/route-map
http://gopolicy-service:80/v1/policy/route-map

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "routemap_1",
  • "seq": 10,
  • "operation": "add-device",
  • "action": "permit",
  • "device-ips": "10.20.246.1"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "routemap_result":
    {
    },
  • "device_result":
    {
    }
}

deleteRouteMap

Delete an existing route map by name and sequence numbers

query Parameters
name
required
string

Name of the route map to be deleted

sequence_numbers
Array of integers >= 0 items

sequence numbers of the route map to be deleted

Responses

200

OK

400

Bad Request.

401

Authorization information is missing or invalid.

404

A route map with the specified name, action and sequence number was not found.

409

Conflict Request.

500

Unexpected error.

default

Unexpected error

delete/route-map
http://gopolicy-service:80/v1/policy/route-map

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "routemap_result":
    {
    },
  • "device_result":
    {
    }
}

RouteMapMatch

createRouteMapMatch

Request Body schema: application/json

Add a match criteria under a route map

key-info
required
object (RouteMapKeyInfo)
matches
required
object (RouteMapMatches)

Route map match criterias

Responses

200

OK

400

Bad Request.

401

Authorization information is missing or invalid.

409

A route-map match already exists.

500

Unexpected error.

default

Unexpected error

post/route-map-match
http://gopolicy-service:80/v1/policy/route-map-match

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "key-info":
    {
    },
  • "matches":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "routemap_result":
    {
    },
  • "device_result":
    {
    }
}

deleteRouteMapMatch

Delete an existing route map match

Request Body schema: application/json

Delete a match criteria under a route map

key-info
object (RouteMapKeyInfo)
matches
object (RouteMapMatches)

Route map match criterias

Responses

200

OK

400

Bad Request.

401

Authorization information is missing or invalid.

404

A route map with the specified name, action and sequence number was not found.

409

Conflict Request.

500

Unexpected error.

default

Unexpected error

delete/route-map-match
http://gopolicy-service:80/v1/policy/route-map-match

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "key-info":
    {
    },
  • "matches":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "routemap_result":
    {
    },
  • "device_result":
    {
    }
}

Debug

deviceConfigDriftReconcile

This API helps user to generate the config-drift between efa intended and device configuration. If reconcile flag is set then drifted configuration will be reconciled on the device.

query Parameters
ip_address
required
string

IP Addresses of the device for which config drift will be generated.

reconcile
required
boolean
Default: false

Value true implies efa drift with devices will be reconciled

Responses

200

OK

401

Authorization information is missing or invalid.

404

A device with the specified IP was not found.

409

A drift and reconcile operation is already in progress for the device.

500

Unexpected error.

default

Unexpected error

post/debug/device/config/drift
http://gopolicy-service:80/v1/policy/debug/device/config/drift

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "mgmt-ip": "10.10.10.10",
  • "reconciliation-status":
    [
    ],
  • "config-drift":
    {
    }
}

Trouble Shooting

GetRunningConfig

Get the list of all CLIs in Running Config

Responses

200

OK

401

Authorization information is missing or invalid.

500

Unexpected error.

default

Unexpected error

get/runningConfig
http://gopolicy-service:80/v1/policy/runningConfig

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ]
}