Files
rmmanager/plugins/rmass/actions/setavailable.py
T

66 lines
1.0 KiB
Python

import os
name = "Set availability"
kind = "action"
id = "setavailable"
showstatus = True
#skipstep = {
# "checkavailable": "validTo >= 3600"
#}
resolve = {
"get": {
"availabletime": ["availabletime"],
},
}
availabletime = int(os.environ.get("AVAILABLE_DURATION",3))
duration = availabletime - 1
keys = [
{
"keytitle": "option",
"keyvalue": 1,
},
{
"keytitle": "duration",
"keyvalue": duration,
},
]
method = "PUT"
path = "https://rentmasseur.com/api/v1/account/dashboard/availability"
headers = {
"Authorization": {
"output": "access_token",
"prefix": "Bearer ",
},
}
outputs = {
"available_until": "validTo"
}
prints = {
"Available until": "available_until"
}
recoverPolicy = {
KeyError:[False],
TypeError: [],
}
filters = [
{
"filterkey": "availabletime",
"operator": ">=",
"filtervalue": 3600,
"print": "Availabile time above threshold. Skipping Set Available...",
},
]