You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3.**Endpoint** - Provides CRUD operations for specific API endpoints
12
+
13
+
```python
14
+
import pynetbox
15
+
16
+
# Create API connection (Api class)
17
+
nb = pynetbox.api('http://localhost:8000', token='your-token')
18
+
19
+
# Access an app (App class)
20
+
nb.dcim # Returns an App instance
21
+
22
+
# Access an endpoint (Endpoint class)
23
+
nb.dcim.devices # Returns an Endpoint instance
24
+
25
+
# Use endpoint methods
26
+
devices = nb.dcim.devices.all()
27
+
```
28
+
29
+
## Api Class
30
+
31
+
The `Api` class is the main entry point for interacting with NetBox. It manages the HTTP session, authentication, and provides access to NetBox applications.
32
+
33
+
::: pynetbox.core.api.Api
34
+
handler: python
35
+
options:
36
+
members:
37
+
- __init__
38
+
- create_token
39
+
- openapi
40
+
- status
41
+
- version
42
+
- activate_branch
43
+
show_source: true
44
+
show_root_heading: true
45
+
heading_level: 3
46
+
47
+
## App Class
48
+
49
+
The `App` class represents a NetBox application (such as dcim, ipam, circuits). When you access an attribute on the `Api` object, it returns an `App` instance. Accessing attributes on an `App` returns `Endpoint` objects.
50
+
51
+
::: pynetbox.core.app.App
52
+
handler: python
53
+
options:
54
+
members:
55
+
- config
56
+
show_source: true
57
+
show_root_heading: true
58
+
heading_level: 3
59
+
60
+
## Relationship to Endpoints
61
+
62
+
When you access an attribute on an `App` object, it returns an [Endpoint](endpoint.md) instance:
This page documents special methods available for Circuits models in pyNetBox.
4
+
5
+
!!! note "Standard API Operations"
6
+
Standard CRUD operations (`.all()`, `.filter()`, `.get()`, `.create()`, `.update()`, `.delete()`) follow NetBox's REST API patterns. Refer to the [NetBox API documentation](https://demo.netbox.dev/api/docs/) for details on available endpoints and filters.
7
+
8
+
## Circuit Terminations
9
+
10
+
### Cable Path Tracing
11
+
12
+
Circuit terminations support cable path tracing through the `paths()` method. This method returns all cable paths that traverse through the circuit termination, showing the complete connectivity from origin to destination.
The `paths()` method returns a list of dictionaries, where each dictionary represents a complete cable path:
51
+
52
+
-`origin`: The starting endpoint of the path (Record object or None if unconnected)
53
+
-`destination`: The ending endpoint of the path (Record object or None if unconnected)
54
+
-`path`: A list of path segments, where each segment is a list of Record objects representing the components in that segment (cables, terminations, interfaces, etc.)
55
+
56
+
## Virtual Circuits
57
+
58
+
### Overview
59
+
60
+
Virtual circuits also support cable path tracing through the `paths()` method.
The `paths()` method returns a list of dictionaries, where each dictionary represents a complete cable path:
176
+
177
+
-`origin`: The starting endpoint of the path (Record object or None if unconnected)
178
+
-`destination`: The ending endpoint of the path (Record object or None if unconnected)
179
+
-`path`: A list of path segments, where each segment is a list of Record objects representing the components in that segment (cables, terminations, etc.)
0 commit comments