******** REST API ******** .. toctree:: :caption: Contracts List Create Modify Delete .. toctree:: :caption: Machines List Create Modify Delete .. toctree:: :caption: Command line kiwi-cmd Authentification ++++++++ Authentication is done with a token linked to the user. It is provided to you on request and displayed in your administration interface. Example ++++++++ Replace [TOKEN] with the value of the supplied token. List of machines ======= .. sourcecode:: python curl -H "X-AUTH-TOKEN:[TOKEN]" "https://admin.sante.kiwi-backup.com/api/machines.json" curl -H "X-AUTH-TOKEN:[TOKEN]" "https://admin.sante.kiwi-backup.com/api/machines.csv" List of contracts ======= .. sourcecode:: bash curl -H "X-AUTH-TOKEN:[TOKEN]" "https://admin.sante.kiwi-backup.com/api/contrats.csv" curl -H "X-AUTH-TOKEN:[TOKEN]" "https://admin.sante.kiwi-backup.com/api/contrats.json" List machines in alerts ====== .. sourcecode:: bash curl -H "X-AUTH-TOKEN:[TOKEN]" "https://admin.sante.kiwi-backup.com/api/machines_alerte.csv" curl -H "X-AUTH-TOKEN:[TOKEN]" "https://admin.sante.kiwi-backup.com/api/machines_alerte.json" Creation of a contract with a .json file from the current folder of this file. ======= .. sourcecode:: bash curl -H "X-AUTH-TOKEN:[TOKEN]" -d @file.json "https://admin.sante.kiwi-backup.com/api/add/contrat.json" Contract creation with the following fields. ======= .. sourcecode:: bash curl -H "X-AUTH-TOKEN:[TOKEN]" -d '{"eid":"000000000000000000000001", "libelle":"MonContrat", "volume_disponible":10000, "nb_machines":99, "historique": 90, "email_alerte": "monemail@free.fr"}' "https://admin.sante.kiwi-backup.com/api/add/contrat.json" See a specific contract ([CONTRACT_ID] = id of the desired contract). ======= .. sourcecode:: bash curl -H "X-AUTH-TOKEN:[TOKEN]" "https://admin.sante.kiwi-backup.com/api/contrat/[CONTRACT_ID]" Update a contract ======= It is possible to update following informations: 'email_alerte', 'nb_machines', 'volume_disponible', 'libelle', 'historique'. .. sourcecode:: bash curl -H "X-AUTH-TOKEN:[TOKEN]" -d @file.json "https://admin.sante.kiwi-backup.com/api/edit/contrat.json/[CONTRACT_ID]"