I am trying to see if there is a why to update/change the management IP of devices via API calls. I’ve looked over the documentation online and can’t find it or it doesn’t exist. Thanks
Hi
maybe you are looking for this: https://github.com/NetBrainAPI/NetBrain-REST-API-R10/blob/master/REST%20APIs%20Documentation/Shared%20Device%20Setting%20Management/Update%20device%20basic%20settings%20API.md
“This API is used to update device basic settings in current domain. The response of this API will return a list in JSON format.”
Unfortunately, this one does not come with example code.
Thanks Carsten, That is what I ended up using. However I get the message that MGMT IP is not editable.
---
Set device attribute failed! - {"statusCode":792000,"statusDescription":"The attribute 'mgmtIP' cannot be edited."}
Hope it helps.
import requests
import json
url = "http://10.10.14.189/ServicesAPI/API/V1/CMDB/SharedDeviceSettings/BasicSetting"
payload = json.dumps({
"HostName": "BJ_L2_Core_6",
"ManageIp": "172.24.255.62"
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'token': '8d1a5a4f-ba97-4f4a-9bd0-b06697b1a230'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
Thanks,
Gerry
Reply
Login to the community
No account yet? Create an account
Sign in with SSO
Login via NetBrain UniversityEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.