cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1330
Views
0
Helpful
3
Replies

rest call to initiate a Yang action - how to send in inputs.

previousqna
Level 5
Level 5

Hi,

 

 

I wanted to have a rest call to initiate a yang action:

 

 

container  GWServiceValidation {

 

      description "Gateway service validation";

 

 

      tailf:action validate-gwservice {

 

        tailf:info "Validate SAEGW/MME gateway standalone";

 

        tailf:actionpoint GWService-validation-point;

 

                input {

 

                        leaf device {

 

                        type leafref {

 

                           path "/ncs:devices/ncs:device/ncs:name";

 

                        }

 

                        }

 

 

                        leaf gw_type {

 

                                type enumeration {

 

                                        enum SAEGW;

 

                                        enum MME;

 

                                }

 

                        }

 

                }

 

        output {

 

          uses action-output;

 

        }

 

      }

 

 

 

So I used a post command as follows – but get that device cannot be a child. Can anyone point me quickly to the correct syntax to provide the leaf parameters into the action?

 

 

1 Accepted Solution

Accepted Solutions

previousqna
Level 5
Level 5

I believe you need an <input> element around the parameters.

View solution in original post

3 Replies 3

previousqna
Level 5
Level 5

I believe you need an <input> element around the parameters.

Your request pay load on the screen shot is actually not a valid XML file since it doesn’t have root.

 

I can’t verify, but a valid payload may be something look like this:

 

 

<?xml version="1.0" encoding="UTF-8" ?>

 

                <input>

 

                                < device >mano</device>

 

                                < gw_type >MME</ gw_type >

 

                </input>

 

 

Good luck!

Thanks,

 

 

[NAME] sent same and it worked!

Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?