Topic
  • 4 replies
  • Latest Post - ‏2012-05-18T16:35:45Z by Lee Wei
walterHiggins
walterHiggins
2 Posts

Pinned topic How can I find out the names of all parameters of a given fixlet?

‏2012-05-17T09:00:29Z |
I would like to be able to obtain a list of all parameter names for the actions of a given fixlet/task.
Is there any way I can find out if a Fixlet has actions which will require parameters and what those parameter names are?
As far as I can tell , this metadata is not available except for open actions.
  • walterHiggins
    walterHiggins
    2 Posts

    Re: How can I find out the names of all parameters of a given fixlet?

    ‏2012-05-17T11:52:11Z  
    I can get the default action for a fixlet like this...
    
    
    
    default action of bes fixlets whose (name of it = 
    "INSERT-NAME-OF-FIXLET-HERE")
    

    ... but the properties of bes fixlet action are just the following...
    
    content id of <bes fixlet action>: string script of <bes fixlet action>: string script type of <bes fixlet action>: string
    

    ... There seems to be no way to get the list of named parameters expected by a script. I really really don't want to have to try writing a BigFix Action Script interpreter in Javascript to extract the parameter names. Is there an easier way to get the list of parameters?
  • Lee Wei
    Lee Wei
    143 Posts

    Re: How can I find out the names of all parameters of a given fixlet?

    ‏2012-05-17T18:34:57Z  
    You are correct and you are not missing anything.
    Are you trying to find the Parameters so that you can create an Action via the Platform Server API?

    There is an enhancement #11028 to add Action Parameters to the XML interface.
    The BESAPI.FixletActionCreator class has a method AddParameter(name, value), but we will still have to parse to find out the names of the parameters.

    In some code that I write, I parse and then replace the parameters myself.

    Lee Wei
  • jeremylam
    jeremylam
    14 Posts

    Re: How can I find out the names of all parameters of a given fixlet?

    ‏2012-05-17T18:43:11Z  
    Are you referring to the "action parameter query" action script?

    Since the script uses a pretty simple syntax, you can parse it with regexes and string inspectors.

    This session relevance will list all the fixlets on your deployment with default actions that have an action parameter query, along with the parameter name:

    
    ( ( name of it, id of it, name of site of it, ( parenthesized part 1 of it ) of matches ( regex 
    "action parameter query %22([^%22]*)" ) of script of 
    
    default action of it ) ) of bes fixlets whose ( exists 
    
    default action whose ( script of it contains 
    "action parameter query" ) of it )
    
  • Lee Wei
    Lee Wei
    143 Posts

    Re: How can I find out the names of all parameters of a given fixlet?

    ‏2012-05-18T16:35:45Z  
    • jeremylam
    • ‏2012-05-17T18:43:11Z
    Are you referring to the "action parameter query" action script?

    Since the script uses a pretty simple syntax, you can parse it with regexes and string inspectors.

    This session relevance will list all the fixlets on your deployment with default actions that have an action parameter query, along with the parameter name:

    <pre class="jive-pre"> ( ( name of it, id of it, name of site of it, ( parenthesized part 1 of it ) of matches ( regex "action parameter query %22([^%22]*)" ) of script of default action of it ) ) of bes fixlets whose ( exists default action whose ( script of it contains "action parameter query" ) of it ) </pre>
    Nice Jeremy, where is the Like button on this forum?

    Lee Wei