I am trying to query IPAM for an available ip address and then mark it as reserved. I am able to retrieve an available ip address but I've been unable to mark it as reserved.
# Get first available ip address
query = "SELECT TOP 1 I.DisplayName, I.Uri FROM IPAM.IPNode I WHERE Status=2 AND I.Subnet.DisplayName = '{0}'".format(vlan)
swis = orionsdk.SwisClient(server, user, password)
results = swis.query(query)
for result in results['results']:
uri = result['Uri']
print("IP address: {0}".format(result['DisplayName']))
#Now that I have the uri I then try to set it to "reserved"
swis.update(uri + "/Status", 4)
This always returns:
But this returns Traceback (most recent call last): File "C:/working/orion/test.py", line 27, in <module> main() File "C:/working/orion/test.py", line 16, in main swis.update(uri, **{'Status': 4}) File "C:\dev\Python27\lib\site-packages\orionsdk\swisclient.py", line 40, in update self._req("POST", uri, properties) File "C:\dev\Python27\lib\site-packages\orionsdk\swisclient.py", line 59, in _req resp.raise_for_status() File "C:\dev\Python27\lib\site-packages\requests\models.py", line 935, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Operation not supported on IPAM.IPNode for url.
I found these forum posts (and many others), but none of them show a working example.
Re: How to get IP Address for VM from Solarwinds IPAM once it is provisioned.
Re: WANT 500 THWACK POINTS? Let us know how you would use our new extended API feature in IPAM!
I've reviewed the documentation at:
GitHub - solarwinds/orionsdk-python: Python client for interacting with the SolarWinds Orion API
Home · solarwinds/OrionSDK Wiki · GitHub
But can't find any documentation showing an update.
Anyone have any examples?
Thanks.