The Api object provides access to the Apps in Nautobot.
The Apps provide access to the Models and the field data stored in Nautobot.
Pynautobot uses the Endpoint class to represent Models.
For example, here is how to access Devices stored in Nautobot:
devices = nautobot.dcim.devices
devices
<pynautobot.core.endpoint.Endpoint object at 0x7fe801e62fa0>
Jobs
Pynautobot provides a specialized Endpoint class to represent the Jobs model. This class is called JobsEndpoint.
This extends the Endpoint class by adding the run method so pynautobot can be used to call/execute a job run.
Pynautobot provides several ways to retrieve objects from Nautobot.
Only the get() method is shown here.
To continue from the example above, the Endpoint object returned will be used to get
the device named hq-access-01.
switch = devices.get(name="hq-access-01")
The object returned from the get() method is an implementation of the Record class.
This object provides access to the field data from Nautobot.
Pynautobot supports multithreaded calls for .filter() and .all() queries. It is highly recommended you have MAX_PAGE_SIZE in your Nautobot install set to anything except0 or None. The default value of 1000 is usually a good value to use. To enable threading, add threading=True parameter when instantiating the Api object:
Used for Nautobot Rest API versioning. Versioning can be controlled globally by setting api_version on initialization of the API class and/or for a specific request e.g (all(), filter(), get(), create() etc.) by setting an optional api_version parameter.
By default, the client will not retry any operation. This behavior can be adjusted via the retries optional parameters. This will only affect HTTP codes: 429, 500, 502, 503, and 504.