09-24-2020 03:49 PM
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
Solved! Go to Solution.
09-25-2020 06:19 AM - edited 02-12-2021 10:27 AM
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
09-25-2020 06:19 AM - edited 02-12-2021 10:27 AM
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
09-25-2020 06:38 AM
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.
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.
09-29-2020 08:47 PM - edited 09-29-2020 08:51 PM
For the sample requests, the supported HTTP method is POST
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide