Forum Discussion
Giuseppe_Casabl
Sep 13, 2007Nimbostratus
Hi I'm trying to getting started with Icontrol. Until now I'm very impressed about the features. Now I have a problem with the GlobalLBPoolMemberMemberObjectStatus[][] class. I have try to get the object_status of the pool Member in the pool I get followinf error:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: Could not find element by name: address
faultActor:
faultNode:
faultDetail:
Probably I have a problem in my code.. Could you help me ??
Hereby my class
package com.casablanca.lb;
/*
* The contents of this file are subject to the "END USER LICENSE AGREEMENT FOR F5
* Software Development Kit for iControl"; you may not use this file except in
* compliance with the License. The License is included in the iControl
* Software Development Kit.
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is iControl Code and related documentation
* distributed by F5.
*
* The Initial Developer of the Original Code is F5 Networks,
* Inc. Seattle, WA, USA. Portions created by F5 are Copyright (C) 1996-2004 F5
* Inc. All Rights Reserved. iControl (TM) is a registered trademark of F5 Netw
*
* Alternatively, the contents of this file may be used under the terms
* of the GNU General Public License (the "GPL"), in which case the
* provisions of GPL are applicable instead of those above. If you wish
* to allow use of your version of this file only under the terms of the
* GPL and not to allow others to use your version of this file under the
* License, indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by the GPL.
* If you do not delete the provisions above, a recipient may use your
* version of this file under either the License or the GPL.
*/
import java.text.*;
import java.util.*;
import iControl.*;
public class GlobalLBActivateNode extends Object
{
//--------------------------------------------------------------------------
// Member Variables
//--------------------------------------------------------------------------
public String m_endpoint;
public iControl.GlobalLBWideIPBindingStub m_nodeAddress;
public iControl.GlobalLBPoolBindingStub m_pool;
public iControl.GlobalLBPoolMemberBindingStub m_poolMember;
public iControl.GlobalLBServerBindingStub m_server;
//--------------------------------------------------------------------------
// Constructor
//--------------------------------------------------------------------------
public GlobalLBActivateNode()
{
System.setProperty("javax.net.ssl.trustStore", System.getProperty("user.home") + "/.keystore");
XTrustProvider.install();
}
//--------------------------------------------------------------------------
// parseArgs
//--------------------------------------------------------------------------
public boolean parseArgs(String[] args) throws Exception
{
boolean bSuccess = false;
if ( args.length < 4 )
{
usage();
}
else
{
// build parameters
m_endpoint = "https://admin:protocom" + "@tcwe3s:443" + "/iControl/iControlPortal.cgi";
m_nodeAddress = (iControl.GlobalLBWideIPBindingStub)
new iControl.GlobalLBWideIPLocator().getGlobalLBWideIPPort(new java.net.URL(m_endpoint));
m_pool= (iControl.GlobalLBPoolBindingStub)
new iControl.GlobalLBPoolLocator().getGlobalLBPoolPort(new java.net.URL(m_endpoint));
m_poolMember= (iControl.GlobalLBPoolMemberBindingStub)
new iControl.GlobalLBPoolMemberLocator().getGlobalLBPoolMemberPort(new java.net.URL(m_endpoint));
m_server= (iControl.GlobalLBServerBindingStub)
new iControl.GlobalLBServerLocator().getGlobalLBServerPort(new java.net.URL(m_endpoint));
m_nodeAddress.setTimeout(60000);
m_pool.setTimeout(60000);
m_poolMember.setTimeout(60000);
bSuccess = true;
if ( args.length >= 5 )
{
//getNodeInfo(new String[] {args[4]});
}
else
{
//getAllNodeInfo();
getNodeList();
}
}
return bSuccess;
}
//-------------------------------------------------------------------------
//
//--------------------------------------------------------------------------
public void usage()
{
System.out.println("Usage: GlobalLBActivateNode hostname port username password [node_address]\n");
}
public String[] getPoolList() throws Exception
{
return m_pool.get_list();
}
public String[] getNodeList()throws Exception
{
return m_nodeAddress.get_list();
}
public String[] getServerList()throws Exception
{
return m_server.get_list();
}
public iControl.GlobalLBWideIPWideIPPool[][] getWideIPPool(String[] wide_ips)throws Exception
{
return m_nodeAddress.get_wideip_pool(wide_ips);
}
public iControl.CommonObjectStatus[] getObjectStatus(String[] node_list) throws Exception
{
iControl.CommonObjectStatus[] object_status_list =
m_pool.get_object_status(node_list);
return object_status_list;
}
public iControl.GlobalLBPoolMemberMemberObjectStatus[][] getPoolObjectStatus(String[] node_list,iControl.CommonIPPortDefinition[][] members) throws Exception
{
iControl.GlobalLBPoolMemberMemberObjectStatus[][] object_status_list =
m_poolMember.get_object_status(node_list,members);
return object_status_list;
}
public iControl.CommonEnabledState [] getStateInfo(String[] node_list) throws Exception
{
iControl.CommonEnabledState [] enabled_state_list =
m_nodeAddress.get_enabled_state(node_list);
return enabled_state_list;
}
public iControl.GlobalLBPoolPoolMemberDefinition[][] getPoolMember(String[] pool_list) throws Exception
{
iControl.GlobalLBPoolPoolMemberDefinition[][] pool_definition=
m_pool.get_member(pool_list);
return pool_definition;
}
//--------------------------------------------------------------------------
// Main
//--------------------------------------------------------------------------
public static void main(String[] args)
{
try
{
iControl.CommonIPPortDefinition ipaddress=null;
GlobalLBActivateNode globalLBActivateNode = new GlobalLBActivateNode();
globalLBActivateNode.parseArgs(args);
// pool list Array
String pools [] = new String[globalLBActivateNode.getNodeList().length];
iControl.GlobalLBWideIPWideIPPool[][] wideip=globalLBActivateNode.getWideIPPool(globalLBActivateNode.getNodeList());
// get the wide ip list
for(int i=0;ifor(int j=0;jSystem.out.println(wideip[ i ][j].getPool_name());
// Get the pool list
pools[ i ]=wideip[ i ][j].getPool_name();
}
}
iControl.CommonIPPortDefinition [][] info;
info = new iControl.CommonIPPortDefinition[pools.length][];
iControl.GlobalLBPoolPoolMemberDefinition[][] members= globalLBActivateNode.getPoolMember(pools);
for(int i=0;iinfo[ i ] = new iControl.CommonIPPortDefinition[i+1];
for(int j=0;jipaddress=members[ i ][j].getMember();
// Fill the array with the CommonIPPortDefinition
info[ i ][j] = new iControl.CommonIPPortDefinition(ipaddress.getAddress(),ipaddress.getPort());
}
}
// Test if the return value ist PoolMember
System.out.println(globalLBActivateNode.getPoolObjectStatus(pools,info));
}
catch(Exception ex)
{
ex.printStackTrace(System.out);
}
}
};