Forum Discussion

Mat_58707's avatar
Mat_58707
Icon for Nimbostratus rankNimbostratus
Mar 07, 2012

External String with iControl SDK

Hi there

 

 

I am using iControl SDK v10.2.0 but I cannot manage to write external strings.

 

 

 

For creating internal string I used methods:

 

m_interfaces.getLocalLBClass().create_string_class(m_StringClass);

 

m_interfaces.getLocalLBClass().set_string_class_member_data_value(m_StringClass, membersValues);

 

 

It works fine.

 

Then I tried to create external string.

 

 

1) First I created an external class, which works fine. But I had to create an empty file manualy before:

 

 

LocalLBClassMetaInformation[] localLBClassMetaInformations = new LocalLBClassMetaInformation[1];

 

localLBClassMetaInformations[0] = new LocalLBClassMetaInformation();

 

localLBClassMetaInformations[0].setClass_name("myClass");

 

localLBClassMetaInformations[0].setClass_type(LocalLBClassClassType.CLASS_TYPE_STRING);

 

localLBClassMetaInformations[0].setFile_name("myList.bigip");

 

localLBClassMetaInformations[0].setFile_mode(LocalLBClassFileModeType.FILE_MODE_TYPE_READ_WRITE);

 

localLBClassMetaInformations[0].setFile_format(LocalLBClassFileFormatType.FILE_FORMAT_CSV);

 

 

m_interfaces.getLocalLBClass().create_external_class(localLBClassMetaInformations);

 

 

2) Then I tried to use those methods but without any success, strings are not written anywhere:

 

 

m_interfaces.getLocalLBClass().set_string_class_member_data_value

 

m_interfaces.getLocalLBClass().add_string_class_member

 

 

Or is it really written but I do not see it ?

 

 

Any idea please ??

 

I'm a little bit stuck now...
  • External classes are primarily so you don't have to store large classes in the main bigip.conf configuration file. The contents of the external class is put in a separate file on the file system and a pointer to that file is all that's contained in the bigip.conf file.

     

     

    The way you interface with an external file is different as well. Since it's contents are not maintained within the main configuration, you need to treat it like you would other files in the system. By that, I mean you need to upload/download the entire content if you want to make changes to it. We don't have iControl methods to add/remove items in external files.

     

     

    The System.ConfigSync upload_file and download_file methods will allow you to, well, upload and download files to the system. This is the way you'll need to go if you want to manipulate entries in external files.

     

     

    The methods you were pointing to for set_string_class_member and data_value are for internal string classes, not external.

     

     

    Hope this helps...

     

     

    -Joe
  • Sure it helps !

     

    I understand now what I can do and what I cannot.

     

    Thanks