codosdk 1.0.5__tar.gz → 1.0.7__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.5 → codosdk-1.0.7}/PKG-INFO +1 -1
- {codosdk-1.0.5 → codosdk-1.0.7}/codosdk.egg-info/PKG-INFO +1 -1
- {codosdk-1.0.5 → codosdk-1.0.7}/setup.py +1 -1
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/apis/mgv4_apis.py +19 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/base_handler.py +3 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/model_utils.py +3 -4
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/utils/__init__.py +23 -5
- {codosdk-1.0.5 → codosdk-1.0.7}/LICENSE +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/README.md +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/codosdk.egg-info/SOURCES.txt +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/codosdk.egg-info/dependency_links.txt +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/codosdk.egg-info/requires.txt +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/codosdk.egg-info/top_level.txt +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/opssdk/__init__.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/opssdk/utils/__init__.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/pyproject.toml +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/setup.cfg +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/__init__.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/api_set.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/apis/__init__.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/apis/admin_apis.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/apis/agent_apis.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/apis/cmdb_apis.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/apis/kerrigan_apis.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/apis/task_apis.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/application.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/cache.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/cache_context.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/client.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/cloud/__init__.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/cloud/qcloud_api.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/cloud/ucloud_api.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/cloud_utils.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/configs.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/consts.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/db_context.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/error.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/fetch_coroutine.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/jwt_token.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/ldap.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/logger.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/mqhelper.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/program.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/salt_api.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/sqlalchemy_pagination.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/tools.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/utils/cc_crypto.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/utils/date_format.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/utils/pydantic_utils.py +0 -0
- {codosdk-1.0.5 → codosdk-1.0.7}/websdk2/web_logs.py +0 -0
|
@@ -93,3 +93,22 @@ class AdminV4APIS:
|
|
|
93
93
|
field_help={
|
|
94
94
|
},
|
|
95
95
|
description='获取所有角色和角色内内用户信息')
|
|
96
|
+
|
|
97
|
+
get_favorites_v4 = dict(method='GET',
|
|
98
|
+
url=f'{route_prefix}/v4/favorites/',
|
|
99
|
+
params={
|
|
100
|
+
},
|
|
101
|
+
field_help={
|
|
102
|
+
},
|
|
103
|
+
description='PAAS-基础功能-公用收藏接口-查看')
|
|
104
|
+
|
|
105
|
+
opt_favorites_v4 = dict(method='POST',
|
|
106
|
+
url=f'{route_prefix}/v4/favorites/',
|
|
107
|
+
body={
|
|
108
|
+
"key": "",
|
|
109
|
+
"app_code": "overall",
|
|
110
|
+
"value": {}
|
|
111
|
+
},
|
|
112
|
+
field_help={
|
|
113
|
+
},
|
|
114
|
+
description='PAAS-基础功能-公用收藏接口-添加修改')
|
|
@@ -56,6 +56,9 @@ class BaseHandler(RequestHandler):
|
|
|
56
56
|
if self.request.method in ("POST", "PUT", "PATCH", "DELETE"):
|
|
57
57
|
try:
|
|
58
58
|
self.req_data = json.loads(self.request.body.decode("utf-8"))
|
|
59
|
+
for key in ['_index', '_rowKey', 'update_time']:
|
|
60
|
+
self.req_data.pop(key, None)
|
|
61
|
+
return self.req_data
|
|
59
62
|
except json.JSONDecodeError as err:
|
|
60
63
|
logging.error(f"Error parsing JSON data in request {self.request.method} at {self.request.path}: {err}")
|
|
61
64
|
except Exception as err:
|
|
@@ -99,10 +99,9 @@ class CommonOptView:
|
|
|
99
99
|
|
|
100
100
|
@staticmethod
|
|
101
101
|
def del_data(data) -> dict:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
del data['_rowKey']
|
|
102
|
+
keys_to_remove = ['_index', '_rowKey']
|
|
103
|
+
for key in keys_to_remove:
|
|
104
|
+
data.pop(key, None)
|
|
106
105
|
return data
|
|
107
106
|
|
|
108
107
|
def handle_add(self, data: dict) -> dict:
|
|
@@ -7,16 +7,17 @@ Date : 2018/12/11
|
|
|
7
7
|
Desc :
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
+
import json
|
|
10
11
|
import os
|
|
12
|
+
import smtplib
|
|
13
|
+
import socket
|
|
11
14
|
import time
|
|
12
|
-
import json
|
|
13
15
|
import uuid
|
|
14
|
-
import socket
|
|
15
|
-
import smtplib
|
|
16
16
|
from datetime import datetime
|
|
17
|
-
from ..consts import const
|
|
18
|
-
from email.mime.text import MIMEText
|
|
19
17
|
from email.mime.multipart import MIMEMultipart
|
|
18
|
+
from email.mime.text import MIMEText
|
|
19
|
+
|
|
20
|
+
from ..consts import const
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
class SendMail(object):
|
|
@@ -197,6 +198,23 @@ def echo_datetime_now_f():
|
|
|
197
198
|
return datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
|
|
198
199
|
|
|
199
200
|
|
|
201
|
+
def echo_execute_time(func):
|
|
202
|
+
import logging
|
|
203
|
+
from time import time
|
|
204
|
+
|
|
205
|
+
# 定义嵌套函数,用来打印出装饰的函数的执行时间
|
|
206
|
+
def wrapper(*args, **kwargs):
|
|
207
|
+
# 定义开始时间和结束时间,将func夹在中间执行,取得其返回值
|
|
208
|
+
start = time()
|
|
209
|
+
func_return = func(*args, **kwargs)
|
|
210
|
+
end = time()
|
|
211
|
+
logging.warning(f'{func.__name__}() execute time: {end - start}s')
|
|
212
|
+
return func_return
|
|
213
|
+
|
|
214
|
+
# 返回嵌套的函数
|
|
215
|
+
return wrapper
|
|
216
|
+
|
|
217
|
+
|
|
200
218
|
### 令牌桶限流
|
|
201
219
|
'''
|
|
202
220
|
示例
|
|
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
|