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
Copy file name to clipboardExpand all lines: docs/advanced.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,11 +138,11 @@ except pynetbox.core.query.ParameterValidationError as e:
138
138
# Error: 'iste' is not a valid filter parameter for dcim.devices
139
139
```
140
140
141
-
# Custom Sessions
141
+
##Custom Sessions
142
142
143
143
Custom sessions can be used to modify the default HTTP behavior. Below are a few examples, most of them from [here](https://hodovi.ch/blog/advanced-usage-python-requests-timeouts-retries-hooks/).
144
144
145
-
## Headers
145
+
###Headers
146
146
147
147
To set a custom header on all requests. These headers are automatically merged with headers pynetbox sets itself.
148
148
@@ -160,7 +160,7 @@ nb = pynetbox.api(
160
160
nb.http_session = session
161
161
```
162
162
163
-
## SSL Verification
163
+
###SSL Verification
164
164
165
165
To disable SSL verification. See [the docs](https://requests.readthedocs.io/en/stable/user/advanced/#ssl-cert-verification).
166
166
@@ -178,7 +178,7 @@ nb = pynetbox.api(
178
178
nb.http_session = session
179
179
```
180
180
181
-
## Timeouts
181
+
###Timeouts
182
182
183
183
Setting timeouts requires the use of Adapters.
184
184
@@ -208,11 +208,11 @@ nb = pynetbox.api(
208
208
nb.http_session = session
209
209
```
210
210
211
-
# File Uploads (Image Attachments)
211
+
##File Uploads (Image Attachments)
212
212
213
213
Pynetbox supports file uploads for endpoints that accept them, such as image attachments. When you pass a file-like object (anything with a `.read()` method) to `create()`, pynetbox automatically detects it and uses multipart/form-data encoding instead of JSON.
214
214
215
-
## Creating an Image Attachment
215
+
###Creating an Image Attachment
216
216
217
217
```python
218
218
import pynetbox
@@ -232,7 +232,7 @@ with open('/path/to/image.png', 'rb') as f:
Copy file name to clipboardExpand all lines: docs/endpoint.md
+21-4Lines changed: 21 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,26 @@
1
1
# Endpoint
2
2
3
+
`Endpoint` objects provide CRUD operations for NetBox API endpoints. They are automatically created when you access attributes on [App](api.md#app-class) objects.
4
+
5
+
## Overview
6
+
7
+
```python
8
+
import pynetbox
9
+
10
+
nb = pynetbox.api('http://localhost:8000', token='your-token')
11
+
12
+
# Accessing an attribute on an App returns an Endpoint
13
+
devices = nb.dcim.devices # This is an Endpoint instance
0 commit comments