Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def change_dev_category():
global dev_list
dev_list = filter_dev_category()
for dev in dev_list:
print ("system name: "+ dev['sysName']+'\nCurrent Category: '+dev['devCategoryImgSrc']+
'\nIP address: '+ dev['ip']+'\nSystem Description: '+dev['sysDescription']+ '\n\n')
cat_id = input("What is the category to which you want to move the selected device: ")
for i in dev_list:
dev_id = i["id"]
change_dev_cat_url = "/imcrs/plat/res/device/"+dev_id+"/updateCategory"
f_url = url + change_dev_cat_url
payload = '''{ "categoryId" : "'''+cat_id+'''" }'''
r = requests.put(f_url, data=payload, auth=auth, headers=headers) #creates the URL using the payload variable as the contents
if r.status_code == 204:
print (r.status_code)
print ("An Error has occured")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.