22
22
23
23
24
24
class Api (object ):
25
- """ The API object is the point of entry to pynetbox.
25
+ """The API object is the point of entry to pynetbox.
26
26
27
27
After instantiating the Api() with the appropriate named arguments
28
28
you can specify which app and endpoint you wish to interact with.
@@ -39,6 +39,13 @@ class Api(object):
39
39
Calling any of these attributes will return
40
40
:py:class:`.App` which exposes endpoints as attributes.
41
41
42
+ **Additional Attributes**:
43
+ * **http_session(requests.Session)**:
44
+ Override the default session with your own. This is used to control
45
+ a number of HTTP behaviors such as SSL verification, custom headers,
46
+ retires, and timeouts.
47
+ See `custom sessions <advanced.html#custom-sessions>`__ for more info.
48
+
42
49
:param str url: The base URL to the instance of NetBox you
43
50
wish to connect to.
44
51
:param str token: Your NetBox token.
@@ -77,8 +84,7 @@ def __init__(
77
84
self .http_session = requests .Session ()
78
85
if threading and sys .version_info .major == 2 :
79
86
raise NotImplementedError (
80
- "Threaded pynetbox calls not supported \
81
- in Python 2"
87
+ "Threaded pynetbox calls not supported in Python 2"
82
88
)
83
89
self .threading = threading
84
90
@@ -97,7 +103,7 @@ def __init__(
97
103
98
104
@property
99
105
def version (self ):
100
- """ Gets the API version of NetBox.
106
+ """Gets the API version of NetBox.
101
107
102
108
Can be used to check the NetBox API version if there are
103
109
version-dependent features or syntaxes in the API.
@@ -121,7 +127,7 @@ def version(self):
121
127
return version
122
128
123
129
def openapi (self ):
124
- """ Returns the OpenAPI spec.
130
+ """Returns the OpenAPI spec.
125
131
126
132
Quick helper function to pull down the entire OpenAPI spec.
127
133
0 commit comments