Infoblox’s global team of threat hunters uncovers a DNS operation with the ability to bypass traditional security measures and control the Great Firewall of China. Read about “Muddling Meerkat” and the many other threat actors discovered by Infoblox Threat Intel here.

API & Integration, DevOps,NetOps,SecOps

Reply

PAPI to WAPI migration :

Authority
Posts: 14
2292     0

How can Some one Migrate from PAPI to wAPI

I wanted to add/Update a EA to host :

how can i do that in Perl using WAPI

 

$client->GET( "/record:host?name="."$hostname\.$domain" , $headers );
my $res_data = from_json($client->responseContent());
my $key = $res_data->[0]->{_ref};
print $key;
my $ext ='{
"_ref": "$key",
"extattrs": {
"1:ID-Nr." : { "value": $id_nr },
"2:Geraeteart": { "value": $geraeteart },
"3:Geraetetyp": { "value": $geraetetyp },
"4Smiley Frustratedtandort" : { "value": $standort},
"5:Netzdose" : { "value": $netzdose},
"6:Verteiler" : { "value": $verteiler},
"7:Nutzer" : { "value": $nutzer },
"8Smiley Frustratedtruktureinheit": { "value": $struktureinheit },
"9:Tel.-Nr." : { "value": $tel },
"a:Applikationen": { "value": $applikationen },
"b:Bemerkungen" : { "value": $bemerkungen}
}
}';
# now add it
my $response = $client->PUT( "/$key"."&_return_fields=extattrs",$ext, $headers);

THe problem is instead of taking the assigned value, it tooks the literal value , can some throw light on this?

Re: PAPI to WAPI migration :

[ Edited ]
Moderator
Moderator
Posts: 289
2292     0

For future posts, can you please post your code in a code block,

 

like this

 

to help with readability.  It won't convert text to smily faces and such.

 

There is a lot of similarity between PAPI and WAPI but they are not exactly the same and cannot be automatically converted.  Anything that was done in PAPI will need to be rewritten to use WAPI instead.  Fortunately with WAPI you can use the development platform of your choice, whereras PAPI will only work with Perl.

 

The EAs need to be updated together.  If you change any EAs on a record or orbject, you must push the complete set and not just a partial set in the WAPI Call.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You