cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1592
Views
5
Helpful
3
Replies

Get Managed Devices via XML API for CSPC

ekman
Level 1
Level 1

Hello

 

I am trying to find if it is possible to fetch managed devices and their properties such as SNMP version through the XML API in the CSPC platform. I have gone through the User Guide but cannot seem to find any guides how to establish a connection to the CSPC plattform through scripts, or which XML call to perform to get a complete list of devices.

 

Is this possible with the CSPC platform?

BR

Rasmus

1 Accepted Solution

Accepted Solutions

iportuga
Cisco Employee
Cisco Employee

Hi Rasmus,


It is possible. The CSPC XML API is available in this URL endpoint: https://{{CSPC-host}}:8001/cspc/xml

 

Request samples:

 

<!-- Get device list -->
<Request xmlns="http://www.parinetworks.com/api/schemas/1.1" requestId=""> <Manage> <Get operationId="1"> <DeviceList all="true" /> </Get> </Manage> </Request>

 

 

<!-- Get all credentials profile list -->
<Request xmlns="http://www.parinetworks.com/api/schemas/1.1" requestId=""> <Manage> <Get operationId="1"> <DeviceCredentialList all="true" /> </Get> </Manage> </Request>

 

<!-- Get one or multiple credential profiles details -->
<Request xmlns="http://www.parinetworks.com/api/schemas/1.1" requestId=""> <Manage> <Get operationId="1"> <DeviceCredentialList> <DeviceCredential identifier="SNMPv3_credential" /> <DeviceCredential identifier="SNMPv2c_credential" /> <DeviceCredential identifier="SSH_credential" /> </DeviceCredentialList> </Get> </Manage> </Request>

 

Regards,
Igor

 

 

View solution in original post

3 Replies 3

iportuga
Cisco Employee
Cisco Employee

Hi Rasmus,


It is possible. The CSPC XML API is available in this URL endpoint: https://{{CSPC-host}}:8001/cspc/xml

 

Request samples:

 

<!-- Get device list -->
<Request xmlns="http://www.parinetworks.com/api/schemas/1.1" requestId=""> <Manage> <Get operationId="1"> <DeviceList all="true" /> </Get> </Manage> </Request>

 

 

<!-- Get all credentials profile list -->
<Request xmlns="http://www.parinetworks.com/api/schemas/1.1" requestId=""> <Manage> <Get operationId="1"> <DeviceCredentialList all="true" /> </Get> </Manage> </Request>

 

<!-- Get one or multiple credential profiles details -->
<Request xmlns="http://www.parinetworks.com/api/schemas/1.1" requestId=""> <Manage> <Get operationId="1"> <DeviceCredentialList> <DeviceCredential identifier="SNMPv3_credential" /> <DeviceCredential identifier="SNMPv2c_credential" /> <DeviceCredential identifier="SSH_credential" /> </DeviceCredentialList> </Get> </Manage> </Request>

 

Regards,
Igor

 

 

ekman
Level 1
Level 1

Hello Igor!


Thanks a lot for the help, it does solve my needs at this point completely. Follow up question, when I try to browse to the URL you provided in the start, I get a 405 error back. Do I need to CURL the URL from the CLI in order to get the available APIs?

 

Do you have any documentation in terms of what is required in the header/cookies to perform API calls. If you do not have any available documentation I will just have to do some digging to see which fields are sent to and from the CSPC when I perform the API calls manually through the GUI.

 

HTTP Status 405 – Method Not Allowed


Type Status Report

Message Method Not Allowed

Description The method received in the request-line is known by the origin server but not supported by the target resource.


Apache Tomcat/8.5.51

For the sample requests, the supported HTTP method is POST