codosdk 1.0.26__tar.gz → 1.0.27__tar.gz
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.
- {codosdk-1.0.26 → codosdk-1.0.27}/PKG-INFO +1 -1
- {codosdk-1.0.26 → codosdk-1.0.27}/codosdk.egg-info/PKG-INFO +1 -1
- {codosdk-1.0.26 → codosdk-1.0.27}/setup.py +1 -1
- codosdk-1.0.27/websdk2/api_set.py +57 -0
- codosdk-1.0.26/websdk2/api_set.py +0 -43
- {codosdk-1.0.26 → codosdk-1.0.27}/LICENSE +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/README.md +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/codosdk.egg-info/SOURCES.txt +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/codosdk.egg-info/dependency_links.txt +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/codosdk.egg-info/requires.txt +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/codosdk.egg-info/top_level.txt +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/opssdk/__init__.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/opssdk/utils/__init__.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/pyproject.toml +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/setup.cfg +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/__init__.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/apis/__init__.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/apis/admin_apis.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/apis/agent_apis.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/apis/cmdb_apis.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/apis/kerrigan_apis.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/apis/mgv4_apis.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/apis/notice_apis.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/apis/task_apis.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/application.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/base_handler.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/cache.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/cache_context.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/client.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/cloud/__init__.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/cloud/qcloud_api.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/cloud/ucloud_api.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/cloud_utils.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/configs.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/consts.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/crud_utils.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/db_context.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/error.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/fetch_coroutine.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/jwt_token.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/ldap.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/logger.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/model_utils.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/mqhelper.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/program.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/salt_api.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/sqlalchemy_pagination.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/tools.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/utils/__init__.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/utils/cc_crypto.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/utils/date_format.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/utils/pydantic_utils.py +0 -0
- {codosdk-1.0.26 → codosdk-1.0.27}/websdk2/web_logs.py +0 -0
|
@@ -9,7 +9,7 @@ desc : CODO SDK
|
|
|
9
9
|
import sys
|
|
10
10
|
from setuptools import setup, find_packages
|
|
11
11
|
|
|
12
|
-
VERSION = '1.0.
|
|
12
|
+
VERSION = '1.0.27'
|
|
13
13
|
|
|
14
14
|
if sys.version_info < (2, 7) or (3, 0) <= sys.version_info < (3, 6):
|
|
15
15
|
print('This program requires at least Python 2.7 or 3.6 to run.')
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
Version : 0.0.1
|
|
5
|
+
Contact : 191715030@qq.com
|
|
6
|
+
Author : shenshuo
|
|
7
|
+
Date : 2025/02/12 17:56
|
|
8
|
+
Desc : API集合
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from .tools import singleton
|
|
12
|
+
from .apis import AdminAPIS, TaskAPIS, KerriganAPIS, AdminV4APIS, CMDBAPIS, AgentAPIS, NoticeAPIS
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@singleton
|
|
16
|
+
class ConstAPIS(AdminAPIS, TaskAPIS, KerriganAPIS, AdminV4APIS, CMDBAPIS, AgentAPIS, NoticeAPIS):
|
|
17
|
+
"""
|
|
18
|
+
集合所有常用 API 配置的常量类,继承了各个 API 模块的接口配置。
|
|
19
|
+
|
|
20
|
+
提供了对 API 配置项的只读管理,并且对每个新增属性值进行校验。
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self):
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
def __setattr__(self, name: str, value: dict) -> None:
|
|
27
|
+
|
|
28
|
+
"""
|
|
29
|
+
自定义属性设置方法,确保 API 配置项的合法性。
|
|
30
|
+
|
|
31
|
+
校验条件:
|
|
32
|
+
1. 不允许重新绑定常量。
|
|
33
|
+
2. 属性值必须是字典格式。
|
|
34
|
+
3. 必须包含 'url' 和 'description' 字段。
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
name (str): 属性名称
|
|
38
|
+
value (dict): 属性值,必须为字典格式并包含必要字段
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
if name in self.__dict__:
|
|
42
|
+
raise TypeError(f"Cannot rebind constant '{name}'.")
|
|
43
|
+
|
|
44
|
+
if not isinstance(value, dict):
|
|
45
|
+
raise TypeError(f"Value for '{name}' must be a dictionary.")
|
|
46
|
+
|
|
47
|
+
# 确保包含 'url' 和 'description' 字段
|
|
48
|
+
if 'url' not in value:
|
|
49
|
+
raise TypeError(f"Value for '{name}' must contain 'url'.")
|
|
50
|
+
|
|
51
|
+
if 'description' not in value:
|
|
52
|
+
raise TypeError(f"Value for '{name}' must contain 'description'.")
|
|
53
|
+
|
|
54
|
+
self.__dict__[name] = value
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
api_set = ConstAPIS()
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
"""
|
|
4
|
-
Version : 0.0.1
|
|
5
|
-
Contact : 191715030@qq.com
|
|
6
|
-
Author : shenshuo
|
|
7
|
-
Date : 2019/12/12 17:56
|
|
8
|
-
Desc : API集合
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
from .tools import singleton
|
|
12
|
-
from .apis import AdminAPIS, TaskAPIS, KerriganAPIS, AdminV4APIS, CMDBAPIS, AgentAPIS, NoticeAPIS
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@singleton
|
|
16
|
-
class ConstAPIS(AdminAPIS, TaskAPIS, KerriganAPIS, AdminV4APIS, CMDBAPIS, AgentAPIS, NoticeAPIS):
|
|
17
|
-
def __init__(self):
|
|
18
|
-
pass
|
|
19
|
-
|
|
20
|
-
def __setattr__(self, name, value):
|
|
21
|
-
if name in self.__dict__:
|
|
22
|
-
raise TypeError("Can't rebind const (%s)" % name)
|
|
23
|
-
|
|
24
|
-
if not isinstance(value, dict):
|
|
25
|
-
raise TypeError("Value must be in dict format")
|
|
26
|
-
|
|
27
|
-
if not value.get('url'):
|
|
28
|
-
raise TypeError("Value must have url")
|
|
29
|
-
|
|
30
|
-
if not value.get('description'):
|
|
31
|
-
raise TypeError("Value must have description")
|
|
32
|
-
|
|
33
|
-
# body_data = value.get('body')
|
|
34
|
-
# if body_data is not None and not isinstance(body_data, (dict, list)):
|
|
35
|
-
# try:
|
|
36
|
-
# json.loads(body_data)
|
|
37
|
-
# except (TypeError, ValueError):
|
|
38
|
-
# raise TypeError("Body data cannot be loaded as JSON")
|
|
39
|
-
|
|
40
|
-
self.__dict__[name] = value
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
api_set = ConstAPIS()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|