catalystwan 2.0.0a1__py3-none-any.whl → 2.0.0a2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- catalystwan/core/__init__.py +1 -1
- catalystwan/core/client.py +108 -20
- catalystwan/core/models/deserialize.py +72 -39
- catalystwan/core/models/utils.py +27 -0
- catalystwan/core/request_adapter.py +33 -22
- catalystwan-2.0.0a2.dist-info/METADATA +147 -0
- {catalystwan-2.0.0a1.dist-info → catalystwan-2.0.0a2.dist-info}/RECORD +10 -9
- {catalystwan-2.0.0a1.dist-info → catalystwan-2.0.0a2.dist-info}/WHEEL +1 -1
- catalystwan-2.0.0a1.dist-info/METADATA +0 -239
- {catalystwan-2.0.0a1.dist-info → catalystwan-2.0.0a2.dist-info/licenses}/LICENSE +0 -0
- {catalystwan-2.0.0a1.dist-info → catalystwan-2.0.0a2.dist-info}/top_level.txt +0 -0
catalystwan/core/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
from catalystwan.core.client import create_client as create_client
|
|
2
|
-
from catalystwan.core.client import
|
|
2
|
+
from catalystwan.core.client import create_client_from_auth as create_client_from_auth
|
catalystwan/core/client.py
CHANGED
|
@@ -3,28 +3,74 @@ from __future__ import annotations
|
|
|
3
3
|
import logging
|
|
4
4
|
from contextlib import contextmanager
|
|
5
5
|
from copy import copy
|
|
6
|
-
from
|
|
6
|
+
from inspect import isclass
|
|
7
|
+
from typing import TYPE_CHECKING, Generator, Optional, Type, TypeVar, Union, cast, overload
|
|
7
8
|
|
|
8
9
|
from catalystwan.core.apigw_auth import ApiGwAuth
|
|
10
|
+
from catalystwan.core.exceptions import CatalystwanException
|
|
9
11
|
from catalystwan.core.loader import load_client
|
|
10
12
|
from catalystwan.core.request_adapter import RequestAdapter
|
|
11
13
|
from catalystwan.core.request_limiter import RequestLimiter
|
|
12
14
|
from catalystwan.core.session import ManagerSession, create_base_url, create_manager_session
|
|
13
15
|
from catalystwan.core.vmanage_auth import vManageAuth
|
|
16
|
+
from typing_extensions import TypeGuard
|
|
14
17
|
|
|
15
18
|
if TYPE_CHECKING:
|
|
16
19
|
from catalystwan.core.loader import ApiClient
|
|
17
20
|
|
|
18
21
|
|
|
22
|
+
class CatalystwanNotAClientException(CatalystwanException): ...
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Client = TypeVar("Client")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# TODO: Better TypeGuards - it may be hard since we want to avoid direct imports
|
|
29
|
+
# For now, it's more of a hack for typing purposes
|
|
30
|
+
def _is_client_instance(obj: object) -> TypeGuard[ApiClient]:
|
|
31
|
+
return not isclass(obj) and hasattr(obj, "api_version")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _is_client_class(obj: object) -> TypeGuard[Type[ApiClient]]:
|
|
35
|
+
return isclass(obj) and hasattr(obj, "api_version")
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@overload
|
|
39
|
+
@contextmanager
|
|
40
|
+
def create_client_from_auth(
|
|
41
|
+
url: str,
|
|
42
|
+
auth: Union[vManageAuth, ApiGwAuth],
|
|
43
|
+
port: Optional[int] = None,
|
|
44
|
+
subdomain: Optional[str] = None,
|
|
45
|
+
logger: Optional[logging.Logger] = None,
|
|
46
|
+
request_limiter: Optional[RequestLimiter] = None,
|
|
47
|
+
) -> Generator[ApiClient, None, None]: ...
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@overload
|
|
51
|
+
@contextmanager
|
|
52
|
+
def create_client_from_auth(
|
|
53
|
+
url: str,
|
|
54
|
+
auth: Union[vManageAuth, ApiGwAuth],
|
|
55
|
+
port: Optional[int] = None,
|
|
56
|
+
subdomain: Optional[str] = None,
|
|
57
|
+
logger: Optional[logging.Logger] = None,
|
|
58
|
+
request_limiter: Optional[RequestLimiter] = None,
|
|
59
|
+
*,
|
|
60
|
+
api_client_class: Type[Client],
|
|
61
|
+
) -> Generator[Client, None, None]: ...
|
|
62
|
+
|
|
63
|
+
|
|
19
64
|
@contextmanager
|
|
20
|
-
def
|
|
65
|
+
def create_client_from_auth(
|
|
21
66
|
url: str,
|
|
22
67
|
auth: Union[vManageAuth, ApiGwAuth],
|
|
23
68
|
port: Optional[int] = None,
|
|
24
69
|
subdomain: Optional[str] = None,
|
|
25
70
|
logger: Optional[logging.Logger] = None,
|
|
26
71
|
request_limiter: Optional[RequestLimiter] = None,
|
|
27
|
-
|
|
72
|
+
api_client_class: Optional[Type[Client]] = None,
|
|
73
|
+
) -> Generator[Union[ApiClient, Client], None, None]:
|
|
28
74
|
if logger is None:
|
|
29
75
|
logger = logging.getLogger(__name__)
|
|
30
76
|
session = ManagerSession(
|
|
@@ -36,12 +82,31 @@ def create_thread_client(
|
|
|
36
82
|
)
|
|
37
83
|
with session.login():
|
|
38
84
|
version = session.api_version.base_version
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
85
|
+
if api_client_class is None:
|
|
86
|
+
logger.debug(f"Choosing client for version {version}...")
|
|
87
|
+
client = load_client(session.api_version.base_version)
|
|
88
|
+
logger.debug(f"Client for version {version} loaded")
|
|
89
|
+
yield client(RequestAdapter(session=session, logger=logger))
|
|
90
|
+
elif _is_client_class(api_client_class):
|
|
91
|
+
logger.debug(f"Creating instance for client class {api_client_class}")
|
|
92
|
+
yield api_client_class(RequestAdapter(session=session, logger=logger))
|
|
93
|
+
else:
|
|
94
|
+
raise CatalystwanNotAClientException(f"{api_client_class} is not a client class")
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
@overload
|
|
98
|
+
@contextmanager
|
|
99
|
+
def create_client(
|
|
100
|
+
url: str,
|
|
101
|
+
username: str,
|
|
102
|
+
password: str,
|
|
103
|
+
port: Optional[int] = None,
|
|
104
|
+
subdomain: Optional[str] = None,
|
|
105
|
+
logger: Optional[logging.Logger] = None,
|
|
106
|
+
) -> Generator[ApiClient, None, None]: ...
|
|
43
107
|
|
|
44
108
|
|
|
109
|
+
@overload
|
|
45
110
|
@contextmanager
|
|
46
111
|
def create_client(
|
|
47
112
|
url: str,
|
|
@@ -50,22 +115,45 @@ def create_client(
|
|
|
50
115
|
port: Optional[int] = None,
|
|
51
116
|
subdomain: Optional[str] = None,
|
|
52
117
|
logger: Optional[logging.Logger] = None,
|
|
53
|
-
|
|
118
|
+
*,
|
|
119
|
+
api_client_class: Type[Client],
|
|
120
|
+
) -> Generator[Client, None, None]: ...
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
@contextmanager
|
|
124
|
+
def create_client(
|
|
125
|
+
url: str,
|
|
126
|
+
username: str,
|
|
127
|
+
password: str,
|
|
128
|
+
port: Optional[int] = None,
|
|
129
|
+
subdomain: Optional[str] = None,
|
|
130
|
+
logger: Optional[logging.Logger] = None,
|
|
131
|
+
api_client_class: Optional[Type[Client]] = None,
|
|
132
|
+
) -> Generator[Union[ApiClient, Client], None, None]:
|
|
54
133
|
if logger is None:
|
|
55
134
|
logger = logging.getLogger(__name__)
|
|
56
135
|
with create_manager_session(url, username, password, port, subdomain, logger) as session:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
136
|
+
if api_client_class is None:
|
|
137
|
+
version = session.api_version.base_version
|
|
138
|
+
logger.debug(f"Choosing client for version {version}...")
|
|
139
|
+
client = load_client(session.api_version.base_version)
|
|
140
|
+
logger.debug(f"Client for version {version} loaded")
|
|
141
|
+
yield client(RequestAdapter(session=session, logger=logger))
|
|
142
|
+
elif _is_client_class(api_client_class):
|
|
143
|
+
logger.debug(f"Creating instance for client class {api_client_class}")
|
|
144
|
+
yield api_client_class(RequestAdapter(session=session, logger=logger))
|
|
145
|
+
else:
|
|
146
|
+
raise CatalystwanNotAClientException(f"{api_client_class} is not a client class")
|
|
62
147
|
|
|
63
148
|
|
|
64
149
|
@contextmanager
|
|
65
|
-
def copy_client(client:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
150
|
+
def copy_client(client: Client) -> Generator[Client, None, None]:
|
|
151
|
+
if _is_client_instance(client):
|
|
152
|
+
request_adapter = copy(client._request_adapter)
|
|
153
|
+
session = request_adapter.session
|
|
154
|
+
with session.login():
|
|
155
|
+
new_client = load_client(session.api_version.base_version)(request_adapter)
|
|
156
|
+
assert new_client.api_version == client.api_version
|
|
157
|
+
yield cast(Client, new_client)
|
|
158
|
+
else:
|
|
159
|
+
raise CatalystwanNotAClientException(f"{client} is not a client instance")
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
from collections import deque
|
|
2
2
|
from copy import deepcopy
|
|
3
|
-
from dataclasses import fields, is_dataclass
|
|
3
|
+
from dataclasses import dataclass, fields, is_dataclass
|
|
4
4
|
from functools import reduce
|
|
5
5
|
from inspect import isclass, unwrap
|
|
6
|
-
from typing import Any, Dict, List, Literal, Protocol, Tuple, Type, TypeVar, Union
|
|
6
|
+
from typing import Any, Dict, List, Literal, Optional, Protocol, Tuple, Type, TypeVar, Union, cast
|
|
7
7
|
|
|
8
8
|
from catalystwan.core.exceptions import (
|
|
9
9
|
CatalystwanModelInputException,
|
|
10
10
|
CatalystwanModelValidationError,
|
|
11
11
|
)
|
|
12
|
+
from catalystwan.core.models.utils import count_matching_keys
|
|
12
13
|
from catalystwan.core.types import MODEL_TYPES, AliasPath, DataclassInstance
|
|
13
14
|
from typing_extensions import Annotated, get_args, get_origin, get_type_hints
|
|
14
15
|
|
|
@@ -19,6 +20,13 @@ class ValueExtractorCallable(Protocol):
|
|
|
19
20
|
def __call__(self, field_value: Any) -> Any: ...
|
|
20
21
|
|
|
21
22
|
|
|
23
|
+
@dataclass
|
|
24
|
+
class ExtractedValue:
|
|
25
|
+
value: Any
|
|
26
|
+
exact_match: bool
|
|
27
|
+
matched_keys: Optional[int] = None
|
|
28
|
+
|
|
29
|
+
|
|
22
30
|
class ModelDeserializer:
|
|
23
31
|
def __init__(self, model: Type[T]) -> None:
|
|
24
32
|
self.model = model
|
|
@@ -47,7 +55,6 @@ class ModelDeserializer:
|
|
|
47
55
|
|
|
48
56
|
def __check_errors(self):
|
|
49
57
|
if self._exceptions:
|
|
50
|
-
print(self._exceptions)
|
|
51
58
|
# Put exceptions from current model first
|
|
52
59
|
self._exceptions.sort(key=lambda x: isinstance(x, CatalystwanModelValidationError))
|
|
53
60
|
current_model_errors = sum(
|
|
@@ -58,67 +65,91 @@ class ModelDeserializer:
|
|
|
58
65
|
message += f"{exc}\n"
|
|
59
66
|
raise CatalystwanModelValidationError(message)
|
|
60
67
|
|
|
61
|
-
def
|
|
62
|
-
if get_origin(t) is Union and type(None) in get_args(t):
|
|
63
|
-
return True
|
|
64
|
-
return False
|
|
65
|
-
|
|
66
|
-
def __extract_type(self, field_type: Any, field_value: Any, field_name: str) -> Any:
|
|
68
|
+
def __extract_type(self, field_type: Any, field_value: Any, field_name: str) -> ExtractedValue:
|
|
67
69
|
origin = get_origin(field_type)
|
|
68
70
|
# check for simple types and classes
|
|
69
71
|
if origin is None:
|
|
70
|
-
if field_type is Any:
|
|
71
|
-
return field_value
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
if field_type is Any or isinstance(field_value, field_type):
|
|
73
|
+
return ExtractedValue(value=field_value, exact_match=True)
|
|
74
|
+
# Do not cast bool values
|
|
75
|
+
elif field_type is bool:
|
|
76
|
+
...
|
|
77
|
+
# False/Empty values (like empty string or list) can match to None
|
|
78
|
+
elif field_type is type(None):
|
|
79
|
+
if not field_value:
|
|
80
|
+
return ExtractedValue(value=None, exact_match=False)
|
|
74
81
|
elif is_dataclass(field_type):
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
model_instance = deserialize(
|
|
83
|
+
cast(Type[DataclassInstance], field_type), **field_value
|
|
84
|
+
)
|
|
85
|
+
return ExtractedValue(
|
|
86
|
+
value=model_instance,
|
|
87
|
+
exact_match=False,
|
|
88
|
+
matched_keys=count_matching_keys(model_instance, field_value),
|
|
89
|
+
)
|
|
77
90
|
elif isclass(unwrap(field_type)):
|
|
78
91
|
if isinstance(field_value, dict):
|
|
79
|
-
return field_type(**field_value)
|
|
92
|
+
return ExtractedValue(value=field_type(**field_value), exact_match=False)
|
|
80
93
|
else:
|
|
81
94
|
try:
|
|
82
|
-
return field_type(field_value)
|
|
95
|
+
return ExtractedValue(value=field_type(field_value), exact_match=False)
|
|
83
96
|
except ValueError:
|
|
84
97
|
raise CatalystwanModelInputException(
|
|
85
98
|
f"Unable to match or cast input value for {field_name} [expected_type={unwrap(field_type)}, input={field_value}, input_type={type(field_value)}]"
|
|
86
99
|
)
|
|
100
|
+
# List is an exact match only if all of its elements are
|
|
87
101
|
elif origin is list:
|
|
88
102
|
if isinstance(field_value, list):
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
except CatalystwanModelInputException as e:
|
|
100
|
-
if not field_value:
|
|
101
|
-
return None
|
|
102
|
-
raise e
|
|
103
|
+
values = []
|
|
104
|
+
exact_match = True
|
|
105
|
+
for value in field_value:
|
|
106
|
+
extracted_value = self.__extract_type(
|
|
107
|
+
get_args(field_type)[0], value, field_name
|
|
108
|
+
)
|
|
109
|
+
values.append(extracted_value.value)
|
|
110
|
+
if not extracted_value.exact_match:
|
|
111
|
+
exact_match = False
|
|
112
|
+
return ExtractedValue(value=values, exact_match=exact_match)
|
|
103
113
|
elif origin is Literal:
|
|
104
114
|
for arg in get_args(field_type):
|
|
105
115
|
try:
|
|
106
116
|
if type(arg)(field_value) == arg:
|
|
107
|
-
return
|
|
117
|
+
return ExtractedValue(
|
|
118
|
+
value=type(arg)(field_value), exact_match=type(arg) is type(field_value)
|
|
119
|
+
)
|
|
108
120
|
except Exception:
|
|
109
121
|
continue
|
|
110
122
|
elif origin is Annotated:
|
|
111
123
|
validator, caster = field_type.__metadata__
|
|
112
124
|
if validator(field_value):
|
|
113
|
-
return field_value
|
|
114
|
-
return caster(field_value)
|
|
115
|
-
#
|
|
125
|
+
return ExtractedValue(value=field_value, exact_match=True)
|
|
126
|
+
return ExtractedValue(value=caster(field_value), exact_match=False)
|
|
127
|
+
# When parsing Unions, try to find the best match. Currently, it involves:
|
|
128
|
+
# 1. Finding the exact match
|
|
129
|
+
# 2. If not found, favors dataclasses - sorted by number of matched keys, then None values
|
|
130
|
+
# 3. If no dataclasses are present, return the leftmost matched argument
|
|
116
131
|
elif origin is Union:
|
|
132
|
+
matches: List[ExtractedValue] = []
|
|
117
133
|
for arg in get_args(field_type):
|
|
118
134
|
try:
|
|
119
|
-
|
|
135
|
+
extracted_value = self.__extract_type(arg, field_value, field_name)
|
|
136
|
+
# exact match, return
|
|
137
|
+
if extracted_value.exact_match:
|
|
138
|
+
return extracted_value
|
|
139
|
+
else:
|
|
140
|
+
matches.append(extracted_value)
|
|
120
141
|
except Exception:
|
|
121
142
|
continue
|
|
143
|
+
# Only one element matched, return
|
|
144
|
+
if len(matches) == 1:
|
|
145
|
+
return matches[0]
|
|
146
|
+
# Only non-exact matches left, sort and return first element
|
|
147
|
+
elif len(matches) > 1:
|
|
148
|
+
matches.sort(
|
|
149
|
+
key=lambda x: (x.matched_keys is not None, x.matched_keys, x.value is None),
|
|
150
|
+
reverse=True,
|
|
151
|
+
)
|
|
152
|
+
return matches[0]
|
|
122
153
|
# Correct type not found, add exception
|
|
123
154
|
raise CatalystwanModelInputException(
|
|
124
155
|
f"Unable to match or cast input value for {field_name} [expected_type={unwrap(field_type)}, input={field_value}, input_type={type(field_value)}]"
|
|
@@ -131,7 +162,7 @@ class ModelDeserializer:
|
|
|
131
162
|
kwargs_copy = deepcopy(kwargs)
|
|
132
163
|
new_args = []
|
|
133
164
|
new_kwargs = {}
|
|
134
|
-
field_types = get_type_hints(cls)
|
|
165
|
+
field_types = get_type_hints(cls, include_extras=True)
|
|
135
166
|
for field in fields(cls):
|
|
136
167
|
if not field.init:
|
|
137
168
|
continue
|
|
@@ -141,7 +172,9 @@ class ModelDeserializer:
|
|
|
141
172
|
field_value = args_copy.popleft()
|
|
142
173
|
try:
|
|
143
174
|
new_args.append(
|
|
144
|
-
self.__extract_type(
|
|
175
|
+
self.__extract_type(
|
|
176
|
+
field_type, value_extractor(field_value), field.name
|
|
177
|
+
).value
|
|
145
178
|
)
|
|
146
179
|
except (
|
|
147
180
|
CatalystwanModelInputException,
|
|
@@ -165,7 +198,7 @@ class ModelDeserializer:
|
|
|
165
198
|
try:
|
|
166
199
|
new_kwargs[field.name] = self.__extract_type(
|
|
167
200
|
field_type, value_extractor(field_value), field.name
|
|
168
|
-
)
|
|
201
|
+
).value
|
|
169
202
|
except (
|
|
170
203
|
CatalystwanModelInputException,
|
|
171
204
|
CatalystwanModelValidationError,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from dataclasses import is_dataclass
|
|
2
|
+
from typing import TypeVar, cast
|
|
3
|
+
|
|
4
|
+
from catalystwan.core.types import DataclassInstance
|
|
5
|
+
|
|
6
|
+
DataclassType = TypeVar("DataclassType", bound=DataclassInstance)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def count_matching_keys(model: DataclassType, model_payload: dict):
|
|
10
|
+
matched_keys = 0
|
|
11
|
+
for key, value in model_payload.items():
|
|
12
|
+
try:
|
|
13
|
+
model_value = getattr(model, key)
|
|
14
|
+
matched_keys += 1
|
|
15
|
+
if is_dataclass(model_value) and isinstance(value, dict):
|
|
16
|
+
matched_keys += count_matching_keys(cast(DataclassType, model_value), value)
|
|
17
|
+
elif (
|
|
18
|
+
isinstance(model_value, list)
|
|
19
|
+
and all([is_dataclass(element) for element in model_value])
|
|
20
|
+
and isinstance(value, list)
|
|
21
|
+
):
|
|
22
|
+
for model_v, input_v in zip(model_value, value):
|
|
23
|
+
matched_keys += count_matching_keys(model_v, input_v)
|
|
24
|
+
except AttributeError:
|
|
25
|
+
continue
|
|
26
|
+
|
|
27
|
+
return matched_keys
|
|
@@ -4,7 +4,7 @@ import logging
|
|
|
4
4
|
from copy import copy
|
|
5
5
|
from dataclasses import dataclass, field, fields, is_dataclass
|
|
6
6
|
from string import Formatter
|
|
7
|
-
from typing import Any, Dict, List, Optional, Type, TypeVar, Union, cast
|
|
7
|
+
from typing import Any, Dict, List, Literal, Optional, Tuple, Type, TypeVar, Union, cast
|
|
8
8
|
|
|
9
9
|
from catalystwan.abc import RequestAdapterInterface, ResponseInterface, SessionInterface
|
|
10
10
|
from catalystwan.abc.types import HTTP_METHOD, JSON
|
|
@@ -14,6 +14,7 @@ from catalystwan.core.exceptions import (
|
|
|
14
14
|
)
|
|
15
15
|
from catalystwan.core.models.deserialize import deserialize
|
|
16
16
|
from catalystwan.core.models.serialize import serialize
|
|
17
|
+
from catalystwan.core.models.utils import count_matching_keys
|
|
17
18
|
from catalystwan.core.types import DataclassInstance
|
|
18
19
|
from typing_extensions import get_args, get_origin
|
|
19
20
|
|
|
@@ -213,34 +214,44 @@ class RequestAdapter(RequestAdapterInterface):
|
|
|
213
214
|
# return model that matches best with the input
|
|
214
215
|
valid_models.sort(
|
|
215
216
|
key=lambda x: (
|
|
216
|
-
|
|
217
|
+
count_matching_keys(x.model, cast(dict, x.payload.data)),
|
|
217
218
|
x.payload.priority,
|
|
218
219
|
),
|
|
219
220
|
reverse=True,
|
|
220
221
|
)
|
|
221
222
|
return valid_models[0].model
|
|
222
223
|
|
|
223
|
-
def
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
)
|
|
233
|
-
elif (
|
|
234
|
-
isinstance(model_value, list)
|
|
235
|
-
and all([is_dataclass(element) for element in model_value])
|
|
236
|
-
and isinstance(value, list)
|
|
237
|
-
):
|
|
238
|
-
for model_v, input_v in zip(model_value, value):
|
|
239
|
-
matched_keys += self.__count_matching_keys(model_v, input_v)
|
|
240
|
-
except AttributeError:
|
|
224
|
+
def param_checker(self, required_params: List[Tuple[Any, Any]], excluded_params: List[Any]):
|
|
225
|
+
for param in excluded_params:
|
|
226
|
+
if param is not None:
|
|
227
|
+
return False
|
|
228
|
+
for param_value, expected_type in required_params:
|
|
229
|
+
if param_value is None:
|
|
230
|
+
return False
|
|
231
|
+
origin = get_origin(expected_type)
|
|
232
|
+
if origin is Any:
|
|
241
233
|
continue
|
|
242
|
-
|
|
243
|
-
|
|
234
|
+
elif origin is None:
|
|
235
|
+
if type(param_value) is not expected_type:
|
|
236
|
+
return False
|
|
237
|
+
elif origin is Literal:
|
|
238
|
+
if param_value not in get_args(expected_type):
|
|
239
|
+
return False
|
|
240
|
+
# This part assumes List and Unions are not overly complex, allowing get_args to flatten the list of types
|
|
241
|
+
elif origin is list:
|
|
242
|
+
if type(param_value) is not list:
|
|
243
|
+
return False
|
|
244
|
+
args = get_args(expected_type)
|
|
245
|
+
if Any in args:
|
|
246
|
+
continue
|
|
247
|
+
if type(param_value) not in args:
|
|
248
|
+
return False
|
|
249
|
+
elif origin is Union:
|
|
250
|
+
if type(param_value) not in get_args(expected_type):
|
|
251
|
+
return False
|
|
252
|
+
else:
|
|
253
|
+
continue
|
|
254
|
+
return True
|
|
244
255
|
|
|
245
256
|
def __copy__(self) -> RequestAdapter:
|
|
246
257
|
return RequestAdapter(session=copy(self.session), logger=self.logger)
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: catalystwan
|
|
3
|
+
Version: 2.0.0a2
|
|
4
|
+
Summary: Cisco Catalyst WAN SDK for Python
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://github.com/cisco-en-programmability/catalystwan-sdk-next-python
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Programming Language :: Python
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Topic :: Internet
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: packaging>=23.0
|
|
22
|
+
Requires-Dist: requests>=2.32.3
|
|
23
|
+
Requires-Dist: typing-extensions>=4.12.2
|
|
24
|
+
Requires-Dist: urllib3>=2.2.2
|
|
25
|
+
Requires-Dist: catalystwan-types==2.0.0a0
|
|
26
|
+
Requires-Dist: catalystwan-v20-15==2.0.0a1
|
|
27
|
+
Requires-Dist: catalystwan-v20-16==2.0.0a1
|
|
28
|
+
Provides-Extra: test
|
|
29
|
+
Requires-Dist: pytest>=8.2.2; extra == "test"
|
|
30
|
+
Provides-Extra: ver-all
|
|
31
|
+
Requires-Dist: catalystwan-v20-15==2.0.0a1; extra == "ver-all"
|
|
32
|
+
Requires-Dist: catalystwan-v20-16==2.0.0a1; extra == "ver-all"
|
|
33
|
+
Provides-Extra: ver-2015
|
|
34
|
+
Requires-Dist: catalystwan-v20-15==2.0.0a1; extra == "ver-2015"
|
|
35
|
+
Provides-Extra: ver-2016
|
|
36
|
+
Requires-Dist: catalystwan-v20-16==2.0.0a1; extra == "ver-2016"
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
Cisco Catalyst WAN SDK 2.0
|
|
40
|
+
==========================
|
|
41
|
+
|
|
42
|
+
Welcome to the official documentation for the Cisco Catalyst WAN SDK, a package designed for creating simple and parallel automatic requests via the official SD-WAN Manager API.
|
|
43
|
+
|
|
44
|
+
Overview
|
|
45
|
+
--------
|
|
46
|
+
|
|
47
|
+
Cisco Catalyst WAN SDK serves as a multiple session handler (provider, provider as a tenant, tenant) and is environment-independent. You just need a connection to any SD-WAN Manager.
|
|
48
|
+
|
|
49
|
+
Supported Catalystwan WAN Server Versions
|
|
50
|
+
-----------------------------------------
|
|
51
|
+
|
|
52
|
+
- 20.15
|
|
53
|
+
- 20.16
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
Important Notice: Version Incompatibility
|
|
57
|
+
-----------------------------------------
|
|
58
|
+
|
|
59
|
+
We are excited to announce the release of Cisco Catalyst WAN SDK version 2.0.
|
|
60
|
+
This new version introduces a range of enhancements and features designed
|
|
61
|
+
to improve performance and usability. However, it is important to note that version 2.0
|
|
62
|
+
is not compatible with any previous legacy versions of the SDK.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
Actions Recommended:
|
|
66
|
+
Backup: Ensure you have backups of your current projects before attempting to upgrade.
|
|
67
|
+
Review Documentation: Carefully review the updated documentation and release notes for guidance on migration and new features.
|
|
68
|
+
Test Thoroughly: Test your projects thoroughly in a development environment before deploying version 2.0 in production.
|
|
69
|
+
|
|
70
|
+
We appreciate your understanding and cooperation as we continue to enhance the Cisco Catalyst WAN SDK. Should you have any questions or require assistance, please reach out through our support channels.
|
|
71
|
+
|
|
72
|
+
Thank you for your continued support and feedback!
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
Not recommend to use in production environments.
|
|
76
|
+
------------------------------------------------
|
|
77
|
+
Cisco Catalyst WAN SDK in its `pre-alpha` release phase. This marks a significant milestone
|
|
78
|
+
in empowering developers to unlock the full capabilities of Cisco's networking solutions.
|
|
79
|
+
Please note that, as a pre-alpha release, this version of the SDK is still in active development
|
|
80
|
+
and testing. It is provided "as is," with limited support offered on a best-effort basis.
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
Supported Python Versions
|
|
84
|
+
-------------------------
|
|
85
|
+
|
|
86
|
+
Python >= 3.8
|
|
87
|
+
|
|
88
|
+
> If you don't have a specific version, you can just use [Pyenv](https://github.com/pyenv/pyenv) to manage Python versions.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
Installation
|
|
92
|
+
------------
|
|
93
|
+
|
|
94
|
+
To install the SDK, run the following command:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install catalystwan==2.0.0a0
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
To manually install the necessary Python packages in editable mode, you can use the `pip install -e` command.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pip install -e ./packages/catalystwan-types \
|
|
104
|
+
-e ./packages/catalystwan-core \
|
|
105
|
+
-e ./versions/catalystwan-v20_15 \
|
|
106
|
+
-e ./versions/catalystwan-v20_16
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
Getting Started
|
|
111
|
+
---------------
|
|
112
|
+
|
|
113
|
+
To execute SDK APIs, you need to create a `ApiClient`. Use the `create_client()` method to configure a session, perform authentication, and obtain a `ApiClient` instance in an operational state.
|
|
114
|
+
|
|
115
|
+
### Example Usage
|
|
116
|
+
|
|
117
|
+
Here's a quick example of how to use the SDK:
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
from catalystwan.core import create_client
|
|
121
|
+
|
|
122
|
+
url = "example.com"
|
|
123
|
+
username = "admin"
|
|
124
|
+
password = "password123"
|
|
125
|
+
|
|
126
|
+
with create_client(url=url, username=username, password=password) as client:
|
|
127
|
+
result = client.health.devices.get_devices_health()
|
|
128
|
+
print(result)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
If you need to preform more complex operations that require models, they can utilize an alias: `m`.
|
|
132
|
+
```python
|
|
133
|
+
|
|
134
|
+
with create_client(...) as client:
|
|
135
|
+
result = client.admin.aaa.update_aaa_config(
|
|
136
|
+
client.admin.aaa.m.Aaa(
|
|
137
|
+
accounting: True,
|
|
138
|
+
admin_auth_order: False,
|
|
139
|
+
audit_disable: False,
|
|
140
|
+
auth_fallback: False,
|
|
141
|
+
auth_order: ["local"]
|
|
142
|
+
)
|
|
143
|
+
)
|
|
144
|
+
print(result)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Using an alias allows for easier access and management of models, simplifying workflows and improving efficiency. This approach helps streamline operations without requiring direct integration with underlying models, making them more user-friendly and scalable.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
catalystwan/core/__init__.py,sha256=
|
|
1
|
+
catalystwan/core/__init__.py,sha256=KRpud-erJoWEkgvlT6ZIEcrwx6lN96KSPyFLHEIfpAI,154
|
|
2
2
|
catalystwan/core/abstractions.py,sha256=-Srp20skc9WDu6m2zGUjA34rEJPd12XQgDTGf_qicXk,738
|
|
3
3
|
catalystwan/core/apigw_auth.py,sha256=-ZnoXzMB86SuRhJ5o7OL9BuVJTZvKQp9EW1zWu_4Iao,4706
|
|
4
|
-
catalystwan/core/client.py,sha256=
|
|
4
|
+
catalystwan/core/client.py,sha256=skQ-ZrwFEn7w5MpS2lWew74cy5fJm3IeLD0MkWnR27c,5527
|
|
5
5
|
catalystwan/core/encoder.py,sha256=hY_Osk9yyqvDgveB2pHmH5kzAzIO11vNT-kmSEmvgGA,243
|
|
6
6
|
catalystwan/core/exceptions.py,sha256=Fhs69uEe-Uq4G4q3XS4N4oSQZJcjmlbL9jKtNkRWspQ,6680
|
|
7
7
|
catalystwan/core/loader.py,sha256=AGjXJEt3qptG-B7iCKhXG0Y9p-wfG_-xD4H_6aSEiQ4,1133
|
|
8
8
|
catalystwan/core/metadata.py,sha256=JIXC3um36dWLkEWCADo8pxsCsq8jjPguHF1u-4Ws2FQ,2102
|
|
9
9
|
catalystwan/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
catalystwan/core/request_adapter.py,sha256=
|
|
10
|
+
catalystwan/core/request_adapter.py,sha256=q1qOSJ5Cv9Tfiw2EED6WLMeT3cy2YPvRCQWm4HIDRmk,10218
|
|
11
11
|
catalystwan/core/request_limiter.py,sha256=l0afY5HCpXCC_M6RoQSlg-X3k_bnTLieHGFfopuBDCk,521
|
|
12
12
|
catalystwan/core/response.py,sha256=xj3MwOUt8lj4M3rElR5vnRThHlN1lU6xsNOCBsY1QXc,7824
|
|
13
13
|
catalystwan/core/session.py,sha256=3uqHslMzq4CD_N0IEzygnEgbTGEi0NT1ljqA0CmuE8U,21504
|
|
@@ -15,10 +15,11 @@ catalystwan/core/types.py,sha256=X-u8OdRkCmJFA7NWZIgsrxvu83vFoDey5Z4Bqha0fdc,702
|
|
|
15
15
|
catalystwan/core/version.py,sha256=cVKyfW_COPiF961Wlo3Gf5JL-2ZoFC1TfEfh49EUBEg,2959
|
|
16
16
|
catalystwan/core/vmanage_auth.py,sha256=dJwxtA6XgOSghlrhW4G2kBbNaTHBPsTBSmg4-kuMLGc,11019
|
|
17
17
|
catalystwan/core/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
catalystwan/core/models/deserialize.py,sha256=
|
|
18
|
+
catalystwan/core/models/deserialize.py,sha256=5_vq7Ay7eCbntG0Mf9_BnNTqo_uIqDxq64ahrhaqwLY,10135
|
|
19
19
|
catalystwan/core/models/serialize.py,sha256=RW8zJ4NUMwIBtOaoLLuFTx5WS2rQdcfKiARjA3XX-W0,5110
|
|
20
|
-
catalystwan
|
|
21
|
-
catalystwan-2.0.
|
|
22
|
-
catalystwan-2.0.
|
|
23
|
-
catalystwan-2.0.
|
|
24
|
-
catalystwan-2.0.
|
|
20
|
+
catalystwan/core/models/utils.py,sha256=9crw0Nrm05sJkKjcyDwPU5eM5QgTUUmYf-asxdkkYe0,995
|
|
21
|
+
catalystwan-2.0.0a2.dist-info/licenses/LICENSE,sha256=97ROi91Vxrj_Jio2v8FI9E8-y6x2uYdQRaFlrEbVjkc,11375
|
|
22
|
+
catalystwan-2.0.0a2.dist-info/METADATA,sha256=EcehBxcKF1U4sjjgNYGi8s3csD6JqiS0tYx5OWlNInc,5415
|
|
23
|
+
catalystwan-2.0.0a2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
24
|
+
catalystwan-2.0.0a2.dist-info/top_level.txt,sha256=0mv3rTOajNOAxvPHv_tHJpukVsP0plO5rD1ORKVDUM4,12
|
|
25
|
+
catalystwan-2.0.0a2.dist-info/RECORD,,
|
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: catalystwan
|
|
3
|
-
Version: 2.0.0a1
|
|
4
|
-
Summary: Cisco Catalyst WAN SDK for Python
|
|
5
|
-
License: Apache License
|
|
6
|
-
Version 2.0, January 2004
|
|
7
|
-
http://www.apache.org/licenses/
|
|
8
|
-
|
|
9
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
10
|
-
|
|
11
|
-
1. Definitions.
|
|
12
|
-
|
|
13
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
14
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
15
|
-
|
|
16
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
17
|
-
the copyright owner that is granting the License.
|
|
18
|
-
|
|
19
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
20
|
-
other entities that control, are controlled by, or are under common
|
|
21
|
-
control with that entity. For the purposes of this definition,
|
|
22
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
23
|
-
direction or management of such entity, whether by contract or
|
|
24
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
25
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
26
|
-
|
|
27
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
28
|
-
exercising permissions granted by this License.
|
|
29
|
-
|
|
30
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
31
|
-
including but not limited to software source code, documentation
|
|
32
|
-
source, and configuration files.
|
|
33
|
-
|
|
34
|
-
"Object" form shall mean any form resulting from mechanical
|
|
35
|
-
transformation or translation of a Source form, including but
|
|
36
|
-
not limited to compiled object code, generated documentation,
|
|
37
|
-
and conversions to other media types.
|
|
38
|
-
|
|
39
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
40
|
-
Object form, made available under the License, as indicated by a
|
|
41
|
-
copyright notice that is included in or attached to the work
|
|
42
|
-
(an example is provided in the Appendix below).
|
|
43
|
-
|
|
44
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
45
|
-
form, that is based on (or derived from) the Work and for which the
|
|
46
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
47
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
48
|
-
of this License, Derivative Works shall not include works that remain
|
|
49
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
50
|
-
the Work and Derivative Works thereof.
|
|
51
|
-
|
|
52
|
-
"Contribution" shall mean any work of authorship, including
|
|
53
|
-
the original version of the Work and any modifications or additions
|
|
54
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
55
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
56
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
57
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
58
|
-
means any form of electronic, verbal, or written communication sent
|
|
59
|
-
to the Licensor or its representatives, including but not limited to
|
|
60
|
-
communication on electronic mailing lists, source code control systems,
|
|
61
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
62
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
63
|
-
excluding communication that is conspicuously marked or otherwise
|
|
64
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
65
|
-
|
|
66
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
67
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
68
|
-
subsequently incorporated within the Work.
|
|
69
|
-
|
|
70
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
71
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
74
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
75
|
-
Work and such Derivative Works in Source or Object form.
|
|
76
|
-
|
|
77
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
78
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
79
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
80
|
-
(except as stated in this section) patent license to make, have made,
|
|
81
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
82
|
-
where such license applies only to those patent claims licensable
|
|
83
|
-
by such Contributor that are necessarily infringed by their
|
|
84
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
85
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
86
|
-
institute patent litigation against any entity (including a
|
|
87
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
88
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
89
|
-
or contributory patent infringement, then any patent licenses
|
|
90
|
-
granted to You under this License for that Work shall terminate
|
|
91
|
-
as of the date such litigation is filed.
|
|
92
|
-
|
|
93
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
94
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
95
|
-
modifications, and in Source or Object form, provided that You
|
|
96
|
-
meet the following conditions:
|
|
97
|
-
|
|
98
|
-
(a) You must give any other recipients of the Work or
|
|
99
|
-
Derivative Works a copy of this License; and
|
|
100
|
-
|
|
101
|
-
(b) You must cause any modified files to carry prominent notices
|
|
102
|
-
stating that You changed the files; and
|
|
103
|
-
|
|
104
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
105
|
-
that You distribute, all copyright, patent, trademark, and
|
|
106
|
-
attribution notices from the Source form of the Work,
|
|
107
|
-
excluding those notices that do not pertain to any part of
|
|
108
|
-
the Derivative Works; and
|
|
109
|
-
|
|
110
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
111
|
-
distribution, then any Derivative Works that You distribute must
|
|
112
|
-
include a readable copy of the attribution notices contained
|
|
113
|
-
within such NOTICE file, excluding those notices that do not
|
|
114
|
-
pertain to any part of the Derivative Works, in at least one
|
|
115
|
-
of the following places: within a NOTICE text file distributed
|
|
116
|
-
as part of the Derivative Works; within the Source form or
|
|
117
|
-
documentation, if provided along with the Derivative Works; or,
|
|
118
|
-
within a display generated by the Derivative Works, if and
|
|
119
|
-
wherever such third-party notices normally appear. The contents
|
|
120
|
-
of the NOTICE file are for informational purposes only and
|
|
121
|
-
do not modify the License. You may add Your own attribution
|
|
122
|
-
notices within Derivative Works that You distribute, alongside
|
|
123
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
124
|
-
that such additional attribution notices cannot be construed
|
|
125
|
-
as modifying the License.
|
|
126
|
-
|
|
127
|
-
You may add Your own copyright statement to Your modifications and
|
|
128
|
-
may provide additional or different license terms and conditions
|
|
129
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
130
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
131
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
132
|
-
the conditions stated in this License.
|
|
133
|
-
|
|
134
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
135
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
136
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
137
|
-
this License, without any additional terms or conditions.
|
|
138
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
139
|
-
the terms of any separate license agreement you may have executed
|
|
140
|
-
with Licensor regarding such Contributions.
|
|
141
|
-
|
|
142
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
143
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
144
|
-
except as required for reasonable and customary use in describing the
|
|
145
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
146
|
-
|
|
147
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
148
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
149
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
150
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
151
|
-
implied, including, without limitation, any warranties or conditions
|
|
152
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
153
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
154
|
-
appropriateness of using or redistributing the Work and assume any
|
|
155
|
-
risks associated with Your exercise of permissions under this License.
|
|
156
|
-
|
|
157
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
158
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
159
|
-
unless required by applicable law (such as deliberate and grossly
|
|
160
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
161
|
-
liable to You for damages, including any direct, indirect, special,
|
|
162
|
-
incidental, or consequential damages of any character arising as a
|
|
163
|
-
result of this License or out of the use or inability to use the
|
|
164
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
165
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
166
|
-
other commercial damages or losses), even if such Contributor
|
|
167
|
-
has been advised of the possibility of such damages.
|
|
168
|
-
|
|
169
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
170
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
171
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
172
|
-
or other liability obligations and/or rights consistent with this
|
|
173
|
-
License. However, in accepting such obligations, You may act only
|
|
174
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
175
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
176
|
-
defend, and hold each Contributor harmless for any liability
|
|
177
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
178
|
-
of your accepting any such warranty or additional liability.
|
|
179
|
-
|
|
180
|
-
END OF TERMS AND CONDITIONS
|
|
181
|
-
|
|
182
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
183
|
-
|
|
184
|
-
To apply the Apache License to your work, attach the following
|
|
185
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
186
|
-
replaced with your own identifying information. (Don't include
|
|
187
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
188
|
-
comment syntax for the file format. We also recommend that a
|
|
189
|
-
file or class name and description of purpose be included on the
|
|
190
|
-
same "printed page" as the copyright notice for easier
|
|
191
|
-
identification within third-party archives.
|
|
192
|
-
|
|
193
|
-
Copyright (c) 2024 Cisco Systems, Inc. and/or its affiliates
|
|
194
|
-
|
|
195
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
196
|
-
you may not use this file except in compliance with the License.
|
|
197
|
-
You may obtain a copy of the License at
|
|
198
|
-
|
|
199
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
200
|
-
|
|
201
|
-
Unless required by applicable law or agreed to in writing, software
|
|
202
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
203
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
204
|
-
See the License for the specific language governing permissions and
|
|
205
|
-
limitations under the License.
|
|
206
|
-
|
|
207
|
-
Project-URL: Homepage, https://github.com/cisco-en-programmability/catalystwan-sdk-next-python
|
|
208
|
-
Classifier: Development Status :: 3 - Alpha
|
|
209
|
-
Classifier: Intended Audience :: Developers
|
|
210
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
211
|
-
Classifier: Programming Language :: Python
|
|
212
|
-
Classifier: Programming Language :: Python :: 3
|
|
213
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
214
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
215
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
216
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
217
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
218
|
-
Classifier: Operating System :: OS Independent
|
|
219
|
-
Classifier: Topic :: Internet
|
|
220
|
-
Requires-Python: >=3.8
|
|
221
|
-
Description-Content-Type: text/markdown
|
|
222
|
-
License-File: LICENSE
|
|
223
|
-
Requires-Dist: packaging >=23.0
|
|
224
|
-
Requires-Dist: requests >=2.32.3
|
|
225
|
-
Requires-Dist: typing-extensions >=4.12.2
|
|
226
|
-
Requires-Dist: urllib3 >=2.2.2
|
|
227
|
-
Requires-Dist: catalystwan-types ==2.0.0a0
|
|
228
|
-
Requires-Dist: catalystwan-v20-15 ==2.0.0a1
|
|
229
|
-
Requires-Dist: catalystwan-v20-16 ==2.0.0a1
|
|
230
|
-
Provides-Extra: test
|
|
231
|
-
Requires-Dist: pytest >=8.2.2 ; extra == 'test'
|
|
232
|
-
Provides-Extra: ver-2015
|
|
233
|
-
Requires-Dist: catalystwan-v20-15 ==2.0.0a1 ; extra == 'ver-2015'
|
|
234
|
-
Provides-Extra: ver-2016
|
|
235
|
-
Requires-Dist: catalystwan-v20-16 ==2.0.0a1 ; extra == 'ver-2016'
|
|
236
|
-
Provides-Extra: ver-all
|
|
237
|
-
Requires-Dist: catalystwan-v20-15 ==2.0.0a1 ; extra == 'ver-all'
|
|
238
|
-
Requires-Dist: catalystwan-v20-16 ==2.0.0a1 ; extra == 'ver-all'
|
|
239
|
-
|
|
File without changes
|
|
File without changes
|