Quantcast
Channel: THWACK: All Content - Orion SDK
Viewing all articles
Browse latest Browse all 2677

Using python orionsdk to update custom properties in IPAM.IPNodeAttr (CRUD)

$
0
0

Hi, I am using the python orionsdk to automate changes in IPAM 4.7.  In IPAM.IPNode I am able to set an IP to Reserved status and also set the Hostname (DnsBackward) value.  We have two custom fields in IPAM.IPNodeAttr that I also want to set but so far I always get permission denied errors.  I have a local account in IPAM that I've been told has admin level rights.

 

I've tried using the python orionsdk and the REST API (using curl).  Both result in the same permission denied error.

 

I've also read that to set custom attributes in IPAM.IPNodeAttr that you have to create the IPAM.IPNodeAttr instance first (unless you're just updating an existing value...which I also cannot get to work).

 

I'll also mention that I'm not talking about setting CustomProperties in Orion.Nodes via the NodeID (as shown in orionsdk-python/samples/custom_property_update.py).  I am trying to set values in the Custom IPAM.IPNodeAttr instance (not CustomProperties).  For example here:

 

https://my.exmaple.com:17778/SolarWinds/InformationService/v3/Json/swis://localhost/Orion/IPAM.IPNode/IpNodeId=11111/Custom

 

Here's what I'm doing after setting the IP to Reserved status and setting the Hostname value.

 

I need to update two custom fields called Server_Names and Role:

 

set_server_names = swis.update(uri + '/Custom', Server_Names='myhost.example.com')

where uri is 'swis://localhost/Orion/IPAM.IPNode/IpNodeId=11111'.

 

I get

requests.exceptions.HTTPError: 403 Client Error: Access to IPAM.IPNodeAttr denied. for url: https://my.example.com:17778/SolarWinds/InformationService/v3/Json/Create/IPAM.IPNodeAttr

I get the same error when trying to update the custom value on an existing IP that already has values populated for these custom fields.

 

So I read in the IPAM 4.7 wiki that to do CRUD on custom values in IPAM.IPNodeAttr you have to create the IPAM.IPNodeAttr instance first...so I have tried this first before running swis.update (as shown above)

 

create_server_names = swis.create('IPAM.IPNodeAttr', IPNodeId = 11111)

I get the same permission denied error (as shown above).  The wiki example is for powershell so maybe I'm not translating it to python correctly.

 

I also tried to create the custom fields using curl and the REST API

 

curl -k -v --request POST -u user:pass --header "Content-Type: application/json" --data '{"IPNodeId": "11111", "Server_Names": "myhost.example.com"}' https://my.example.com:17778/SolarWinds/InformationService/v3/Json/Create/IPAM.IPNodeAttr

I get the same permission denied error.

 

So am I doing this wrong?  Or is it legit permissions issues?  Thanks for looking.


Viewing all articles
Browse latest Browse all 2677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>