cmd: get

Reply
Highlighted
L1 Bithead

cmd: get

The documentation states using metadata type: panos you can use "cmd: get" and I assume use this to 'get' specific data back just like the xml api. I've tried to go through every example out there and can't find any example of this...but I can't get it working on my own. I'm not looking to do a validation, and don't want to use a cli command. Just wanted to build a basic example of grabbing some output via the xml api using skillets...is this supported? @scotchoaf 


Accepted Solutions
Highlighted
L2 Linker

Re: cmd: get

I've added an example of using the 'get' cmd type here: https://panhandler.readthedocs.io/en/master/examples/panos_get.html#example-panos-get Let me know if this helps. Also, happy to add other examples as well if needed. 

View solution in original post


All Replies
Highlighted
L2 Linker

Re: cmd: get

I've added an example of using the 'get' cmd type here: https://panhandler.readthedocs.io/en/master/examples/panos_get.html#example-panos-get Let me know if this helps. Also, happy to add other examples as well if needed. 

View solution in original post

Highlighted
L1 Bithead

Re: cmd: get

Great thanks...I got mine working(ish) by adding the output: sections. Using the Skillet Builder "Skillet Test Tool" I can see that it grabbed the output, but running it like a normal skillet nothing is presented to me.  From your 'get' example page it sounds like maybe I need a workflow and template skillet to display it? I'll have to work more on figuring that part out.

 

I'm confused about outputting to panhandler in general it seems. Even some of the examples I've tried (login and get hostname) just return back to the skillets page after running, without presenting the hostname. (Example: https://github.com/PaloAltoNetworks/Skillets/tree/master/panos/get_system_hostname). 

 

Another question though, is that Panhandler still acts like it needs to perform a commit (I can choose not to of course)...do users just need to know the skillet is using only a 'get' and just tell it not to commit? 

 

Am I just trying to use it for something it's not meant for (which is pushing configs)?


Thanks for the help!

Highlighted
L4 Transporter

Re: cmd: get

Can you share more details about what you want the skillet to do?

 

The get option will pull information from the device and store as a variable value based on the output syntax. This could be a value or list. Since the skillet type is 'panos' the typical output is a configuration action without any output display.

 

How to see or use the output?

 

(1) In the panHandler top right menu you can view contexts and look for the variable and its current value. These are cached and only empty out when you log in and out of panHandler.

 

(2) create a template type skillet and use the variable in a text file rendered to screen.

Template skillet example

This typically requires a workflow skillet to run the 'get' skillet with the template skillet to show the output on screen.

 

(3) use the variable name from the output as a variable in another skillet. similar to above but using the values to perform other actions instead of just display output

 

In terms of a commit, this is based on the skillet type. In panHandler for panos/panorama skillets you have the option to commit when playing the skillet. For rest and other types you have to build a commit command into the skillet.

 

 

Highlighted
L1 Bithead

Re: cmd: get

Awesome thanks.

 

I think I was just trying to use it for the 'wrong' thing. For now I was just building extremely basic Skillets just to prove they work. Part of that was just grabbing some config and outputting it to the user. The 'context' in the upper right hand corner is perfect for just proving to me it did what it was supposed to, and I can go from there.

 

I'll play more with templates/workflow for rendering output as needed, but I think I'm good to go for now. The only other thing I think would be nice is if there is documentation somewhere listing the different output type's/etc that can be used. 

 

Thanks again!

Highlighted
L4 Transporter

Re: cmd: get

glad the context option works.

 

I'm also working to get more builder docs out the door. Early view is at: https://skilletbuilder.readthedocs.io

The testing skillets with panHandler section has some of this conversation included to see/test variables values.

 

Will also have a few tutorials/videos added for the various skillet types.

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!