Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Bigsuds - save_configuration

I am new to python and iControl. I am trying to use bigsuds to save a UCS file on the box but I am getting a strange error -

>>> b.System.ConfigSync.save_configuration(['/shared/tmp/test.ucs'],['SAVE_FULL'])
Traceback (most recent call last):
......Output omitted ........
bigsuds.ArgumentError: "['SAVE_FULL']" is not a valid value for System.ConfigSync.SaveMode, expecting: SAVE_FULL, SAVE_HIGH_LEVEL_CONFIG, SAVE_BASE_LEVEL_CONFIG, SAVE_GTM_CONFIG_ONLY

It shows an error with my agrument in the raw list format. If I make the second argument a string then I also get errors -


>>> b.System.ConfigSync.save_configuration(['/shared/tmp/test.ucs'],'SAVE_FULL')
Traceback (most recent call last):
......Output omitted ........
suds.TypeNotFound: Type not found: 'filename'

I dont quite get what I am doing wrong.

0
Rate this Question
Comments on this Question
Comment made 19-Mar-2014 by Patrik Jonsson 3524
I have not used bigsuds, so I'm not familiar with the syntax, but have you tried replacing ['SAVE_FULL'] with a [0]?
0

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I get a similar error -

bigsuds.ArgumentError: "[0]" is not a valid value for System.ConfigSync.SaveMode, expecting: SAVE_FULL, SAVE_HIGH_LEVEL_CONFIG, SAVE_BASE_LEVEL_CONFIG, SAVE_GTM_CONFIG_ONLY
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

So I have seen from the error messages what the function arg names should be and I tried this -

>>> b.System.ConfigSync.save_configuration(filename = '/shared/tmp/test.ucs',save_flag = 'SAVE_FULL')
Traceback (most recent call last):
bigsuds.ServerError: Server raised fault: 'Exception caught in System::urn:iControl:System/ConfigSync::save_configuration()
Common::InvalidArgument
'
>>>

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

So I turned on suds debugging and saw the the F5 was rejecting the save mode "SAVE_FULL". I tried using the save mode of "SAVE_HIGH_LEVEL_CONFIG" and that works just fine. I would post the XML from the debug but I'm having quite the formatting meltdown trying to post the XML snippets.

Here is the output without debugging -

>>> b.System.ConfigSync.save_configuration(filename = '/var/local/ucs/test.ucs',save_flag = 'SAVE_FULL')
Traceback (most recent call last):
....Output omitted......
bigsuds.ServerError: Server raised fault: 'Exception caught in System::urn:iControl:System/ConfigSync::save_configuration()
Common::InvalidArgument
'

I dont know why the F5 would reject the save mode when it is listed in the API documentation.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I figured out what I was doing wrong. The reason the other save modes where working is because the ignore the filename attribute. In my iControl call I was specifying the full file path where I wanted to put the file. This was habit I had from doing it in TMSH where you could specify the full path.

However, with the iControl call you can only specify the filename (not the path) and it will put the file in the default location of /var/local/ucs/.

0