Forum Discussion

Sadhna_80746's avatar
Sadhna_80746
Icon for Nimbostratus rankNimbostratus
May 01, 2012

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_detailed

 

 

RRList [] get_rrs_detailed(

 

in Management_ViewZone [] view_zones

 

);

 

 

The syntax says that the input should be array of Management_ViewZone.

 

But when I pass array of Management_ViewZone to it, it considers only the first Management_ViewZone in the array and ignores rest.

 

 

2. iControl::Management::Zone::get_zone

 

 

ZoneInfo [] get_zone(

 

in Management_ViewZone [] view_zones

 

);

 

 

I found the same problem as mentioned for the above API.

 

 

 

Am I missing something? Can someone please help on this?

 

 

Thanks

 

 

 

 

1 Reply

  • George_Watkins_'s avatar
    George_Watkins_
    Historic 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