based on netbox api documentation. Because we love Netbox.
goLe includes a full-featured REST API that allows its data model to be read and manipulated externally.
What is a REST API?
REST stands for representational state transfer. It's a particular type of API which employs HTTP to create, retrieve, update, and delete objects from a database. (This set of operations is commonly referred to as CRUD.) Each type of operation is associated with a particular HTTP verb:
GET
: Retrieve an object or list of objectsPOST
: Create an objectPUT
/PATCH
: Modify an existing object.PUT
requires all mandatory fields to be specified, whilePATCH
only expects the field that is being modified to be specified.DELETE
: Delete an existing object
The goLe API represents all objects in JavaScript Object Notation (JSON). This makes it very easy to interact with goLe data on the command line with common tools. For example, we can request an list of applications from goLe and output the JSON using curl
and jq
. (Piping the output through jq
isn't strictly required but makes it much easier to read.)
$ curl -s http://localhost:8000/api/service/application/ | jq '.'