cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
894
Views
5
Helpful
2
Replies

Yang patch delete to remove a device from a service

topgunkebab99
Level 1
Level 1

Hey there,

 

I'm just grappling with NSO trying to understand the basics, and I'm trying remove a device called juniper6 from an existing service as below:

[edit services base-mgmtinit-junos-single-re]
admin@ncs% show
base-mgmtinit-junos-single-re 100-juniper1 {
    device           [ juniper1 juniper2 juniper3 juniper6 ];
    backup_router_ip 10.10.10.2;
    mgmt_password    password123;
    mgmt_user        admin;
}
[ok][2022-05-12 17:35:23]

so I want to try and remove juniper6 from the above service, so I attempt this in postman using:

{
   "ietf-yang-patch:yang-patch":{
      "patch-id":"patch-1",
      "comment":"delete device from service",
      "edit":[
         {
            "edit-id":"edit1",
            "operation":"remove",
            "target":"/base-mgmtinit-junos-single-re:base-mgmtinit-junos-single-re=100-juniper1/device=juniper6"         }
      ]
   }
}

But I get an error message which I can't seem to find much about as follows:

 

{
    "ietf-yang-patch:yang-patch-status": {
        "patch-id": "patch-1",
        "edit-status": {
            "edit": [
                {
                    "edit-id": "edit1",
                    "errors": {
                        "error": [
                            {
                                "error-tag": "malformed-message",
                                "error-path": "/tailf-ncs:services",
                                "error-message": "juniper6: \"load-error-count\" cannot occur here as a child to 'rpc-reply'."                            }
                        ]
                    }
                }
            ]
        }
    }
}

I'm probably missing something daft.

 

Any ideas?

Thanks!

Jon.

1 Accepted Solution

Accepted Solutions
2 Replies 2

Geevarghese Cheria
Cisco Employee
Cisco Employee

Please have a look at this community discussion which would be helpfull -https://community.cisco.com/t5/nso-developer-hub-discussions/how-can-i-remove-from-nso-a-device-associated-with-device-groups/td-p/3763924

Thanks and Regards,

Geevarghese

Hey thanks for that, I managed it in the end.  Thanks for the link!

Cheers,

Jon.