pixelarraythirdparty 1.0.5__py3-none-any.whl → 1.0.6__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.
- pixelarraythirdparty/__init__.py +3 -3
- pixelarraythirdparty/{celery/celery.py → cron/cron.py} +16 -16
- {pixelarraythirdparty-1.0.5.dist-info → pixelarraythirdparty-1.0.6.dist-info}/METADATA +1 -1
- {pixelarraythirdparty-1.0.5.dist-info → pixelarraythirdparty-1.0.6.dist-info}/RECORD +8 -8
- /pixelarraythirdparty/{celery → cron}/__init__.py +0 -0
- {pixelarraythirdparty-1.0.5.dist-info → pixelarraythirdparty-1.0.6.dist-info}/WHEEL +0 -0
- {pixelarraythirdparty-1.0.5.dist-info → pixelarraythirdparty-1.0.6.dist-info}/licenses/LICENSE +0 -0
- {pixelarraythirdparty-1.0.5.dist-info → pixelarraythirdparty-1.0.6.dist-info}/top_level.txt +0 -0
pixelarraythirdparty/__init__.py
CHANGED
|
@@ -6,18 +6,18 @@ PixelArray 第三方微服务客户端
|
|
|
6
6
|
这个库包含了常用的开发工具和服务集成:
|
|
7
7
|
- order: 订单管理模块和支付模块
|
|
8
8
|
- product: 产品管理模块
|
|
9
|
-
-
|
|
9
|
+
- cron: 定时任务管理模块
|
|
10
10
|
- user: 用户管理模块
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
__version__ = "1.0.
|
|
13
|
+
__version__ = "1.0.6"
|
|
14
14
|
__author__ = "Lu qi"
|
|
15
15
|
__email__ = "qi.lu@pixelarrayai.com"
|
|
16
16
|
|
|
17
17
|
# 导出主要模块
|
|
18
18
|
__all__ = [
|
|
19
19
|
"product",
|
|
20
|
-
"
|
|
20
|
+
"cron",
|
|
21
21
|
"user",
|
|
22
22
|
"order",
|
|
23
23
|
]
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
from pixelarraythirdparty.client import Client
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
class
|
|
5
|
-
def
|
|
4
|
+
class CronManager(Client):
|
|
5
|
+
def get_cron_status(self):
|
|
6
6
|
"""
|
|
7
|
-
获取
|
|
7
|
+
获取Cron服务状态
|
|
8
8
|
|
|
9
9
|
功能说明:
|
|
10
|
-
获取
|
|
10
|
+
获取Cron服务的运行状态,包括已注册的任务、工作节点状态等。
|
|
11
11
|
|
|
12
12
|
输入参数:
|
|
13
13
|
无
|
|
14
14
|
|
|
15
15
|
返回字段:
|
|
16
|
-
data (dict):
|
|
16
|
+
data (dict): Cron服务状态信息
|
|
17
17
|
- registered_tasks (dict): 已注册的任务列表,按工作节点分组
|
|
18
18
|
- worker_stats (dict): 工作节点统计信息
|
|
19
19
|
- scheduled_task_count (int): 定时任务数量
|
|
@@ -21,19 +21,19 @@ class CeleryManager(Client):
|
|
|
21
21
|
success (bool): 操作是否成功
|
|
22
22
|
|
|
23
23
|
异常情况:
|
|
24
|
-
- 获取
|
|
24
|
+
- 获取Cron状态失败:返回错误信息"获取Cron状态失败"
|
|
25
25
|
"""
|
|
26
|
-
data, success = self._request("GET", "/api/
|
|
26
|
+
data, success = self._request("GET", "/api/cron/status")
|
|
27
27
|
if not success:
|
|
28
28
|
return {}, False
|
|
29
29
|
return data, True
|
|
30
30
|
|
|
31
|
-
def
|
|
31
|
+
def get_cron_tasks(self):
|
|
32
32
|
"""
|
|
33
33
|
获取已注册任务列表
|
|
34
34
|
|
|
35
35
|
功能说明:
|
|
36
|
-
获取所有已注册的
|
|
36
|
+
获取所有已注册的Cron任务列表。
|
|
37
37
|
|
|
38
38
|
输入参数:
|
|
39
39
|
无
|
|
@@ -48,12 +48,12 @@ class CeleryManager(Client):
|
|
|
48
48
|
异常情况:
|
|
49
49
|
- 获取任务列表失败:返回错误信息"获取任务列表失败"
|
|
50
50
|
"""
|
|
51
|
-
data, success = self._request("GET", "/api/
|
|
51
|
+
data, success = self._request("GET", "/api/cron/tasks")
|
|
52
52
|
if not success:
|
|
53
53
|
return {}, False
|
|
54
54
|
return data, True
|
|
55
55
|
|
|
56
|
-
def
|
|
56
|
+
def get_cron_tasks_scheduled(self):
|
|
57
57
|
"""
|
|
58
58
|
获取定时任务列表
|
|
59
59
|
|
|
@@ -85,12 +85,12 @@ class CeleryManager(Client):
|
|
|
85
85
|
异常情况:
|
|
86
86
|
- 获取定时任务列表失败:返回错误信息"获取定时任务列表失败"
|
|
87
87
|
"""
|
|
88
|
-
data, success = self._request("GET", "/api/
|
|
88
|
+
data, success = self._request("GET", "/api/cron/tasks/scheduled")
|
|
89
89
|
if not success:
|
|
90
90
|
return {}, False
|
|
91
91
|
return data, True
|
|
92
92
|
|
|
93
|
-
def
|
|
93
|
+
def get_cron_tasks_detail(self, task_name: str):
|
|
94
94
|
"""
|
|
95
95
|
获取任务详情
|
|
96
96
|
|
|
@@ -117,12 +117,12 @@ class CeleryManager(Client):
|
|
|
117
117
|
- 任务不存在:返回错误信息"任务不存在"
|
|
118
118
|
- 获取任务详情失败:返回错误信息"获取任务详情失败"
|
|
119
119
|
"""
|
|
120
|
-
data, success = self._request("GET", f"/api/
|
|
120
|
+
data, success = self._request("GET", f"/api/cron/tasks/{task_name}")
|
|
121
121
|
if not success:
|
|
122
122
|
return {}, False
|
|
123
123
|
return data, True
|
|
124
124
|
|
|
125
|
-
def
|
|
125
|
+
def trigger_cron_task(self, task_name: str, args: list, kwargs: dict):
|
|
126
126
|
"""
|
|
127
127
|
触发任务执行
|
|
128
128
|
|
|
@@ -148,7 +148,7 @@ class CeleryManager(Client):
|
|
|
148
148
|
"""
|
|
149
149
|
data, success = self._request(
|
|
150
150
|
"POST",
|
|
151
|
-
f"/api/
|
|
151
|
+
f"/api/cron/tasks/{task_name}/trigger",
|
|
152
152
|
json={"args": args, "kwargs": kwargs},
|
|
153
153
|
)
|
|
154
154
|
if not success:
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
pixelarraythirdparty/__init__.py,sha256=
|
|
1
|
+
pixelarraythirdparty/__init__.py,sha256=aA8oLGUpHoC4Rby-ha2d6Wzqh927Faez5gb9QhEZe4k,454
|
|
2
2
|
pixelarraythirdparty/client.py,sha256=r63EDeyPhf3Y1sORW24tDSIqo2c8E3pwbik7r0Xy5zo,1678
|
|
3
|
-
pixelarraythirdparty/
|
|
4
|
-
pixelarraythirdparty/
|
|
3
|
+
pixelarraythirdparty/cron/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
pixelarraythirdparty/cron/cron.py,sha256=wAHsDTyaVurzgIlkceEURQ7HAzv3zjbt6YarNRb7moI,5656
|
|
5
5
|
pixelarraythirdparty/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
pixelarraythirdparty/order/order.py,sha256=kBhpinympJjsu-4UmUazXhJTCLkGlMHcjmpOXbnVmek,27144
|
|
7
7
|
pixelarraythirdparty/product/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
pixelarraythirdparty/product/product.py,sha256=_rcAtsZEWA3Ta1R9SBWnzQmjab-vf3bnSEySb4PPU-c,10586
|
|
9
9
|
pixelarraythirdparty/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
pixelarraythirdparty/user/user.py,sha256=UY-O7qO8AIWo3GRQaHqC3AMQc4w3bD9KgmPLoUo-l0I,8380
|
|
11
|
-
pixelarraythirdparty-1.0.
|
|
12
|
-
pixelarraythirdparty-1.0.
|
|
13
|
-
pixelarraythirdparty-1.0.
|
|
14
|
-
pixelarraythirdparty-1.0.
|
|
15
|
-
pixelarraythirdparty-1.0.
|
|
11
|
+
pixelarraythirdparty-1.0.6.dist-info/licenses/LICENSE,sha256=O-g1dUr0U50rSIvmWE9toiVkSgFpVt72_MHITbWvAqA,1067
|
|
12
|
+
pixelarraythirdparty-1.0.6.dist-info/METADATA,sha256=8LkaNd1bSKx6IIfWzT1zGqlIHa_5wAiSk6L2M7H0fiQ,993
|
|
13
|
+
pixelarraythirdparty-1.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
pixelarraythirdparty-1.0.6.dist-info/top_level.txt,sha256=dzG2Ut8j7noUqj_0ZQjcIDAeHYCh_9WtlxjAxtoyufo,21
|
|
15
|
+
pixelarraythirdparty-1.0.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{pixelarraythirdparty-1.0.5.dist-info → pixelarraythirdparty-1.0.6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|