For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

ANL_158394's avatar
ANL_158394
Icon for Nimbostratus rankNimbostratus
Jun 12, 2014

.NET add_cname method

I am trying to figure out how to add a cname record to zone runner via C. For some reason I keep getting an error. Here's what I have:

 

Interfaces interfaces = new Interfaces();

 

string[] view = { "external" };

 

ManagementViewZone[] viewZones = interfaces.ManagementZone.get_zone_name(view);

 

ManagementZoneInfo[] zoneInfo = interfaces.ManagementZone.get_zone(viewZones);

 

ManagementCNAMERecord record = new ManagementCNAMERecord();

 

record.cname = "test";

 

record.domain_name = "st.int";

 

record.ttl = 3600;

 

interfaces.ManagementResourceRecord.add_cname(viewZones, record);

 

From what I can gather this should work, but what it looks like the problem is has to do with the overloads for the add_cname method. Error below:

 

Error1The best overloaded method match for 'iControl.ManagementResourceRecord.add_cname(iControl.ManagementViewZone[], iControl.ManagementCNAMERecord[][])' has some invalid arguments

 

I get that the ViewZone would be an array, but it looks like it wants a a multi-dimensional array for the records? Reviewing this:

 

https://devcentral.f5.com/wiki/iControl.Create-CNAME-Resource-Record-in-Zone-Runner.ashx

 

It appears there should be some kind of sequence method, but only shows to be an alias in .NET. I'm confused... Any help would be greatly appreciated!

 

Thanks! Tony

 

No RepliesBe the first to reply