Loading IP mapping

hello

When i load ip mapping in dynatrace (app web/system/…)  all works fine. i can see all data manually added.

With API, it works but i only add in dynatrace the data of last call (all previous data are deleted after each call)

Idea of mistake ?

Thanks.

Hi,

I cannot understand you. Can you explain a little more or some screenshot?

Best regards

Hello

when i add manually in dynatrace ip mapping, all is ok

location just added appear in list.

But if i add a location with my script or postman, all existing entries are deleted, and only the last added one appears

Hi,

Strange, can you share your API calls using postman or in the script?

Best regards

Hi @kickme

You can check the API && assigned token scopes and access privileges.

BR,

Peter

Hello

This part of my script

those lines are in a loop (with my data in sqlserver)

$body = @“{    `“ipAddressMappingRules`”: [        {            `“ipAddressMappingLocation`”: {                `“city`”: `”$ville`“,                `“countryCode`”: `”$countryCode`“,                `“latitude`”: $latitude,                `“longitude`”: $longitude            },            `“ipAddressRange`”: {                `“address`”: `”$VLAN_debut`“,                `“addressTo`”: `”$VLAN_fin`“,                `“subnetMask`”: `”`"            }        }    ]}"@
$response = Invoke-RestMethod ‘https://{environmentid}.live.dynatrace.com/api/config/v1/geographicRegions/ipAddressMappings’ -Method ‘PUT’ -Headers $headers -Body $bodyI thought issue is in my code so i tried with postmanexactly same issue with postman.My API account has all option checked (i started by check that)if issue was with account, i can’t PUT a all, not only one

if i put 2 locations on the same API call : i found them in dynatrace.

Hi @kickme

Definitely, whatever configured through API or UI can be triggered.

Keep up the good work.

BR,

Peter

HI

Loading IP mapping is “one shot” mode => All VLAN must loaded on only one call.

My script made a loop and an API call on each row returned by database.

With this method  each API call delete existing mapping in dynatrace before insert new one.

I change to build a big payload to make only one api call.

Now it s ok.