Forum Discussion

Conrad_Link_166's avatar
Conrad_Link_166
Icon for Nimbostratus rankNimbostratus
May 21, 2004

saving changes made via ITCMLocalLB.Class

I'm using the ITCMLocalLB.Class iControl functions to modify external string classes (using add_string_class_members and delete_string_class_members). I've found that after adding or removing entries via these methods, the actual changes are not written to disk.

 

 

Is there any way to save these changes to disk that is similar to the "bigpipe save" command line option? The closest I could find was the ITCMSystem.ConfigSync interface which is equivalent to the "bigpipe config save" command line.

 

 

Thanks,

 

Conrad
  • Conrad,

    The behavior of iControl is the same as using the CLI: commands are not persistent until a "save" command is issued.

    As you found, the ConfigSync interface is indeed the place to do this. Since the last SDK release several flags have been added to the SaveMode enum allowing for the equivalent of bigpipe save and bigpipe base save.

     /** 
     * An enumeration of save flags used in configuration save. 
     * 
     * SAVE_FULL Saves a complete configuration that can be used to set up a device from scratch. 
     * SAVE_COMMON Saves only a configuration that can be replicated to other devices. 
     * SAVE_HIGH_LEVEL_CONFIG Saves only the high-level configuration (virtual servers, pools, members, monitors...) 
     * SAVE_BASE_LEVEL_CONFIG Saves only the base configuration (VLANs, self IPs). 
     * 
     **/ 
     enum SaveMode 
     { 
         SAVE_FULL, 
         SAVE_COMMON, 
         SAVE_HIGH_LEVEL_CONFIG, 
         SAVE_BASE_LEVEL_CONFIG 
     };

    The values are [b]SAVE_HIGH_LEVEL_CONFIG which is analogous to bigpipe save and SAVE_BASE_LEVEL_CONFIG which is analogous to bigpipe base save.

    These features were added as of BIG-IP v4.5PTF06. You should be able to query the WSDL

    http://[bigip_address]/iControl/iControlPortal.cgi?WSDL=ITCMSystem.ConfigSync

    and look for the SaveMode type declaration to verify if it is supported on your device.

    BTW, this will be documented in the upcoming iControl SDK v4.6.2 scheduled in July.

    Also, if you get a chance when you get things working, if you could post a summary of what kind of project you are working on we'd love to hear about it. The more information we get about the types of projects are being worked on, helps us with enhancing the product for the future.

    -Joe
  • Joe,

    Thanks. I've got this working, but have a few questions about how to do this better:

    1. Is there any way to avoid specifying the filename to save_configuration and have it fallback to the default? This would be useful in particular for the SAVE_HIGH_LEVEL_CONFIG SAVE_BASE_LEVEL_CONFIG.

    2. Is there any way with SOAP::Lite to programatically access the ITCMSystem.ConfigSync.SaveMode declaration so the numeric equivalent doesn't have to be hardcoded?

    BTW, here's a shortened example of how I got this to work:

    !/usr/bin/perl -w 
     use SOAP::Lite on_fault => sub { my($soap, $res) = @_; 
              die ref $res ? $res->faultstring : $soap->transport->status, "\n"; }; 
      
     $proxy='https://user:pass@bigiphost/iControl/iControlPortal.cgi'; 
     sub SOAP::Transport::HTTP::Client::get_basic_credentials { return 'user' => 'pass'; } 
      
     $class = SOAP::Lite 
             -> service("$proxy?WSDL=ITCMLocalLB.Class"); 
     $cfgsync = SOAP::Lite 
             -> service("$proxy?WSDL=ITCMSystem.ConfigSync"); 
      
     $class->add_string_class_members("myclass", ["mystring"]); 
     $cfgsync->save_configuration("/config/bigip.conf", 2);

    Thanks,

    Conrad
  • Great, thanks for the post!

     

     

    1. Is there any way to avoid specifying the filename to save_configuration and have it fallback to the default? This would be useful in particular for the SAVE_HIGH_LEVEL_CONFIG SAVE_BASE_LEVEL_CONFIG.

     

     

    I thought that an empty string would save to the default file but in looking at the code that is not the case. Currently you can specify a full path "/config/bigip.conf" or just the file name "bigip.conf" for the BASE_LEVEL and HIGH_LEVEL flags. I'll put this in as an enhancement request for a future update.

     

     

    2. Is there any way with SOAP::Lite to programatically access the ITCMSystem.ConfigSync.SaveMode declaration so the numeric equivalent doesn't have to be hardcoded?

     

     

    The way I've done this in the past in perl is to use local variables

     

     

    my $SAVE_FULL = 0; 
     my $SAVE_COMMON = 1; 
     my $SAVE_HIGH_LEVEL_CONFIG = 2; 
     my $SAVE_BASE_LEVEL_CONFIG = 3; 
      
     ... 
     $cfgsync->save_configuration("bigip.conf", $SAVE_HIGH_LEVEL_CONFIG);

     

     

    For the next version of the product, we are moving our enums to strings so you reference the values by name which we believe is much more intuitive. The code would be:

     

     

    $cfgsync->save_configuration("bigip.conf", "SAVE_HIGH_LEVEL_CONFIG");

     

     

    Again, thanks for the code posting. The little bit of time it takes to post it will help others many times over!

     

     

    -Joe