cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
256
Views
10
Helpful
3
Replies
Highlighted
Beginner

Multiple changes with one PUT command in a RESTCONF API call

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.

Everyone's tags (5)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Cisco Employee

Re: Multiple changes with one PUT command in a RESTCONF API call

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

Cisco Employee

Re: Multiple changes with one PUT command in a RESTCONF API call

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

3 REPLIES 3
Cisco Employee

Re: Multiple changes with one PUT command in a RESTCONF API call

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

Beginner

Re: Multiple changes with one PUT command in a RESTCONF API call

Hi Perander,

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

thanks

Richard

Cisco Employee

Re: Multiple changes with one PUT command in a RESTCONF API call

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