Forum Discussion

DevBabu_174449's avatar
Mar 26, 2015

bigsuds and icontrol

I am trying to create monitor using bigsuds. Everything is fine. I am trying to setup string receive value using below code.

 

SEND is configured correctly but RECEIVE never gets configured. I see recv as none when list ltm monitor http all properties.

 

Code

try: b.LocalLB.Monitor.set_template_string_property([template_name],[{'type':'STYPE_SEND', 'value':send_string},{'type':'STYPE_RECEIVE', 'value':recv_string}]) except Exception, e: print e

 

Any thoughts.

 

3 Replies

  • In looking at that API method, it seems to deviate from the standard format for our "bulk" operations. In seeing that the two parameters are 1-d arrays, most likely what is happening is that the server is looking at the 1st parameter and for each item in that array it's accessing that index in the second parameter. So for your case, you are passing a single value for the 1st parameter, so it's only looking at the 1st index of the second parameter.

    You can try making the call twice, once for each StringValue, or you could pass the same template twice as the first parameter.

    b.LocalLB.Monitor.set_template_string_property(
      [template_name, template_name],
      [
        {'type':'STYPE_SEND', 'value':send_string},
        {'type':'STYPE_RECEIVE', 'value':recv_string}
      ]
    )
    

    Give that a shot and see if it works...

    -Joe

    • Joe_Pruitt's avatar
      Joe_Pruitt
      Glad to hear it! Most of the API's that allow values like this take a second parameter with a 2-D array to allow for an array of items per item in the first parameter. This method, from it's name (set_template_string_property) implies it only sets one "property". Otherwise the API would have been called set_template_string_preoperties()...