cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1598
Views
10
Helpful
3
Replies

Multiple changes with one PUT command in a RESTCONF API call

RichardD2
Level 1
Level 1

Using Postman to test API calls to NSO. 

http://nso-server:8080/restconf/data/tailf-ncs:devices/device=leaf1/config/tailf-ned-cisco-ios-xr:interface/"TenGigE=0/0/0/6"

Returns 

{
    "tailf-ned-cisco-ios-xr:TenGigE": {
        "id": "0/0/0/6",
        "description": "<<Ignore - WiP >>",
        "shutdown": [
            null
        ]
    }
}

I would like to update the interface description and no-shut the interface in a single call. Tried with this but no success:

{
	"description": "<<Ignore - WiP >>",
	"shutdown": "true"
}

Also tried without the xml payload with the below after reading that a delete operation is what's needed, but I must have missed something

http://nso:8080/restconf/data/tailf-ncs:devices/device=leaf1/config/tailf-ned-cisco-ios-xr:interface/"TenGigE=0/0/0/6"/shutdown/tags="delete"/
{
    "errors": {
        "error": [
            {
                "error-message": "uri keypath not found",
                "error-tag": "invalid-value",
                "error-type": "application"
            }
        ]
    }
}

 

Anyone have any ideas on how I can accomplish this? Thank you in advance.

2 Accepted Solutions

Accepted Solutions

perander
Cisco Employee
Cisco Employee

Have you tried using YANG Patch, it supports different CRUD operations in the same payload.

View solution in original post

Hi,

 

+1, YANG PATCH is the way to solve this issue. Nothing needed to be added.

For references/examples, check: https://tools.ietf.org/html/rfc8072

 

Roque

View solution in original post

3 Replies 3

perander
Cisco Employee
Cisco Employee

Have you tried using YANG Patch, it supports different CRUD operations in the same payload.

Hi Perander,

Is this something I need to add to my installation of NSO 5.10? Can you provide more info please.

thanks

Richard

Hi,

 

+1, YANG PATCH is the way to solve this issue. Nothing needed to be added.

For references/examples, check: https://tools.ietf.org/html/rfc8072

 

Roque