Error creating an ltm monitor template on an F5 Loadbalancer BigIP 11.x device using the iControl Java API call: LocalLB__Monitor__create_template
Hi,
I'm trying to create an ltm monitor template on an F5 Loadbalancer BigIP 11.x device using the iControl Java API to make the create_template call as described here:
I have a few questions as to how the IP Address is created. I have tried a number of combinations and none of them seem to work. Some will allow the creation of the template but the IP address information seems to be missing.
My understanding from the LocalLB__AddressType API is that the following is true:
MemberValueDescription ATYPE_UNSET0The address type is unknown. ATYPE_STAR_ADDRESS_STAR_PORT1For example, ":". ATYPE_STAR_ADDRESS_EXPLICIT_PORT2For example, ":80". ATYPE_EXPLICIT_ADDRESS_EXPLICIT_PORT3For example, "10.10.10.1:80". ATYPE_STAR_ADDRESS4For example, "". ATYPE_EXPLICIT_ADDRESS5For example, "10.10.10.1".
There may be errors with my assumption or the documentation though as my interpretation differs from the documentation for the following members: ATYPE_STAR_ADDRESS and ATYPE_EXPLICIT_ADDRESS
[link text](https://devcentral.f5.com/wiki/iControl.LocalLB__AddressType.ashx)
So the questions I have are:
Q1. Are my assumptions regarding the address members correct? (If so, I can edit the API).
Q2. As I have to specify an ip address and port number in the creation of the CommonIPPortDefinition:LocalLBMonitorIPPort (String, long), what ip address and port numbers are given for the following scenarios?
- "*"[0.0.0.0, 0]?
- ":"[0.0.0.0, 0]?
- "10.10.10.10" [10.10.10.10, 0 if my assumption is correct for ATYPE_EXPLICIT_ADDRESS]?
I seem to be having problems with this part of the code.
Code
// create inputCommonAttributes
CommonIPPortDefinition ipPort = new CommonIPPortDefinition("*:*", 0);
LocalLBMonitorIPPort monitorIPPort = new LocalLBMonitorIPPort(
LocalLBAddressType.ATYPE_STAR_ADDRESS_STAR_PORT, ipPort);
From the API, I understand that the call needs to be made in the following way after creating the LocalLBMonitorBindingStub:
Code
// inputs for create template
LocalLBMonitorMonitorTemplate[] inputTemplateArray = new LocalLBMonitorMonitorTemplate[1];
LocalLBMonitorCommonAttributes[] inputCommonAttributes = new LocalLBMonitorCommonAttributes[1];
// create template
LocalLBMonitorTemplateType templateType = LocalLBMonitorTemplateType.TTYPE_DIAMETER;
LocalLBMonitorMonitorTemplate monitorTemplate = new LocalLBMonitorMonitorTemplate("TestTemplate", templateType);
// add template to inputTemplateArray
inputTemplateArray[0] = monitorTemplate;
// create inputCommonAttributes
CommonIPPortDefinition ipPort = new CommonIPPortDefinition("*", 80);
LocalLBMonitorIPPort monitorIPPort = new LocalLBMonitorIPPort(
LocalLBAddressType.ATYPE_STAR_ADDRESS_EXPLICIT_PORT, ipPort);
LocalLBMonitorCommonAttributes commonAttributes = new LocalLBMonitorCommonAttributes("diameter", 10, 31, monitorIPPort, false, true);
// add common attributes to inputCommonAttributes array
inputCommonAttributes[0] = commonAttributes;
// make the call to the device
localLBMonitorBindingStub.create_template(inputTemplateArray,inputCommonAttributes);
Output of exception:
AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode: faultString: Exception caught in LocalLB::urn:iControl:LocalLB/Monitor::create_template() Exception: Common::OperationFailed primary_error_code : 16908320 (0x01020020) secondary_error_code : 0 error_string : 01020020:3: The text string cannot be converted to an IP address. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:Exception caught in LocalLB::urn:iControl:LocalLB/Monitor::create_template() Exception: Common::OperationFailed primary_error_code : 16908320 (0x01020020) secondary_error_code : 0 error_string : 01020020:3: The text string cannot be converted to an IP address. at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.intelliden.drivers.f5.generated.LocalLBMonitorBindingStub.create_template(LocalLBMonitorBindingStub.java:1025) at com.intelliden.drivers.f5.F5TestMonitor.main(F5TestMonitor.java:70 {http://xml.apache.org/axis/}hostname:IBM988-R901C8N1
Any help would be greatly appreciated. Thanks in advance.
Kind regards, Don
Try setting the IP address to 0.0.0.0 instead of * when creating the CommonIPPortDefinition.