- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
PAPI to WAPI migration :
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2020 08:41 AM
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 },
"4tandort" : { "value": $standort},
"5:Netzdose" : { "value": $netzdose},
"6:Verteiler" : { "value": $verteiler},
"7:Nutzer" : { "value": $nutzer },
"8truktureinheit": { "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 ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2020 08:03 PM - edited 05-26-2020 08:04 PM
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.