-
Notifications
You must be signed in to change notification settings - Fork 20
Healthbot files management (rules, playbooks, functions, tables and views) with CURL
The directory tables_and_views has tables and views examples
The directory rules has rules examples
The directory playbooks has playbooks examples
The directory functions has functions examples
We will see how to load files (rules, playbooks, functions, tables and views) to healthbot using healthbot API with curl
Add a table to Heathbot
$ curl -X POST "https://100.123.35.0:8080/api/v1/files/helper-files/ospf.yml" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure -F "up_file=@tables_and_views/ospf.yml"
Get a table from Healthbot
$ curl -X GET "https://100.123.35.0:8080/api/v1/files/helper-files/ospf.yml" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure
Remove a table from Heathboth
$ curl -X DELETE "https://100.123.35.0:8080/api/v1/files/helper-files/ospf.yml" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure
Add a function to Heathboth
$ curl -X POST "https://100.123.35.0:8080/api/v1/files/helper-files/enable_a_disabled_interface.py" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure -F "up_file=@functions/enable_a_disabled_interface.py"
Get a function from Heathboth
$ curl -X GET "https://100.123.35.0:8080/api/v1/files/helper-files/enable_a_disabled_interface.py" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure
Remove a function from Heathboth
$ curl -X DELETE "https://100.123.35.0:8080/api/v1/files/helper-files/enable_a_disabled_interface.py" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure
Add a rule to Heathbot candidate configuration
$ curl -X POST --insecure -u jcluser:Juniper\!1 https://100.123.35.0:8080/api/v1/topics/ -H 'Content-Type: multipart/form-data' -F topics=@rules/check-bgp-state-using-snmp.rule
Get a topic from the candidate configuration
$ curl -X GET "https://100.123.35.0:8080/api/v1/topic/bgp/?working=true" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure
Commit the candidate configuration
$ curl -X POST "https://100.123.35.0:8080/api/v1/configuration" -u jcluser:Juniper\!1 --insecure
Get a topic from the running configuration
$ curl -X GET "https://100.123.35.0:8080/api/v1/topic/bgp/" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure
Add a playbook to healthbot candidate configuration
$ curl -X POST --insecure -u jcluser:Juniper\!1 https://100.123.35.0:8080/api/v1/playbooks/ -H 'Content-Type: multipart/form-data' -F playbooks=@playbooks/interfaces-using-snmp.playbook
Get all playbooks from the candidate configuration
$ curl -X GET "https://100.123.35.0:8080/api/v1/playbooks/?working=true" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure
Get a playbook from the candidate configuration
$ curl -X GET "https://100.123.35.0:8080/api/v1/playbook/interfaces-using-snmp/?working=true" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure
Commit the candidate configuration
$ curl -X POST "https://100.123.35.0:8080/api/v1/configuration" -u jcluser:Juniper\!1 --insecure
Get a playbook from the running configuration
$ curl -X GET "https://100.123.35.0:8080/api/v1/playbook/interfaces-using-snmp/" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure
Get all playbooks from the running configuration
$ curl -X GET "https://100.123.35.0:8080/api/v1/playbooks/" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure
Delete a playbook from the candidate configuration
$ curl -X DELETE "https://100.123.35.0:8080/api/v1/playbook/interfaces-using-snmp/" -H "accept: application/json" -H "Content-Type: multipart/form-data" -u jcluser:Juniper\!1 --insecure
commit the candidate configuration
$ curl -X POST "https://100.123.35.0:8080/api/v1/configuration" -u jcluser:Juniper\!1 --insecure