-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModifyValis.py
More file actions
23 lines (15 loc) · 849 Bytes
/
ModifyValis.py
File metadata and controls
23 lines (15 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import valispace
deployment = input("Deployment Name:")
username = input("Username: ")
password = input("Password: ")
valispace = valispace.API(url="https://"+deployment+".valispace.com/", username=username, password=password)
# The ID of the Vali that you want to modify
vali_id =
# New value you want to update the Vali with.
newValue =
# Function to get Vali by the fullname
Vali = valispace.get_vali(vali_id)
print("The Vali found is named: "+ str(Vali["name"]))
print("The old value was "+ str(Vali["formula"])+" "+str(Vali["unit"])+". The new value of the Vali will be "+str(newValue)+" "+str(Vali["unit"]))
# This request function is sending a web request to the server to change the formula of the identified vali with the new value you determine
valispace.request("patch", "valis/"+str(Vali["id"])+"/", data={"formula":newValue})