06-19-2018 03:37 AM - edited 03-01-2019 04:11 AM
Hi ,
Trying to make POST call to add device entry in to the NSO but it is throwing the error for not recognizing ned-id "\"cisco-ios-xr-id:cisco-ios-xr\".
API : POST -> http://10.xxx.xx.xxx:8080/api/running/devices
Body:
{
"device": [
{
"name": "s3cw-e-700",
"address": "127.0.0.1",
"port": 22,
"authgroup": "default",
"device-type": {
"cli": {
"ned-id": "cisco-ios-xr-id:cisco-ios-xr",
"protocol": "ssh"
}
}
}
]
Error:
{
"errors": {
"error": [
{
"error-message": "invalid value for: ned-id in /ncs:devices/ncs:device[ncs:name='s3cw-e-700']/ncs:device-type/ncs:cli/ncs:ned-id: \"cisco-ios-xr-id:cisco-ios-xr\" is not a valid value.",
"error-urlpath": "/api/running/devices",
"error-tag": "malformed-message"
}
]
}
}
}
Tried with the different combo but it doesn't work. As per my understanding, it is not recognizing the".
{
"errors": {
"error": [
{
"error-message": "invalid value for: ned-id in /ncs:devices/ncs:device[ncs:name='s3cw-e-700']/ncs:device-type/ncs:cli/ncs:ned-id: \"cisco-ios-xr\" is not a valid value.",
"error-urlpath": "/api/running/devices",
"error-tag": "malformed-message"
}
]
}
}
Solved! Go to Solution.
06-19-2018 04:09 AM
I tried with below that was working ..
{
"device": [
{
"name": "s3cw-e-700",
"address": "127.0.0.1",
"port": 22,
"authgroup": "default",
"device-type": {
"cli": {
"ned-id": "tailf-ned-cisco-ios-id:cisco-ios-xr",
"protocol": "ssh"
}
}
}
]
}
I have Another question linked to it , why do I always need to give JSON payload with device as a starting-point , why it is not working with below API,
POST -> http://10.xxx.xx.xxx:8080/api/running/devices/device
Body
[
{
"name": "s3cw-e-700",
"address": "127.0.0.1",
"port": 22,
"authgroup": "default",
"device-type": {
"cli": {
"ned-id": "tailf-ned-cisco-ios-id:cisco-ios",
"protocol": "ssh"
}
}
}
]
Error:
{
"errors": {
"error": [
{
"error-message": "POST on list must be on list element",
"error-urlpath": "/api/running/devices/device",
"error-tag": "malformed-message"
}
]
}
}
06-19-2018 04:09 AM
I tried with below that was working ..
{
"device": [
{
"name": "s3cw-e-700",
"address": "127.0.0.1",
"port": 22,
"authgroup": "default",
"device-type": {
"cli": {
"ned-id": "tailf-ned-cisco-ios-id:cisco-ios-xr",
"protocol": "ssh"
}
}
}
]
}
I have Another question linked to it , why do I always need to give JSON payload with device as a starting-point , why it is not working with below API,
POST -> http://10.xxx.xx.xxx:8080/api/running/devices/device
Body
[
{
"name": "s3cw-e-700",
"address": "127.0.0.1",
"port": 22,
"authgroup": "default",
"device-type": {
"cli": {
"ned-id": "tailf-ned-cisco-ios-id:cisco-ios",
"protocol": "ssh"
}
}
}
]
Error:
{
"errors": {
"error": [
{
"error-message": "POST on list must be on list element",
"error-urlpath": "/api/running/devices/device",
"error-tag": "malformed-message"
}
]
}
}
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