Is it possible to override the speed of an interface via REST?
search cancel

Is it possible to override the speed of an interface via REST?

book

Article ID: 93510

calendar_today

Updated On:

Products

CA Infrastructure Management CA Performance Management - Usage and Administration DX NetOps

Issue/Introduction

Is there any way to automate an interface's speed creation, modify it, or update it in bulk?

Environment

All supported releases

Resolution

This process can be accomplished by utilizing the Data Aggregator REST web service. 


To perform this process you will need to utilize a 3rd party program to perform the PUT and POST requests needed.  Some examples are Postman and Advanced REST Client (ARC).

First, you need to obtain the interface ID for the interface you would like to modify and for that, you need to obtain the parent device ID.  Let us start in the NetOps Portal GUI under Administration -> Monitored Devices.  Find your target device and access the details page where you can find the device's Item ID:



Take this ID to your chosen REST client and issue the following POST to get all interfaces for the selected device:

Method: POST
URL: http://daHostname:8581/rest/ports/filtered  (If FA DA: http://ProxyHostname:8581/rest/ports/filtered)
Body content type: application/xml
Body:


<FilterSelect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="filter.xsd">
<Filter>
<DeviceComponent.DeviceItemID type="CONTAINS">4810</DeviceComponent.DeviceItemID>
</Filter>
<Select use="exclude" isa="exclude">
<Item use="include">
<Name use="include"/>
</Item>
</Select>
</FilterSelect>



For example, using a parent device of 4810 in the Advanced Rest Client:



From this request, I was able to obtain the ID for my selected interface, FastEthernet0/0.  This ID is 4830.  Now taking that ID you will issue a PUT with the following details:

Method: PUT
URL: http://daHostname:8581/rest/ports/portID   (If FA DA: http://ProxyHostname:8581/rest/ports/filtered)
Body content type: application/xml
Body:


<Port version="1.0.0">
<SpeedOutOverride>1.2E8</SpeedOutOverride>
<SpeedInOverride>1.2E8</SpeedInOverride>
</Port>



In the example we are Overriding the speed to set a speed of 120000000 bps (120 Mbps) instead of the discovered 100000000 bps (100 Mbps):



You can check the results in the NetOps Portal by going to Administration -> Monitored Devices -> Find the original Device -> Polled Metric Families tab.  Then click in the white space next to the Interface Metric Family and the Interface components will display at the bottom.  Take note of the triangles to the top left of the Speed In and Out column entries for the modified device.  This signifies the discovered speed has been overridden.



And if you right-click that interface and click edit:

 

Additional Information

Now that you can modify a singular device, you can spread this methodology out using scripting and CURL or Postman depending on your needs.

An example of a CURL command to acquire the Interface list in the example above:
 

curl --header "Content-Type: application/xml" --request POST --data '<FilterSelect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="filter.xsd"><Filter><DeviceComponent.DeviceItemID type="CONTAINS">4810</DeviceComponent.DeviceItemID></Filter><Select use="exclude"  isa="exclude"><Item use="include"><Name use="include"/></Item></Select></FilterSelect>' --url http://DAhostname:8581/rest/ports/filtered


An example of a CURL command to make the change in the example above:
 

curl --header "Content-Type: application/xml" --request PUT --data '<Port version="1.0.0"><SpeedOutOverride>1.2E8</SpeedOutOverride><SpeedInOverride>1.2E8</SpeedInOverride></Port>' --url http://DAhostname:8581/rest/ports/4830


How to reset/clear previously set Speed Override values:

Attachments

1558696996761000093510_sktwi1f5rjvs16isc.jpeg get_app
1558696995066000093510_sktwi1f5rjvs16isb.jpeg get_app
1558696993373000093510_sktwi1f5rjvs16isa.jpeg get_app
1558696991583000093510_sktwi1f5rjvs16is9.jpeg get_app
1558696989751000093510_sktwi1f5rjvs16is8.jpeg get_app