Python bindings for the Appsembler API.
- Python 3.5, 3.6
- Clone this repo
- Create a virtualenv, if that's how you normally manage your Python packages
Fetch the repo and pip install the dependancies:
$ pip install -r requirements_dev.txt
You'll then need to add the the directory to your path. On *nix environments, run the helper script included in this repo:
$ chmod 700 ./add2path.sh
$ ./add2path.sh
Install the package in editable mode, which will allow you to edit the code while also treating it like an installed package:
pip install -e [email protected]:appsembler/python-avl@master#egg=avl .
Copy the env file:
$ cp env.example .env
Modify the token and domain in the .env file:
AVL_DOMAIN='https://yourAVLDashboard.domain.com'
AVL_API_TOKEN='yourToken'
Update the planned expiration time of a lab:
from avl import Lab
from datetime import datetime, timedelta
lab = Lab(lab_id)
planned_expiration_time = datetime.today() + timedelta(days=2)
data = {
'pk': lab.pk,
'planned_expiration_time': planned_expiration_time
}
lab = lab.patch(data)
if lab.response.ok: # i.e., 20x
do_something()
else:
do_something_else()
For more on engaging with the Lab.response
object, see:
https://2.python-requests.org/en/master/api/#requests.Response. It's
simply a copy of request.Response
.
- Cover the following endpoints
- '/isc/dashboard/userprojectdeployments/' GET
- '/isc/dashboard/userprojectdeployments/delete_user_deployments/' POST (should be patch?)
- '/isc/newdeploy/' POST (with project Token)
- Install the requirements upon
setup.py install
, etc.