cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
213
Views
0
Helpful
2
Replies

Trying to use curl to create service instance but getting uri path err

logans1597
Level 1
Level 1

Hello, I'm trying to create service instance using a curl found here https://www.postman.com/ciscodevnet/workspace/cisco-devnet-s-public-workspace/request/3224967-a8af0219-3bca-440e-abc9-99c7765ba606

and this is my curl

 

curl --location --globoff --request PATCH 'http://170.20.100.200:8080/restconf/data/itential-demo-port-turn-up:port-turn-up/' \
--header 'Content-Type: application/yang-data+json' \
--header 'Authorization: Basic xxxxxxxxxx' \
--header 'Accept: application/yang-data+json' \
--data '{
    "itential-demo-port-turn-up:port-turn-up": [
        {
                "device": "BIGIP_F5"
        }
    ]
}'

 

here is the service point along with the inputs. 

Screenshot 2024-06-04 at 16.58.56.png

Screenshot 2024-06-04 at 16.59.26.png

When I run the curl, i get the error below and I'm not sure what I'm doing wrong because the URI seems to be correct

{
"errors": {
"error": [
{
"error-message": "uri keypath not found",
"error-tag": "invalid-value",
"error-type": "application"
}
]
}
}

I clicked on the existing service model and here is the path I see. Am I using the wrong path?
Screenshot 2024-06-04 at 17.01.48.png

 

2 Replies 2

No expert here, try to authenticate using the gcloud auth print-access-token command to get an access token, and then use that token in the Authorization header. See if that comes back with anything

--header "Authorization: Bearer $(gcloud auth print-access-token)" \

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Daniel Kratz
Cisco Employee
Cisco Employee

Hi @logans1597 ,
Were you able to fix your NSO api call?
Based on the keypath you shared, it appears that your yang service list has a composite key: device, interface-type, and interface-id. Without examining the specific YANG file, this is a general assumption... but if your service list indeed uses these keys, you need to add them all to your payload.
BR,
Kratz