Skip to content

Commit b5b1076

Browse files
authored
Version specific client creation(#12)
1 parent d3f88f9 commit b5b1076

File tree

11 files changed

+153
-494
lines changed

11 files changed

+153
-494
lines changed

docs/source/examples/index.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/source/examples/ngfw.rst

Lines changed: 0 additions & 232 deletions
This file was deleted.

docs/source/refexamples/examples/basic.rst

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,39 @@ Basic Examples
44
Create client
55
-------------
66

7+
Snippet below will load version during runtime, based on the SDWAN version it connects to. It will provide type hints for all installed versions.
8+
79
.. code-block:: python
810
911
from catalystwan.core.client import create_client
10-
12+
13+
14+
with create_client(
15+
url=SDWAN_URL,
16+
port=SDWAN_PORT,
17+
username=SDWAN_USERNAME,
18+
password=SDWAN_PASSWORD,
19+
) as client:
20+
...
21+
22+
If you want to choose version manually (and use type hints for that version alone), you can pass desired ``ApiClient`` version to the ``api_client_class`` argument.
23+
24+
.. note::
25+
26+
Keep in mind: ``api_client_class`` is a keyword only argument.
27+
28+
.. code-block:: python
29+
30+
from catalystwan.core.client import create_client
31+
from catalystwan.core.loader import load_client
32+
33+
1134
with create_client(
1235
url=SDWAN_URL,
1336
port=SDWAN_PORT,
1437
username=SDWAN_USERNAME,
1538
password=SDWAN_PASSWORD,
39+
api_client_class=load_client(version="20.15"),
1640
) as client:
1741
...
1842

0 commit comments

Comments
 (0)