codosdk 1.0.0__py2.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.
@@ -0,0 +1,35 @@
1
+ Metadata-Version: 2.1
2
+ Name: codosdk
3
+ Version: 1.0.0
4
+ Summary: CODO项目的Python SDK
5
+ Home-page: https://github.com/ss1917/codo_sdk/
6
+ Author: shenshuo
7
+ Author-email: 191715030@qq.com
8
+ License: GPLv3
9
+ Keywords: ops,opencodo,devops
10
+ Platform: any
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Environment :: Console :: Curses
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
15
+ Classifier: Programming Language :: Python :: 3.6
16
+ Classifier: Programming Language :: Python :: 3.7
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ License-File: LICENSE
21
+ Requires-Dist: fire ==0.5.0
22
+ Requires-Dist: shortuuid ==1.0.11
23
+ Requires-Dist: pymysql ==0.9.3
24
+ Requires-Dist: sqlalchemy ==1.3.23
25
+ Requires-Dist: pika ==1.3.1
26
+ Requires-Dist: PyJWT ==2.0.1
27
+ Requires-Dist: requests ==2.28.2
28
+ Requires-Dist: redis ==4.5.1
29
+ Requires-Dist: tornado >=6.0
30
+ Requires-Dist: loguru >=0.6.0
31
+ Requires-Dist: cryptography ==42.0.4
32
+ Requires-Dist: ldap3 ==2.9
33
+ Requires-Dist: pydantic >=1.10.5
34
+
35
+ SDK of the operation and maintenance script logs operate
@@ -0,0 +1,45 @@
1
+ codosdk-1.0.0.data/data/share/doc/codo_sdk/README.md,sha256=3NjgpJ6T6GYJ1gzv3VcxTDkp98W0WsM3qLnbC0MUC6U,1552
2
+ opssdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ opssdk/utils/__init__.py,sha256=RcZwhRV_wu8QyD7_dBXsNVshKbJT7dQKpWSxz1q38hw,549
4
+ websdk2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ websdk2/api_set.py,sha256=ZKukCoL_r7lWnJ8LND84Gi8uWfPqM-Q4KDaB8cbfuqo,1198
6
+ websdk2/application.py,sha256=e8uU-_kvWGrLRi0l0uikeM-cKC1-Qkzyr9HzS2bQpTw,3083
7
+ websdk2/base_handler.py,sha256=DWHPV9iOO6wGnG5CZXpLlFoJ2rLqJsh3wwxvNyVDnHg,9711
8
+ websdk2/cache.py,sha256=Lkw-baLmrKwGGWxVpdpJX0cHwIKF03G8EojkbRwD-Yg,4631
9
+ websdk2/cache_context.py,sha256=k2_R0vWiKhCfVTlKmCUUMENhdI5cTAbLU8Yl2KUn7Vc,1272
10
+ websdk2/client.py,sha256=SIlLaCPVbVNf28KIHv6aDAjvsSbpWNpbeRmuD3xfPJk,6432
11
+ websdk2/cloud_utils.py,sha256=6pYe2mKc22jlpv5S1S28_N07Oh_zN6QcwRMi8YM5GAg,515
12
+ websdk2/configs.py,sha256=-3kf7c57_lqZqVKtmTiWqmhm0StuBD0OThPRflRUN4I,2514
13
+ websdk2/consts.py,sha256=W4ucIgGUHDMj7euD01twwck8T9kuYogNDUIx-FJiCdo,5483
14
+ websdk2/db_context.py,sha256=KRSaO72_fifhhEbtsA-7DxmSl69a-TDRPD_q09g2Ms8,4948
15
+ websdk2/error.py,sha256=Vsql7c0LW8Rq8WbnwzkOkF3XbPoIuU0Y9aIdmZu-g_4,1463
16
+ websdk2/fetch_coroutine.py,sha256=wE_50IThlEAxa59YFgzxGBsqSrcUXjRcqtowE9c70F4,420
17
+ websdk2/jwt_token.py,sha256=wfc02hsu2jL6uA37x83hX_C1kOr-W3k69Ex1rO5vShU,4728
18
+ websdk2/ldap.py,sha256=dpqJ-J881b34i6diX0CwcBSOXgW8CW3gNFLZkWMfXrQ,5139
19
+ websdk2/logger.py,sha256=DOMJB0dpz2darnEZMRaW2BXf2bOvE0XOeu5Dfg4Qmlc,1221
20
+ websdk2/model_utils.py,sha256=SzctP1tZLMVojkNswMBle9yfAjSn4IgOdlzHmNmjFl8,5212
21
+ websdk2/mqhelper.py,sha256=aNK_QdP8BZXXGQgRJb5Td19x6i8BwYJFfFiXXZ2jDhs,4637
22
+ websdk2/program.py,sha256=6HaEDkCxtQFz3LfKcBKjECvucPPhwJVvcQvOFlUKuSM,375
23
+ websdk2/salt_api.py,sha256=uijDM0hJh4pD1NO5vQKtxL8SREu-Cyt5ziQAMyqHOnI,3607
24
+ websdk2/sqlalchemy_pagination.py,sha256=pDKmibWFSe9PFRwq1CVo88-AXR9CTlx_KEiLJNkm0WM,3309
25
+ websdk2/tools.py,sha256=WgK0X2HLVwgAj45xwmb4Q3fb80_g5c8GBDVHqDa9wS4,5590
26
+ websdk2/web_logs.py,sha256=l_D2rwrIa9R_2zPZGANmuWIhsJFtV43OuKkRO0s_Bi0,3588
27
+ websdk2/apis/__init__.py,sha256=EyBxyVLEeV9e6O9Ty0KumECNDAyqET8BzuzMQdXwe6s,254
28
+ websdk2/apis/admin_apis.py,sha256=oGRguILp9JDxkJ810RRALGNaNo3GSSiGmZ2cr-UpYEY,7983
29
+ websdk2/apis/agent_apis.py,sha256=e49RDkjB_eToDXNlnTvmPDuvqvbT9_DeidpyvB9b3TI,1492
30
+ websdk2/apis/cmdb_apis.py,sha256=IrwtgAGTVPybY8Xw-agD2HRhMHmw60w4_qK_Nk6YGQQ,687
31
+ websdk2/apis/kerrigan_apis.py,sha256=P4ExHIlsbYg_8SmnyszjQ3uA9cyGYcJfNlOIyhTVCcE,711
32
+ websdk2/apis/mgv4_apis.py,sha256=U1sLEHYUo9rR7xfULGocCXFhNFoe4pULgdVN2uyK1E0,3989
33
+ websdk2/apis/task_apis.py,sha256=FLJkXFwe3DO_1fu5DQzlwWlkNhw1aUN2Eg4sk0TgN-4,3487
34
+ websdk2/cloud/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
+ websdk2/cloud/qcloud_api.py,sha256=YyfP4y4ceszEJMpZeQbhVOCroaeYA8BSoCOhASOl-ow,1756
36
+ websdk2/cloud/ucloud_api.py,sha256=TWq6YPoH1fddv5imsTENse3bDWxKY7rhwIE59bsjm1Y,2176
37
+ websdk2/utils/__init__.py,sha256=ZsybsR8uPG-Qc2yA7pSqPJhh47Ko-aTw0xBfIWFkTiI,8838
38
+ websdk2/utils/cc_crypto.py,sha256=J5B_pLcG9VzmnNo68TYNSS1wXSZ2lipldUV2ZJSRCIg,2569
39
+ websdk2/utils/date_format.py,sha256=NK1TbtcdZU3ksRAuAwTnSsvglHOngW6RLAOqfooTi1Q,1272
40
+ websdk2/utils/pydantic_utils.py,sha256=SYwi5HeeQHDus5WZhBoh893RiHa_GlnFlMORJb2la5I,1778
41
+ codosdk-1.0.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
42
+ codosdk-1.0.0.dist-info/METADATA,sha256=giH8hoGMANyjOSa6Y-VC9-Eh0Tf_o3QEXpcH2lJJaLE,1193
43
+ codosdk-1.0.0.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
44
+ codosdk-1.0.0.dist-info/top_level.txt,sha256=FsLWkmZlQ-dqHqGSBQOMc4uDLxfERVpODRlyXowUv4E,15
45
+ codosdk-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,6 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.43.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py2-none-any
5
+ Tag: py3-none-any
6
+
@@ -0,0 +1,2 @@
1
+ opssdk
2
+ websdk2
opssdk/__init__.py ADDED
File without changes
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env python
2
+ # -*-coding:utf-8-*-
3
+ '''
4
+ author : shenshuo
5
+ date : 2018-3-7
6
+ role : 工具类
7
+ '''
8
+
9
+ import time
10
+ from opssdk.logs import Log
11
+
12
+ log_path = '/log/yunwei/yunwei.log'
13
+ log_ins = Log('utils', log_path)
14
+
15
+ def timeit(func):
16
+ def wrapper(*args, **kwargs):
17
+ start_time = time.time()
18
+ result = func(*args, **kwargs)
19
+ end_time = time.time()
20
+ duration = end_time - start_time
21
+ log_ins.write_log("info", '%s execute duration :%.3f second' % (str(func), duration))
22
+ return result
23
+
24
+ return wrapper
websdk2/__init__.py ADDED
File without changes
websdk2/api_set.py ADDED
@@ -0,0 +1,43 @@
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
13
+
14
+
15
+ @singleton
16
+ class ConstAPIS(AdminAPIS, TaskAPIS, KerriganAPIS, AdminV4APIS, CMDBAPIS, AgentAPIS):
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()
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+
4
+ from .admin_apis import AdminAPIS
5
+ from .task_apis import TaskAPIS
6
+ from .kerrigan_apis import KerriganAPIS
7
+ from .mgv4_apis import AdminV4APIS
8
+ from .cmdb_apis import CMDBAPIS
9
+ from .agent_apis import AgentAPIS
@@ -0,0 +1,160 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ Contact : 191715030@qq.com
5
+ Author : shenshuo
6
+ Date : 2018年2月5日13:37:54
7
+ Desc :记录API
8
+ """
9
+
10
+
11
+ class AdminAPIS:
12
+ route_prefix = "/api/mg"
13
+ get_users = dict(method='GET',
14
+ url=f'{route_prefix}/v3/accounts/user/',
15
+ params={
16
+ 'page': 1,
17
+ 'limit': 201
18
+ },
19
+ field_help={},
20
+ description='获取用户信息')
21
+
22
+ opt_users = dict(method='POST',
23
+ url=f'{route_prefix}/v3/accounts/user/',
24
+ body={
25
+ 'username': None,
26
+ 'nickname': None,
27
+ 'password': None,
28
+ 'department': None,
29
+ 'tel': None,
30
+ 'wechat': None,
31
+ 'no': None,
32
+ 'email': None,
33
+ 'user_state': '20',
34
+ },
35
+ field_help={
36
+ 'user_state': '20',
37
+ },
38
+ description='操作用户数据,支持增删改,请修改method和body数据')
39
+
40
+ get_resource_info_by_user = dict(method='GET',
41
+ url='/mg/v2/overall/resource/user/',
42
+ params={
43
+ 'nickname': None, ## 默认为当前用户有权限的
44
+ 'expand': None ## yes 是扩展为目录的 , no 是可以当全局标签的
45
+ },
46
+ field_help={
47
+ 'nickname': None, ## 默认为当前用户有权限的
48
+ 'expand': None ## yes 是扩展为目录的 , no 是可以当全局标签的,没有则是全部
49
+ },
50
+ description='获取用户有权限的资源组/目录')
51
+
52
+ get_resource_info = dict(method='GET',
53
+ url='/mg/v2/overall/resource/',
54
+ params={
55
+ 'key': None, ## 筛选字段
56
+ 'value': None ## 筛选字段值
57
+ },
58
+ field_help={
59
+ 'key': None, ## 筛选字段
60
+ 'value': None ## 筛选字段值
61
+ },
62
+ description='获取资源组/目录')
63
+
64
+ get_role_list = dict(method='GET',
65
+ url=f'{route_prefix}/v3/accounts/role/',
66
+ params={
67
+ },
68
+ field_help={
69
+ 'page': '分页/第几页', ### 分页/第几页
70
+ 'limit': '分页/每页多少个', ### 分页/每页多少个
71
+ 'value': '模糊查询' ### 模糊查询
72
+ },
73
+ description='获取角色信息')
74
+
75
+ get_all_role_user = dict(method='GET',
76
+ url=f'{route_prefix}/v3/accounts/all_role_user/',
77
+ params={
78
+ },
79
+ field_help={
80
+ 'page': '分页/第几页', ### 分页/第几页
81
+ 'limit': '分页/每页多少个', ### 分页/每页多少个
82
+ 'value': '模糊查询' ### 模糊查询
83
+ },
84
+ description='获取用户组和用户组内用户信息')
85
+
86
+ get_send_addr = dict(method='GET',
87
+ url=f'{route_prefix}/v1/notifications/send_addr/',
88
+ params={
89
+ },
90
+ field_help={
91
+ 'users_str': '用户 半角逗号分隔', ### 用户 半角逗号分隔
92
+ 'notice_group_str': '通知组 半角逗号分隔', ### 通知组 半角逗号分隔
93
+ 'roles_str': '角色 半角逗号分隔' ### 角色 半角逗号分隔
94
+ },
95
+ description='获取用户的联系方式,手机/邮箱/钉钉ID')
96
+
97
+ get_notice_group = dict(method='GET',
98
+ url=f'{route_prefix}/v3/notifications/group/',
99
+ params={
100
+ 'page': 1,
101
+ 'limit': 201,
102
+ 'value': ''
103
+ },
104
+ field_help={
105
+ 'page': '分页/第几页', ### 分页/第几页
106
+ 'limit': '分页/每页多少个', ### 分页/每页多少个
107
+ 'value': '模糊查询' ### 模糊查询
108
+ },
109
+ description='获取通知组')
110
+
111
+ opt_notice_group = dict(method='POST',
112
+ url=f'{route_prefix}/v3/notifications/group/',
113
+ body={
114
+ },
115
+ field_help={
116
+ },
117
+ description='操作通知组')
118
+
119
+ send_notice = dict(method='POST',
120
+ url=f'{route_prefix}/v3/notifications/factory/',
121
+ body={
122
+ "name": 'default',
123
+ "msg": {"msg": "这个即将发布的新版本,创始人xx称它为红树林。而在此之前,每当面临重大升级"}
124
+ },
125
+ field_help={
126
+ "name": '模板名称',
127
+ "msg": "发送的消息变量字典",
128
+ "notice_conf": "随着通知一起传入的配置信息,会覆盖模板里面的配置信息"
129
+ },
130
+ description='根据通知模板发送通知')
131
+
132
+ send_update_notice = dict(method='PUT',
133
+ url=f'{route_prefix}/v3/notifications/factory/',
134
+ body={
135
+ "agent_id": 27689,
136
+ "status_value": "已同意",
137
+ "status_bg": "0xFF78C06E",
138
+ "task_id": 37491848
139
+ },
140
+ field_help={
141
+ "agent_id": '申请的应用id',
142
+ "status_value": "状态值",
143
+ "status_bg": "颜色",
144
+ "task_id": "已经发送消息ID,发送通知的时候可以获取他的返回"
145
+ },
146
+ description='变更已发出通知消息的状态, 目前只有钉钉工作通知OA方式可用')
147
+
148
+ send_custom_notice = dict(method='POST',
149
+ url=f'{route_prefix}/v1/notifications/custom/',
150
+ body={
151
+ "send_addr": '',
152
+ "userid_list": '',
153
+ "msg": {"msg": "这个即将发布的新版本,创始人xx称它为红树林。而在此之前,每当面临重大升级"}
154
+ },
155
+ field_help={
156
+ "send_addr": '需要的通知的用户信息',
157
+ "userid_list": "",
158
+ "msg": "发送的消息变量字典",
159
+ },
160
+ description='自定义的通知信息')
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ Contact : 191715030@qq.com
5
+ Author : shenshuo
6
+ Date : 2024年4月12日
7
+ Desc :Agent常用API
8
+ """
9
+
10
+
11
+ class AgentAPIS:
12
+ route_prefix = "/api/agent"
13
+ agent_list_url = f'{route_prefix}/v1/agent/info'
14
+ get_agent_work_url = f'{route_prefix}/v1/manager/agent/get_running_task'
15
+ batch_add_task_url = f'{route_prefix}/v1/agent/task/batch'
16
+ sync_files_url = f'{route_prefix}/v1/manager/agent/share_file/register'
17
+
18
+ get_agent_list = dict(method='GET',
19
+ url=agent_list_url,
20
+ params={},
21
+ field_help={},
22
+ description='查看Agent列表')
23
+
24
+ get_agent_work = dict(method='GET',
25
+ url=get_agent_work_url,
26
+ params={},
27
+ field_help={},
28
+ description='查询agent状态')
29
+
30
+ batch_add_task = dict(method='POST',
31
+ url=batch_add_task_url,
32
+ body={
33
+ },
34
+ field_help={
35
+ },
36
+ description='批量下发任务')
37
+
38
+ sync_files_task = dict(method='POST',
39
+ url=sync_files_url,
40
+ body={
41
+ },
42
+ field_help={
43
+ },
44
+ description='批量分发文件')
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ Contact : 191715030@qq.com
5
+ Author : shenshuo
6
+ Date : 2018年2月5日13:37:54
7
+ Desc :记录API
8
+ """
9
+
10
+
11
+ class CMDBAPIS:
12
+ cmdb_prefix = "/api/cmdb"
13
+ create_jobs = dict(method='GET',
14
+ url=f'{cmdb_prefix}/api/v2/cmdb/tag/list/',
15
+ params={
16
+ 'page_number': '1', ### 分页/第几页
17
+ 'page_size': '200', ### 分页/每页多少个
18
+ "tag_key": None
19
+ },
20
+ field_help={
21
+ },
22
+ description='CMDB 获取标签key、value列表')
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ Contact : 191715030@qq.com
5
+ Author : shenshuo
6
+ Date : 2018年2月5日13:37:54
7
+ Desc :记录API
8
+ """
9
+
10
+
11
+ class KerriganAPIS:
12
+ kerrigan_prefix = "/api/kerrigan"
13
+ get_publish_config = dict(method='GET',
14
+ url=f'{kerrigan_prefix}/v1/conf/publish/config/',
15
+ params={'project_code': '',
16
+ 'environment': '',
17
+ 'service': 'service',
18
+ 'filename': 'filename'},
19
+ field_help={},
20
+ description='获取配置'
21
+ )
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ Contact : 191715030@qq.com
5
+ Author : shenshuo
6
+ Date : 2018年2月5日13:37:54
7
+ Desc :记录API
8
+ """
9
+
10
+
11
+ class AdminV4APIS:
12
+ route_prefix = "/api/p"
13
+ get_user_list = dict(method='GET',
14
+ url=f'{route_prefix}/v4/user/list/',
15
+ params={
16
+ 'page': 1,
17
+ 'limit': 201
18
+ },
19
+ field_help={},
20
+ description='查看用户列表')
21
+
22
+ get_user_contact_info = dict(method='GET',
23
+ url=f'{route_prefix}/v4/user/send_addr/',
24
+ params={},
25
+ field_help={
26
+ 'users_str': '用户id 用户名 昵称 半角逗号分隔', # 用户 半角逗号分隔
27
+ 'roles_str': '角色id 半角逗号分隔' # 角色 半角逗号分隔
28
+ },
29
+ description='获取用户的联系方式,手机/邮箱/钉钉ID/飞书ID')
30
+
31
+ get_users = dict(method='GET',
32
+ url=f'{route_prefix}/v4/user/',
33
+ params={
34
+ 'page': 1,
35
+ 'limit': 201
36
+ },
37
+ field_help={},
38
+ description='管理-查看用户列表')
39
+
40
+ opt_users = dict(method='POST',
41
+ url=f'{route_prefix}/v4/user/',
42
+ body={
43
+ 'username': None,
44
+ 'nickname': None,
45
+ 'password': None,
46
+ 'department': None,
47
+ 'tel': None,
48
+ 'email': None,
49
+ 'user_state': '20',
50
+ },
51
+ field_help={
52
+ 'user_state': '20',
53
+ },
54
+ description='操作用户数据,支持增删改,请修改method和body数据')
55
+
56
+ get_biz = dict(method='GET',
57
+ url=f'{route_prefix}/v4/biz/',
58
+ params={
59
+ 'page': 1,
60
+ 'limit': 201
61
+ },
62
+ field_help={},
63
+ description='权限中心-业务管理-同步业务可以用')
64
+
65
+ get_biz_list = dict(method='GET',
66
+ url=f'{route_prefix}/v4/biz/list/',
67
+ params={
68
+ },
69
+ field_help={},
70
+ description='PAAS基础功能-查看业务列表和切换')
71
+
72
+ get_normal_role_list = dict(method='GET',
73
+ url=f'{route_prefix}/v4/role/list/',
74
+ params={},
75
+ field_help={
76
+ 'page': '分页/第几页', ### 分页/第几页
77
+ 'limit': '分页/每页多少个', ### 分页/每页多少个
78
+ 'searchVal': '模糊查询' ### 模糊查询
79
+ },
80
+ description='查看常规角色列表')
81
+
82
+ get_all_base_role_list = dict(method='GET',
83
+ url=f'{route_prefix}/v4/role/base_list/',
84
+ params={},
85
+ field_help={
86
+ },
87
+ description='查看所有基础角色')
88
+
89
+ get_all_role_user_v4 = dict(method='GET',
90
+ url=f'{route_prefix}/v4/all_role_user/',
91
+ params={
92
+ },
93
+ field_help={
94
+ },
95
+ description='获取所有角色和角色内内用户信息')
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ Contact : 191715030@qq.com
5
+ Author : shenshuo
6
+ Date : 2018年2月5日13:37:54
7
+ Desc :记录API
8
+ """
9
+
10
+
11
+ class TaskAPIS:
12
+ job_prefix = "/api/job"
13
+ create_jobs = dict(method='POST',
14
+ url=f'{job_prefix}/v1/flow/accept/create/',
15
+ body={
16
+ "order_name": "标题",
17
+ "creator": "发起人",
18
+ "flow_version_name": "依赖的流程名称",
19
+ "start_time": "2018-11-27 14:09:50",
20
+ "global_params": "{}", ##参数,必须为json格式且可以格式化为字典
21
+ "details": "这里是备注"
22
+ },
23
+ field_help={
24
+ "order_name": "标题",
25
+ "creator": "提交人",
26
+ "flow_version_name": "依赖的流程名称",
27
+ "start_node": "如果有多个开始节点,必须指定一个",
28
+ "start_time": "在开始节点上设置时间,到这个时间会进行执行",
29
+ "global_params": "这里是一个字典,里面的参数可以自行定义,如上,你模板参数里面用到了哪些你都可以在这里定义出来,当你的POST到这个接口时候,我们会自动接受此参数,并帮你运行脚本 解析你要传入的参数。",
30
+ "details": "描述,备注信息",
31
+ },
32
+ description='基于此接口可以创建作业任务')
33
+
34
+ ##(r"/v1/proxy/cmdbv3/dynamic_group/info/"
35
+ get_proxy_dynamic_group_list = dict(
36
+ method='GET',
37
+ url=f'{job_prefix}/v1/proxy/cmdb/dynamic_group/list/',
38
+ params={
39
+ "biz_id": None, ### 业务/资源id
40
+ 'page_number': '1', ### 分页/第几页
41
+ 'page_size': '200', ### 分页/每页多少个
42
+ },
43
+ field_help={
44
+ },
45
+ description='COCO动态分组'
46
+ )
47
+
48
+ ##CC动态分组 获取动态分组详细数据"
49
+ get_proxy_dynamic_group_info = dict(
50
+ method='GET',
51
+ url=f'{job_prefix}/v1/proxy/cmdb/dynamic_group/info/',
52
+ params={
53
+ "exec_uuid": None, ### 使用动态分组的UUID查询
54
+ 'exec_uuid_list': '[]', ### 批量查询
55
+ },
56
+ field_help={
57
+ },
58
+ description='动态分组 获取动态分组详细数据'
59
+ )
60
+ get_current_order_list = dict(method='GET',
61
+ url=f'{job_prefix}/v1/flow/current/list/',
62
+ params={
63
+ 'page': 1,
64
+ 'limit': 201,
65
+ },
66
+ field_help={
67
+
68
+ },
69
+ description='查看订单列表'
70
+ )
71
+ get_history_order_list = dict(method='GET',
72
+ url=f'{job_prefix}/v1/flow/history/list/',
73
+ params={
74
+ 'page': 1,
75
+ 'limit': 201,
76
+ },
77
+ field_help={
78
+
79
+ },
80
+ description='查看订单列表')