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
To install the most recent version of pyedgeconnect, open an
67
-
interactive shell and run:
61
+
```bash
62
+
$ pip install pyedgeconnect
63
+
```
68
64
69
-
.. note::
65
+
### Install from GitHub
70
66
71
-
These commands assume you're within a Python 3.9 venv, or Python 3.9
72
-
is the exclusive Python version installed in regard to referencing
73
-
the use of ``pip``.
74
-
75
-
If that is not the case, you can specifically append
76
-
``python3.9 -m`` ahead of the ``pip install ...``
67
+
To install the most recent version of pyedgeconnect, open an
68
+
interactive shell and run:
77
69
78
-
.. code:: python
70
+
> **Note:** These commands assume you're within a Python 3.9 venv, or Python 3.9 is the exclusive Python version installed in regard to referencing the use of ``pip``. If that is not the case, you can specifically append ``python3.9 -m`` ahead of the ``pip install ...``
To initialize an Orchestrator you must pass the url of the Orchestrator
128
121
(IP or FQDN).
129
122
130
-
.. note::
131
-
132
-
If you're connecting to an Orchestrator without a valid certificate
133
-
you'll want to set the ``verify_ssl`` paramter to ``False`` when
134
-
instantiating Orchestrator to ignore certificate warnings/errors.
135
-
136
-
.. code:: python
123
+
> **Note:** If you're connecting to an Orchestrator without a valid certificate you'll want to set the ``verify_ssl`` paramter to ``False`` when instantiating Orchestrator to ignore certificate warnings/errors.
137
124
125
+
```python
138
126
orch_url ='10.1.1.100'
139
127
orch_url ='orchestrator.example.com'
140
128
orch = Orchestrator(orch_url, verify_ssl=False)
129
+
```
141
130
142
131
Now you can call the login function to connect to Orchestrator with a
143
132
username and password:
144
133
145
-
.. code:: python
146
-
134
+
```python
147
135
orch_user ='admin'
148
136
orch_pw ='change_me'
149
137
orch.login(orch_user, orch_pw)
150
138
orch.logout()
139
+
```
151
140
152
141
Another option is to pass an API Key on init to make authenticated calls
153
142
without having to call login/logout functions
154
143
155
-
.. code:: python
156
-
144
+
```python
157
145
orch_url ='orchestrator.example.com'
158
146
orch = Orchestrator(orch_url, api_key='xxx')
147
+
```
159
148
149
+
### Edge Connect Class
160
150
161
-
Edge Connect Class
162
-
~~~~~~~~~~~~~~~~~~
163
-
164
-
.. code:: python
165
-
151
+
```python
166
152
from pyedgeconnect import EdgeConnect
153
+
```
167
154
168
155
To initialize an Edge Connect you must pass the url of the Edge Connect
169
156
(IP or FQDN).
170
157
171
-
.. note::
172
-
173
-
If you're connecting to an Edge Connect without a valid certificate
174
-
you'll want to set the ``verify_ssl`` paramter to ``False`` when
175
-
instantiating EdgeConnect to ignore certificate warnings/errors.
176
-
177
-
.. code:: python
158
+
> **Note:** If you're connecting to an Edge Connect without a valid certificate you'll want to set the ``verify_ssl`` paramter to ``False`` when instantiating EdgeConnect to ignore certificate warnings/errors.
178
159
160
+
```python
179
161
ecos_url ='10.2.30.50'
180
162
ecos_url ='edgeconnect.example.com'
181
163
ec = EdgeConnect(ecos_url, verify_ssl=False)
182
-
164
+
```
183
165
184
166
Now you can call the login function to connect to Edge Connect with a
185
167
username and password:
186
168
187
-
.. code:: python
188
-
169
+
```python
189
170
ecos_user ='admin'
190
171
ecos_pw ='admin'
191
172
ec.login(ecos_user, ecos_pw)
192
173
ec.logout()
174
+
```
193
175
194
-
195
-
Logging
196
-
------------
176
+
## Logging
197
177
198
178
By default, Orchestrator and EdgeConnect classes will not log calls
199
-
and/or errors to file or console.
179
+
and/or errors to file or console. When instantiating Orchestrator
180
+
or EdgeConnect classes follow the below settings to enable logging
181
+
options:
200
182
201
-
To enable logging to a local file, set the ``log_file`` parameter to
202
-
``True`` when instantiating :class:`~pyedgeconnect.Orchestrator`
203
-
or :class:`~pyedgeconnect.EdgeConnect`.
204
-
This will create ./logging/sp_orch.log or ./logging/sp_ecos.log relative
205
-
to where python is launched for calls that are performed.
183
+
* Logging to a local file: set the ``log_file`` parameter to
184
+
``True``. This will create ./logging/sp_orch.log or
185
+
./logging/sp_ecos.log relative to where python is launched for calls
186
+
that are performed.
206
187
207
-
To enable logging to the console, set the ``log_console`` parameter to
208
-
``True`` when instantiating :class:`~pyedgeconnect.Orchestrator`
209
-
or :class:`~pyedgeconnect.EdgeConnect`.
188
+
* Logging to the console: set the ``log_console`` parameter to
189
+
``True``
210
190
211
191
By default, successful API calls (e.g. returning HTTP 200/204 etc.) will
212
192
not log response text to avoid logging sensitive data. To include
213
193
response text in log messages, set the ``log_success`` parameter to
214
194
``True``.
215
195
216
-
.. warning::
217
-
If ``log_file`` and ``log_success`` are set to ``True``
218
-
response text from successful API calls will be logged to
219
-
the local log file. Some responses can include sensitive
220
-
data that you may not wish to retain in the log files.
221
-
222
-
.. code:: python
196
+
> **Warning:** If ``log_file`` and ``log_success`` are set to ``True`` response text from successful API calls will be logged to the local log file. Some responses can include sensitive data that you may not wish to retain in the log files.
0 commit comments