Skip to content

Instantly share code, notes, and snippets.

@netmanchris
Created July 25, 2015 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netmanchris/cc26ab9e98c032fe9bba to your computer and use it in GitHub Desktop.
Save netmanchris/cc26ab9e98c032fe9bba to your computer and use it in GitHub Desktop.
Add New Custom View
def create_new_view():
view_name = input("Please input the name of the new view: ")
add_view_url = "/imcrs/plat/res/view/custom?resPrivilegeFilter=false&desc=false&total=false"
f_url = url + add_view_url
payload = '''{ "name": "''' + view_name + '''", "autoAddDevType" : "0"}'''
r = requests.post(f_url, data=payload, auth=auth,
headers=headers) # creates the URL using the payload variable as the contents
r.status_code
if r.status_code == 201:
return view_name
else:
print("An Error has occured")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment