codosdk 1.0.4__tar.gz → 1.0.6__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.4 → codosdk-1.0.6}/PKG-INFO +1 -1
- {codosdk-1.0.4 → codosdk-1.0.6}/codosdk.egg-info/PKG-INFO +1 -1
- {codosdk-1.0.4 → codosdk-1.0.6}/setup.py +1 -1
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/utils/__init__.py +23 -6
- {codosdk-1.0.4 → codosdk-1.0.6}/LICENSE +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/README.md +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/codosdk.egg-info/SOURCES.txt +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/codosdk.egg-info/dependency_links.txt +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/codosdk.egg-info/requires.txt +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/codosdk.egg-info/top_level.txt +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/opssdk/__init__.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/opssdk/utils/__init__.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/pyproject.toml +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/setup.cfg +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/__init__.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/api_set.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/apis/__init__.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/apis/admin_apis.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/apis/agent_apis.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/apis/cmdb_apis.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/apis/kerrigan_apis.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/apis/mgv4_apis.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/apis/task_apis.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/application.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/base_handler.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/cache.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/cache_context.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/client.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/cloud/__init__.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/cloud/qcloud_api.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/cloud/ucloud_api.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/cloud_utils.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/configs.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/consts.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/db_context.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/error.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/fetch_coroutine.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/jwt_token.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/ldap.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/logger.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/model_utils.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/mqhelper.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/program.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/salt_api.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/sqlalchemy_pagination.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/tools.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/utils/cc_crypto.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/utils/date_format.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/utils/pydantic_utils.py +0 -0
- {codosdk-1.0.4 → codosdk-1.0.6}/websdk2/web_logs.py +0 -0
|
@@ -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):
|
|
@@ -193,11 +194,27 @@ def get_node_topic(node=False):
|
|
|
193
194
|
return f'{socket.gethostname()}--mac-{mac}'
|
|
194
195
|
|
|
195
196
|
|
|
196
|
-
@staticmethod
|
|
197
197
|
def echo_datetime_now_f():
|
|
198
198
|
return datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
|
|
199
199
|
|
|
200
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
|
+
|
|
201
218
|
### 令牌桶限流
|
|
202
219
|
'''
|
|
203
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|