File: endpoint.md

package info (click to toggle)
python-pynetbox 7.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,296 kB
  • sloc: python: 4,343; makefile: 3
file content (46 lines) | stat: -rw-r--r-- 1,167 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Endpoint

`Endpoint` objects provide CRUD operations for NetBox API endpoints. They are automatically created when you access attributes on [App](api.md#app-class) objects.

## Overview

```python
import pynetbox

nb = pynetbox.api('http://localhost:8000', token='your-token')

# Accessing an attribute on an App returns an Endpoint
devices = nb.dcim.devices  # This is an Endpoint instance

# Use Endpoint methods for CRUD operations
all_devices = devices.all()
device = devices.get(1)
filtered = devices.filter(site='headquarters')
new_device = devices.create(name='test', site=1, device_type=1, device_role=1)
```

::: pynetbox.core.endpoint.Endpoint
    handler: python
    options:
        members:
            - all
            - choices
            - count
            - create
            - delete
            - filter
            - get
            - update
        show_source: true
        show_root_heading: true
        heading_level: 2

::: pynetbox.core.endpoint.DetailEndpoint
    handler: python
    options:
        members:
            - create
            - list
        show_source: true
        show_root_heading: true
        heading_level: 2