Forum Discussion
Sadhna_80746
May 01, 2012Nimbostratus
APIs to read zone resource record data
Hi,
I was trying to use the following APIs to read zone and resource record data from F5 device and found following issues:
1. iControl::Management::ResourceRecord::get_rrs_detaile...
George_Watkins_
May 10, 2012Historic F5 Account
Hi Sadhna,
Your assessment sounds correct The Management::ResourceRecord.get_rrs_detailed method takes an array of Management::ViewZone objects as an argument and returns an array of Managment::RRList objects. It is likely a syntactical issues. Here is a POC written in Java:
package com.f5se.examples;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
public class GetDetailedResourceRecord {
public static void main(String[] args) {
iControl.BigIP bigip = new iControl.BigIP("test-ltm-01", "admin", "admin");
bigip.setIgnoreInvalidCert(true);
iControl.services.ManagementViewZone[] view_zones = new iControl.services.ManagementViewZone[2];
view_zones[0] = new iControl.services.ManagementViewZone();
view_zones[0].setView_name("external");
view_zones[0].setZone_name("test.local.");
view_zones[1] = new iControl.services.ManagementViewZone();
view_zones[1].setView_name("external");
view_zones[1].setZone_name("test2.local.");
try {
iControl.services.ManagementRRList[] rr_list = bigip.ManagementResourceRecord().get_rrs_detailed(view_zones);
for (iControl.services.ManagementRRList rr : rr_list) {
iControl.services.ManagementARecord[] a_records = rr.getA_list();
System.out.print("domain_name: ");
System.out.print(a_records[0].getDomain_name());
System.out.print(", IP: ");
System.out.println(a_records[0].getIp_address());
}
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Hope that helps,
George
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects