04-03-2024 10:11 PM
Hi
I am able to get the the rcm info from the nso cli using the command
adm_nsrivas37@ncs# devices device ORUD0403 live-status exec show rcm info
result
Redundancy Configuration Module:
-------------------------------------------------------------------------------
Context: rcm
Bind Address: 10.193.124.179
Chassis State: Active
Session State: SockActive
Route-Modifier: 30
RCM Controller Address: 10.193.125.3
RCM Controller Port: 9200
RCM Controller Connection State: Connected
Ready To Connect: Yes
Management IP Address: 10.147.13.173
Host ID: ORUD0403
SSH IP Address: 10.147.13.174 (Activated)
SSH IP Installation: Enabled
I am unable to get the same info using rest api it gives me error
curl --location --request POST 'http://localhost:8080/restconf/data/tailf-ncs:devices/device=ORUD0407/live-status/exec:rcm/_operations/show' \
--header 'Accept: application/yang-data+json' \
--header 'Authorization: Basic ########################'
Response
{
"ietf-restconf:errors": {
"error": [
{
"error-type": "application",
"error-tag": "invalid-value",
"error-message": "uri keypath not found"
}
]
}
}
I believe the issue is exec:rcm in the URI .
please let me know what will be the correct uri
Thanks and regards
Nisheeth
Solved! Go to Solution.
04-06-2024 12:37 PM
I did went thru the recommended examples and found the solution.
The URI had issues it was missing tailf-ned type and a payload. I added that and it worked below is the example.
curl --location --globoff 'http://localhost:8080/restconf/operations/tailf-ncs:devices/device=UPFd0407/live-status/tailf-ned-cisco-staros-stats:exec/any' \
--header 'Accept: application/yang-data+json' \
--header 'Authorization: Basic ##############################' \
--header 'Content-Type: application/yang-data+json' \
--data '{
"input":
{
"args": "show rcm info"
}
}'
Response
{
"tailf-ned-cisco-staros-stats:output": {
"result": "\nRedundancy Configuration Module:\r\n-------------------------------------------------------------------------------\r\nContext: rcm \r\nBind Address: #.#.#.#\r\nChassis State: Standby \r\nSession State: SockStandby \r\nRoute-Modifier: 50 \r\nRCM Controller Address: #.#.#.#\r\nRCM Controller Port: 9200 \r\nRCM Controller Connection State: Connected \r\nReady To Connect: Yes \r\nManagement IP Address: #.#.#.#\r\nHost ID: \r\nSSH IP Address: #.#.#.# (Activated)\r\nSSH IP Installation: Enabled"
}
}
04-04-2024 06:08 AM
uri of actions under /devices/device/live-status/exec/ are encoded like RESTCONF/operations/tailf-ncs:devices/device=DEV_NAME/live-status/exec/ACTION
04-04-2024 02:55 PM
I am getting the error I dont know how to put show rcm info after exec
Request
curl --location --request POST 'http://localhost:8080/restconf/data/tailf-ncs:devices/device=ORUD0407/live-status/exec/"show rcm info"' \
--header 'Accept: application/yang-data+json' \
--header 'Authorization: Basic ##################'
Response
{
"ietf-restconf:errors": {
"error": [
{
"error-type": "application",
"error-tag": "invalid-value",
"error-message": "uri keypath not found"
}
]
}
}
04-04-2024 02:58 PM
Earlier i was making the mistake and i corrected that still having error same issue how to put show rcm info because I am getting error invalid path
curl --location --request POST 'http://localhost:8080/restconf/operations/tailf-ncs:devices/device=ORUD0407/live-status/exec/"show rcm info"' \
--header 'Accept: application/yang-data+json' \
--header 'Authorization: Basic ############################'
Response
{
"ietf-restconf:errors": {
"error": [
{
"error-type": "application",
"error-tag": "malformed-message",
"error-message": "invalid path"
}
]
}
}
04-05-2024 12:36 AM
I don't know how the action "show" is modeled, but probably the input parameter to "show" should be in a payload, check your ned model.
04-05-2024 12:39 AM
there's some examples how to encode uri and action input parameters: https://datatracker.ietf.org/doc/html/rfc8040#section-3.6
04-06-2024 12:37 PM
I did went thru the recommended examples and found the solution.
The URI had issues it was missing tailf-ned type and a payload. I added that and it worked below is the example.
curl --location --globoff 'http://localhost:8080/restconf/operations/tailf-ncs:devices/device=UPFd0407/live-status/tailf-ned-cisco-staros-stats:exec/any' \
--header 'Accept: application/yang-data+json' \
--header 'Authorization: Basic ##############################' \
--header 'Content-Type: application/yang-data+json' \
--data '{
"input":
{
"args": "show rcm info"
}
}'
Response
{
"tailf-ned-cisco-staros-stats:output": {
"result": "\nRedundancy Configuration Module:\r\n-------------------------------------------------------------------------------\r\nContext: rcm \r\nBind Address: #.#.#.#\r\nChassis State: Standby \r\nSession State: SockStandby \r\nRoute-Modifier: 50 \r\nRCM Controller Address: #.#.#.#\r\nRCM Controller Port: 9200 \r\nRCM Controller Connection State: Connected \r\nReady To Connect: Yes \r\nManagement IP Address: #.#.#.#\r\nHost ID: \r\nSSH IP Address: #.#.#.# (Activated)\r\nSSH IP Installation: Enabled"
}
}
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