Forum Discussion

Prakash_Krishna's avatar
Prakash_Krishna
Icon for Nimbostratus rankNimbostratus
May 15, 2015

[iControl-SOAP]Setting Partition and retrieving the objects from all the partition mis-behaves

Hi All,

 

I am using the iControl SOAP API in Java to retrieve the Virtual Server of all the partition. Every time when i run , the total list of all partition is differs at time.

 

iControl.ManagementPartitionAuthZPartition[] partitionList = m_interfaces.getManagementPartition().get_partition_list(); for(iControl.ManagementPartitionAuthZPartition partition : partitionList){ m_interfaces.getManagementPartition().set_active_partition(partition.getPartition_name()); String vServer[] = m_interfaces.getLocalLBVirtualServer().get_list(); }

 

All the time, I am not getting the virtual server of the partition which I am setting, rather it gives me other partition's Virtual server.

 

If i wait for 3 seconds or more after setting the partition, I am able to get the Virtual servers of all partition. But, my collection time is more when i have N number of partition.

 

Can anyone help me to get rid of this issue.

 

Regards, Prakash.K

 

4 Replies

  • Hi prakash.

    Management :: Partition has been deprecated (as of 11.0.0). You need to use Management::Folder and System::Session in its stead.

    sample code is :

     

    Interfaces interfaces = new Interfaces("your_ltm", 443L, "account", "password");
    
    // get session identifier
    String session_identifier = String.valueOf(interfaces.getSystemSession().get_session_identifier());
    
    // set session identifier to header
    interfaces.getSystemSession().setHeader("urn:iControl", "session", session_identifier);
    interfaces.getManagementFolder().setHeader("urn:iControl", "session", session_identifier);
    interfaces.getLocalLBVirtualServer().setHeader("urn:iControl", "session", session_identifier);
    
    interfaces.getSystemSession().set_active_folder("/");
    String[] folder_list = interfaces.getManagementFolder().get_list();
    
    for(String folder : folder_list){
        interfaces.getSystemSession().set_active_folder(folder);
        String[] virtualserver_list = interfaces.getLocalLBVirtualServer().get_list();
        for(String virtualserver : virtualserver_list){
            System.out.println(virtualserver);
        }
    }
    

     

    or you can retreave all virtual server list with set_recursive_query_state option

     

    // set active folder to root ("/") and recursive state enabled
    interfaces.getSystemSession().set_active_folder("/");
    interfaces.getSystemSession().set_recursive_query_state(CommonEnabledState.STATE_ENABLED);
    
    // get all virtual server list
    String[] virtualserver_list = interfaces.getLocalLBVirtualServer().get_list();
    

     

  • Hi Uchi,

     

    You are rocking..., Thanks a lot.

     

    Its works fine for me. Will check for multiple rounds of inventory and get back to you if i have any issues.

     

    Regards, Prakash.K