cmdbox 0.6.3.2__py3-none-any.whl → 0.6.4__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.
Potentially problematic release.
This version of cmdbox might be problematic. Click here for more details.
- cmdbox/app/app.py +16 -7
- cmdbox/app/common.py +2 -2
- cmdbox/app/commons/redis_client.py +1 -1
- cmdbox/app/edge.py +1 -1
- cmdbox/app/feature.py +1 -1
- cmdbox/app/features/cli/cmdbox_audit_createdb.py +224 -224
- cmdbox/app/features/cli/cmdbox_audit_delete.py +4 -4
- cmdbox/app/features/cli/cmdbox_audit_search.py +4 -4
- cmdbox/app/features/cli/cmdbox_audit_write.py +6 -8
- cmdbox/app/features/cli/cmdbox_client_file_copy.py +3 -3
- cmdbox/app/features/cli/cmdbox_client_file_download.py +3 -3
- cmdbox/app/features/cli/cmdbox_client_file_list.py +3 -3
- cmdbox/app/features/cli/cmdbox_client_file_mkdir.py +3 -3
- cmdbox/app/features/cli/cmdbox_client_file_move.py +3 -3
- cmdbox/app/features/cli/cmdbox_client_file_remove.py +3 -3
- cmdbox/app/features/cli/cmdbox_client_file_rmdir.py +3 -3
- cmdbox/app/features/cli/cmdbox_client_file_upload.py +3 -3
- cmdbox/app/features/cli/cmdbox_client_http.py +7 -6
- cmdbox/app/features/cli/cmdbox_client_server_info.py +4 -4
- cmdbox/app/features/cli/cmdbox_cmd_list.py +3 -3
- cmdbox/app/features/cli/cmdbox_cmd_load.py +5 -5
- cmdbox/app/features/cli/cmdbox_edge_config.py +1 -1
- cmdbox/app/features/cli/cmdbox_edge_start.py +3 -3
- cmdbox/app/features/cli/cmdbox_mcp_client.py +174 -174
- cmdbox/app/features/cli/cmdbox_mcp_proxy.py +96 -96
- cmdbox/app/features/cli/cmdbox_server_list.py +2 -2
- cmdbox/app/features/cli/cmdbox_server_start.py +103 -103
- cmdbox/app/features/cli/cmdbox_server_stop.py +4 -4
- cmdbox/app/features/cli/cmdbox_tts_install.py +307 -0
- cmdbox/app/features/cli/cmdbox_tts_say.py +179 -0
- cmdbox/app/features/cli/cmdbox_tts_start.py +329 -0
- cmdbox/app/features/cli/cmdbox_tts_stop.py +108 -0
- cmdbox/app/features/cli/cmdbox_web_apikey_add.py +91 -91
- cmdbox/app/features/cli/cmdbox_web_apikey_del.py +91 -91
- cmdbox/app/features/cli/cmdbox_web_gencert.py +6 -6
- cmdbox/app/features/cli/cmdbox_web_genpass.py +168 -168
- cmdbox/app/features/cli/cmdbox_web_group_add.py +94 -94
- cmdbox/app/features/cli/cmdbox_web_group_del.py +87 -87
- cmdbox/app/features/cli/cmdbox_web_group_edit.py +94 -94
- cmdbox/app/features/cli/cmdbox_web_group_list.py +87 -87
- cmdbox/app/features/cli/cmdbox_web_start.py +235 -235
- cmdbox/app/features/cli/cmdbox_web_stop.py +72 -72
- cmdbox/app/features/cli/cmdbox_web_user_add.py +104 -104
- cmdbox/app/features/cli/cmdbox_web_user_del.py +87 -87
- cmdbox/app/features/cli/cmdbox_web_user_edit.py +104 -104
- cmdbox/app/features/cli/cmdbox_web_user_list.py +87 -87
- cmdbox/app/filer.py +9 -9
- cmdbox/app/mcp.py +15 -7
- cmdbox/app/options.py +46 -43
- cmdbox/app/server.py +224 -224
- cmdbox/extensions/features.yml +3 -0
- cmdbox/extensions/sample_project/sample/app/features/cli/sample_client_time.py +2 -2
- cmdbox/extensions/sample_project/sample/app/features/cli/sample_server_time.py +3 -3
- cmdbox/licenses/LICENSE_Werkzeug_3_1_1_BSD_License.txt +28 -0
- cmdbox/licenses/LICENSE_absolufy-imports_0_3_1_MIT_License.txt +21 -0
- cmdbox/licenses/LICENSE_cyclopts_3_22_5_Apache_Software_License.txt +201 -0
- cmdbox/licenses/LICENSE_isodate_0_7_2_BSD_License.txt +26 -0
- cmdbox/licenses/LICENSE_lazy-object-proxy_1_11_0_BSD_License.txt +20 -0
- cmdbox/licenses/LICENSE_openapi-core_0_19_5_BSD_License.txt +29 -0
- cmdbox/licenses/LICENSE_openapi-schema-validator_0_6_3_BSD_License.txt +29 -0
- cmdbox/licenses/LICENSE_openapi-spec-validator_0_7_2_Apache_Software_License.txt +201 -0
- cmdbox/licenses/LICENSE_opentelemetry-semantic-conventions_0_57b0_UNKNOWN.txt +201 -0
- cmdbox/licenses/LICENSE_parse_1_20_2_MIT_License.txt +19 -0
- cmdbox/licenses/LICENSE_pathable_0_4_4_Apache_Software_License.txt +201 -0
- cmdbox/licenses/{LICENSE_pillow_11_2_1_UNKNOWN.txt → LICENSE_pillow_11_3_0_UNKNOWN.txt} +393 -3
- cmdbox/licenses/LICENSE_pyperclip_1_9_0_BSD_License.txt +27 -0
- cmdbox/licenses/LICENSE_rfc3339-validator_0_1_4_MIT_License.txt +22 -0
- cmdbox/licenses/LICENSE_rich-rst_1_3_1_MIT_License.txt +7 -0
- cmdbox/licenses/{LICENSE_setuptools_65_5_0_MIT_License.txt → LICENSE_setuptools_80_9_0_UNKNOWN.txt} +0 -2
- cmdbox/licenses/LICENSE_tokenizers_0_21_4_Apache_Software_License.txt +1 -0
- cmdbox/licenses/LICENSE_voicevox_core_0_16_0_MIT.txt +20 -0
- cmdbox/licenses/LICENSE_watchdog_6_0_0_Apache_Software_License.txt +16 -0
- cmdbox/licenses/{LICENSE_typer_0_16_0_MIT_License.txt → LICENSE_wsproto_1_2_0_MIT_License.txt} +2 -2
- cmdbox/licenses/files.txt +56 -42
- cmdbox/logconf_cmdbox.yml +104 -0
- cmdbox/version.py +2 -2
- cmdbox/web/agent.html +8 -2
- cmdbox/web/assets/cmdbox/agent.js +182 -1
- cmdbox/web/assets/cmdbox/common.js +16 -3
- cmdbox/web/assets/cmdbox/svgicon.js +18 -0
- {cmdbox-0.6.3.2.dist-info → cmdbox-0.6.4.dist-info}/METADATA +28 -20
- {cmdbox-0.6.3.2.dist-info → cmdbox-0.6.4.dist-info}/RECORD +122 -112
- {cmdbox-0.6.3.2.dist-info → cmdbox-0.6.4.dist-info}/WHEEL +1 -1
- cmdbox/config.yml +0 -3
- cmdbox/licenses/LICENSE_httptools_0_6_4_MIT_License.txt +0 -21
- cmdbox/licenses/LICENSE_shellingham_1_5_4_ISC_License-ISCL.txt +0 -13
- cmdbox/licenses/LICENSE_watchfiles_1_1_0_MIT_License.txt +0 -21
- cmdbox/logconf_audit.yml +0 -43
- cmdbox/logconf_client.yml +0 -43
- cmdbox/logconf_edge.yml +0 -43
- cmdbox/logconf_gui.yml +0 -43
- cmdbox/logconf_mcp.yml +0 -43
- cmdbox/logconf_server.yml +0 -43
- cmdbox/logconf_web.yml +0 -43
- /cmdbox/licenses/{LICENSE_Authlib_1_6_0_BSD_License.txt → LICENSE_Authlib_1_6_1_BSD_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_SQLAlchemy_2_0_41_MIT.txt → LICENSE_SQLAlchemy_2_0_42_MIT.txt} +0 -0
- /cmdbox/licenses/{LICENSE_aiohttp_3_12_13_Apache-2_0.txt → LICENSE_aiohttp_3_12_15_Apache-2_0_AND_MIT.txt} +0 -0
- /cmdbox/licenses/{LICENSE_aiosignal_1_3_2_Apache_Software_License.txt → LICENSE_aiosignal_1_4_0_Apache_Software_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_certifi_2025_6_15_Mozilla_Public_License_2_0-MPL_2_0.txt → LICENSE_certifi_2025_7_14_Mozilla_Public_License_2_0-MPL_2_0.txt} +0 -0
- /cmdbox/licenses/{LICENSE_cryptography_45_0_4_Apache-2_0_OR_BSD-3-Clause.txt → LICENSE_cryptography_45_0_5_Apache-2_0_OR_BSD-3-Clause.txt} +0 -0
- /cmdbox/licenses/{LICENSE_docstring_parser_0_16_MIT_License.txt → LICENSE_docstring_parser_0_17_0_MIT_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_fastapi_0_115_14_MIT_License.txt → LICENSE_fastapi_0_116_1_MIT_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_fastmcp_2_10_1_Apache_Software_License.txt → LICENSE_fastmcp_2_11_0_Apache_Software_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_fsspec_2025_5_1_BSD_License.txt → LICENSE_fsspec_2025_7_0_BSD_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_google-adk_1_5_0_Apache_Software_License.txt → LICENSE_google-adk_1_9_0_Apache_Software_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_google-api-python-client_2_174_0_Apache_Software_License.txt → LICENSE_google-api-python-client_2_177_0_Apache_Software_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_google-cloud-aiplatform_1_100_0_Apache_2_0.txt → LICENSE_google-cloud-aiplatform_1_106_0_Apache_2_0.txt} +0 -0
- /cmdbox/licenses/{LICENSE_google-cloud-bigquery_3_34_0_Apache_Software_License.txt → LICENSE_google-cloud-bigquery_3_35_1_Apache_Software_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_google-genai_1_23_0_Apache_Software_License.txt → LICENSE_google-genai_1_28_0_Apache_Software_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_grpcio-status_1_73_1_Apache_Software_License.txt → LICENSE_grpcio-status_1_74_0_Apache_Software_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_grpcio_1_73_1_Apache_Software_License.txt → LICENSE_grpcio_1_74_0_Apache_Software_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_huggingface-hub_0_33_1_Apache_Software_License.txt → LICENSE_huggingface-hub_0_34_3_Apache_Software_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_opentelemetry-api_1_34_1_Apache_Software_License.txt → LICENSE_jsonschema-path_0_3_4_Apache_Software_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_jsonschema_4_24_0_UNKNOWN.txt → LICENSE_jsonschema_4_25_0_UNKNOWN.txt} +0 -0
- /cmdbox/licenses/{LICENSE_litellm_1_73_6_MIT_License.txt → LICENSE_litellm_1_74_12_MIT_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_mcp_1_10_1_MIT_License.txt → LICENSE_mcp_1_12_3_MIT_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_multidict_6_6_2_Apache_License_2_0.txt → LICENSE_multidict_6_6_3_Apache_License_2_0.txt} +0 -0
- /cmdbox/licenses/{LICENSE_nh3_0_2_21_MIT.txt → LICENSE_nh3_0_3_0_MIT.txt} +0 -0
- /cmdbox/licenses/{LICENSE_numpy_2_3_1_BSD_License.txt → LICENSE_numpy_2_3_2_BSD_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_openai_1_93_0_Apache_Software_License.txt → LICENSE_openai_1_98_0_Apache_Software_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_opentelemetry-sdk_1_34_1_Apache_Software_License.txt → LICENSE_opentelemetry-api_1_36_0_UNKNOWN.txt} +0 -0
- /cmdbox/licenses/{LICENSE_opentelemetry-semantic-conventions_0_55b1_Apache_Software_License.txt → LICENSE_opentelemetry-sdk_1_36_0_UNKNOWN.txt} +0 -0
- /cmdbox/licenses/{LICENSE_tokenizers_0_21_2_Apache_Software_License.txt → LICENSE_pywin32_311_Python_Software_Foundation_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_regex_2024_11_6_Apache_Software_License.txt → LICENSE_regex_2025_7_34_UNKNOWN.txt} +0 -0
- /cmdbox/licenses/{LICENSE_rich_14_0_0_MIT_License.txt → LICENSE_rich_14_1_0_MIT_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_rpds-py_0_25_1_MIT.txt → LICENSE_rpds-py_0_26_0_MIT.txt} +0 -0
- /cmdbox/licenses/{LICENSE_sse-starlette_2_3_6_BSD_License.txt → LICENSE_sse-starlette_3_0_2_UNKNOWN.txt} +0 -0
- /cmdbox/licenses/{LICENSE_starlette_0_46_2_BSD_License.txt → LICENSE_starlette_0_47_2_BSD_License.txt} +0 -0
- /cmdbox/licenses/{LICENSE_typing_extensions_4_14_0_UNKNOWN.txt → LICENSE_typing_extensions_4_14_1_UNKNOWN.txt} +0 -0
- /cmdbox/licenses/{LICENSE_zope_event_5_1_Zope_Public_License.txt → LICENSE_zope_event_5_1_1_Zope_Public_License.txt} +0 -0
- {cmdbox-0.6.3.2.dist-info → cmdbox-0.6.4.dist-info}/entry_points.txt +0 -0
- {cmdbox-0.6.3.2.dist-info → cmdbox-0.6.4.dist-info/licenses}/LICENSE +0 -0
- {cmdbox-0.6.3.2.dist-info → cmdbox-0.6.4.dist-info}/top_level.txt +0 -0
|
@@ -29,7 +29,7 @@ class AuditWrite(audit_base.AuditBase):
|
|
|
29
29
|
str: コマンド
|
|
30
30
|
"""
|
|
31
31
|
return 'write'
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
def get_option(self):
|
|
34
34
|
"""
|
|
35
35
|
この機能のオプションを返します
|
|
@@ -99,11 +99,11 @@ class AuditWrite(audit_base.AuditBase):
|
|
|
99
99
|
if args.svname is None:
|
|
100
100
|
msg = dict(warn=f"Please specify the --svname option.")
|
|
101
101
|
common.print_format(msg, False, tm, args.output_json, args.output_json_append, pf=pf)
|
|
102
|
-
return
|
|
102
|
+
return self.RESP_WARN, msg, None
|
|
103
103
|
if args.audit_type is None:
|
|
104
104
|
msg = dict(warn=f"Please specify the --audit_type option.")
|
|
105
105
|
common.print_format(msg, False, tm, args.output_json, args.output_json_append, pf=pf)
|
|
106
|
-
return
|
|
106
|
+
return self.RESP_WARN, msg, None
|
|
107
107
|
if args.clmsg_id is None:
|
|
108
108
|
args.clmsg_id = str(uuid.uuid4())
|
|
109
109
|
if args.clmsg_date is None:
|
|
@@ -113,7 +113,7 @@ class AuditWrite(audit_base.AuditBase):
|
|
|
113
113
|
logger.warning(f"client_only is True. Not connecting to server. Skip writing the audit log.")
|
|
114
114
|
ret = dict(success={k:v for k, v in vars(args).items() if v})
|
|
115
115
|
common.print_format(ret, False, tm, args.output_json, args.output_json_append, pf=pf)
|
|
116
|
-
return
|
|
116
|
+
return self.RESP_SUCCESS, ret, None
|
|
117
117
|
|
|
118
118
|
audit_type_b64 = convert.str2b64str(args.audit_type)
|
|
119
119
|
clmsg_id_b64 = convert.str2b64str(args.clmsg_id)
|
|
@@ -132,8 +132,6 @@ class AuditWrite(audit_base.AuditBase):
|
|
|
132
132
|
pg_password_b64 = convert.str2b64str(args.pg_password)
|
|
133
133
|
pg_dbname_b64 = convert.str2b64str(args.pg_dbname)
|
|
134
134
|
|
|
135
|
-
if logger.level == logging.DEBUG:
|
|
136
|
-
logger.debug(f"audit write args: {args}")
|
|
137
135
|
cl = client.Client(logger, redis_host=args.host, redis_port=args.port, redis_password=args.password, svname=args.svname)
|
|
138
136
|
cl.redis_cli.send_cmd(self.get_svcmd(),
|
|
139
137
|
[audit_type_b64, clmsg_id_b64, clmsg_date_b64, clmsg_src_b64, clmsg_title_b64, clmsg_user_b64, clmsg_body_b64, clmsg_tag_b64,
|
|
@@ -142,7 +140,7 @@ class AuditWrite(audit_base.AuditBase):
|
|
|
142
140
|
retry_count=args.retry_count, retry_interval=args.retry_interval, timeout=args.timeout, nowait=True)
|
|
143
141
|
ret = dict(success=True)
|
|
144
142
|
#common.print_format(ret, False, tm, None, False, pf=pf)
|
|
145
|
-
return
|
|
143
|
+
return self.RESP_SUCCESS, ret, cl
|
|
146
144
|
|
|
147
145
|
def is_cluster_redirect(self):
|
|
148
146
|
"""
|
|
@@ -249,7 +247,7 @@ class AuditWrite(audit_base.AuditBase):
|
|
|
249
247
|
cursor.execute("DELETE FROM audit WHERE svmsg_date < CURRENT_TIMESTAMP + %s ",
|
|
250
248
|
(f'-{retention_period_days} day',))
|
|
251
249
|
conn.commit()
|
|
252
|
-
rescode, msg = (self.
|
|
250
|
+
rescode, msg = (self.RESP_SUCCESS, dict(success=True))
|
|
253
251
|
redis_cli.rpush(reskey, msg)
|
|
254
252
|
return rescode
|
|
255
253
|
finally:
|
|
@@ -133,7 +133,7 @@ class ClientFileCopy(feature.UnsupportEdgeFeature):
|
|
|
133
133
|
if args.svname is None:
|
|
134
134
|
msg = dict(warn=f"Please specify the --svname option.")
|
|
135
135
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
136
|
-
return
|
|
136
|
+
return self.RESP_WARN, msg, None
|
|
137
137
|
cl = client.Client(logger, redis_host=args.host, redis_port=args.port, redis_password=args.password, svname=args.svname)
|
|
138
138
|
|
|
139
139
|
client_data = Path(args.client_data.replace('"','')) if args.client_data is not None else None
|
|
@@ -143,9 +143,9 @@ class ClientFileCopy(feature.UnsupportEdgeFeature):
|
|
|
143
143
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
144
144
|
|
|
145
145
|
if 'success' not in ret:
|
|
146
|
-
return
|
|
146
|
+
return self.RESP_WARN, ret, cl
|
|
147
147
|
|
|
148
|
-
return
|
|
148
|
+
return self.RESP_SUCCESS, ret, cl
|
|
149
149
|
|
|
150
150
|
def is_cluster_redirect(self):
|
|
151
151
|
"""
|
|
@@ -131,7 +131,7 @@ class ClientFileDownload(feature.OneshotEdgeFeature):
|
|
|
131
131
|
if args.svname is None:
|
|
132
132
|
msg = dict(warn=f"Please specify the --svname option.")
|
|
133
133
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
134
|
-
return
|
|
134
|
+
return self.RESP_WARN, msg, None
|
|
135
135
|
cl = client.Client(logger, redis_host=args.host, redis_port=args.port, redis_password=args.password, svname=args.svname)
|
|
136
136
|
|
|
137
137
|
client_data = Path(args.client_data.replace('"','')) if args.client_data is not None else None
|
|
@@ -141,9 +141,9 @@ class ClientFileDownload(feature.OneshotEdgeFeature):
|
|
|
141
141
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
142
142
|
|
|
143
143
|
if 'success' not in ret:
|
|
144
|
-
return
|
|
144
|
+
return self.RESP_WARN, ret, cl
|
|
145
145
|
|
|
146
|
-
return
|
|
146
|
+
return self.RESP_SUCCESS, ret, cl
|
|
147
147
|
|
|
148
148
|
def is_cluster_redirect(self):
|
|
149
149
|
"""
|
|
@@ -123,7 +123,7 @@ class ClientFileList(feature.OneshotResultEdgeFeature):
|
|
|
123
123
|
if args.svname is None:
|
|
124
124
|
msg = dict(warn=f"Please specify the --svname option.")
|
|
125
125
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
126
|
-
return
|
|
126
|
+
return self.RESP_WARN, msg, None
|
|
127
127
|
cl = client.Client(logger, redis_host=args.host, redis_port=args.port, redis_password=args.password, svname=args.svname)
|
|
128
128
|
|
|
129
129
|
client_data = Path(args.client_data.replace('"','')) if args.client_data is not None else None
|
|
@@ -132,9 +132,9 @@ class ClientFileList(feature.OneshotResultEdgeFeature):
|
|
|
132
132
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
133
133
|
|
|
134
134
|
if 'success' not in ret:
|
|
135
|
-
return
|
|
135
|
+
return self.RESP_WARN, ret, cl
|
|
136
136
|
|
|
137
|
-
return
|
|
137
|
+
return self.RESP_SUCCESS, ret, cl
|
|
138
138
|
|
|
139
139
|
def is_cluster_redirect(self):
|
|
140
140
|
"""
|
|
@@ -121,7 +121,7 @@ class ClientFileMkdir(feature.UnsupportEdgeFeature):
|
|
|
121
121
|
if args.svname is None:
|
|
122
122
|
msg = dict(warn=f"Please specify the --svname option.")
|
|
123
123
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
124
|
-
return
|
|
124
|
+
return self.RESP_WARN, msg, None
|
|
125
125
|
cl = client.Client(logger, redis_host=args.host, redis_port=args.port, redis_password=args.password, svname=args.svname)
|
|
126
126
|
|
|
127
127
|
client_data = Path(args.client_data.replace('"','')) if args.client_data is not None else None
|
|
@@ -130,9 +130,9 @@ class ClientFileMkdir(feature.UnsupportEdgeFeature):
|
|
|
130
130
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
131
131
|
|
|
132
132
|
if 'success' not in ret:
|
|
133
|
-
return
|
|
133
|
+
return self.RESP_WARN, ret, cl
|
|
134
134
|
|
|
135
|
-
return
|
|
135
|
+
return self.RESP_SUCCESS, ret, cl
|
|
136
136
|
|
|
137
137
|
def is_cluster_redirect(self):
|
|
138
138
|
"""
|
|
@@ -127,7 +127,7 @@ class ClientFileMove(feature.UnsupportEdgeFeature):
|
|
|
127
127
|
if args.svname is None:
|
|
128
128
|
msg = dict(warn=f"Please specify the --svname option.")
|
|
129
129
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
130
|
-
return
|
|
130
|
+
return self.RESP_WARN, msg, None
|
|
131
131
|
cl = client.Client(logger, redis_host=args.host, redis_port=args.port, redis_password=args.password, svname=args.svname)
|
|
132
132
|
|
|
133
133
|
client_data = Path(args.client_data.replace('"','')) if args.client_data is not None else None
|
|
@@ -137,9 +137,9 @@ class ClientFileMove(feature.UnsupportEdgeFeature):
|
|
|
137
137
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
138
138
|
|
|
139
139
|
if 'success' not in ret:
|
|
140
|
-
return
|
|
140
|
+
return self.RESP_WARN, ret, cl
|
|
141
141
|
|
|
142
|
-
return
|
|
142
|
+
return self.RESP_SUCCESS, ret, cl
|
|
143
143
|
|
|
144
144
|
def is_cluster_redirect(self):
|
|
145
145
|
"""
|
|
@@ -121,7 +121,7 @@ class ClientFileRemove(feature.UnsupportEdgeFeature):
|
|
|
121
121
|
if args.svname is None:
|
|
122
122
|
msg = dict(warn=f"Please specify the --svname option.")
|
|
123
123
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
124
|
-
return
|
|
124
|
+
return self.RESP_WARN, msg, None
|
|
125
125
|
cl = client.Client(logger, redis_host=args.host, redis_port=args.port, redis_password=args.password, svname=args.svname)
|
|
126
126
|
|
|
127
127
|
client_data = Path(args.client_data.replace('"','')) if args.client_data is not None else None
|
|
@@ -130,9 +130,9 @@ class ClientFileRemove(feature.UnsupportEdgeFeature):
|
|
|
130
130
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
131
131
|
|
|
132
132
|
if 'success' not in ret:
|
|
133
|
-
return
|
|
133
|
+
return self.RESP_WARN, ret, cl
|
|
134
134
|
|
|
135
|
-
return
|
|
135
|
+
return self.RESP_SUCCESS, ret, cl
|
|
136
136
|
|
|
137
137
|
def is_cluster_redirect(self):
|
|
138
138
|
"""
|
|
@@ -121,7 +121,7 @@ class ClientFileRmdir(feature.UnsupportEdgeFeature):
|
|
|
121
121
|
if args.svname is None:
|
|
122
122
|
msg = dict(warn=f"Please specify the --svname option.")
|
|
123
123
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
124
|
-
return
|
|
124
|
+
return self.RESP_WARN, msg, None
|
|
125
125
|
cl = client.Client(logger, redis_host=args.host, redis_port=args.port, redis_password=args.password, svname=args.svname)
|
|
126
126
|
|
|
127
127
|
client_data = Path(args.client_data.replace('"','')) if args.client_data is not None else None
|
|
@@ -130,9 +130,9 @@ class ClientFileRmdir(feature.UnsupportEdgeFeature):
|
|
|
130
130
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
131
131
|
|
|
132
132
|
if 'success' not in ret:
|
|
133
|
-
return
|
|
133
|
+
return self.RESP_WARN, ret, cl
|
|
134
134
|
|
|
135
|
-
return
|
|
135
|
+
return self.RESP_SUCCESS, ret, cl
|
|
136
136
|
|
|
137
137
|
def is_cluster_redirect(self):
|
|
138
138
|
"""
|
|
@@ -132,7 +132,7 @@ class ClientFileUpload(feature.UnsupportEdgeFeature):
|
|
|
132
132
|
if args.svname is None:
|
|
133
133
|
msg = dict(warn=f"Please specify the --svname option.")
|
|
134
134
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
135
|
-
return
|
|
135
|
+
return self.RESP_WARN, msg, None
|
|
136
136
|
cl = client.Client(logger, redis_host=args.host, redis_port=args.port, redis_password=args.password, svname=args.svname)
|
|
137
137
|
|
|
138
138
|
client_data = Path(args.client_data.replace('"','')) if args.client_data is not None else None
|
|
@@ -143,9 +143,9 @@ class ClientFileUpload(feature.UnsupportEdgeFeature):
|
|
|
143
143
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
144
144
|
|
|
145
145
|
if 'success' not in ret:
|
|
146
|
-
return
|
|
146
|
+
return self.RESP_WARN, ret, cl
|
|
147
147
|
|
|
148
|
-
return
|
|
148
|
+
return self.RESP_SUCCESS, ret, cl
|
|
149
149
|
|
|
150
150
|
def is_cluster_redirect(self):
|
|
151
151
|
"""
|
|
@@ -57,6 +57,7 @@ class ClientHttp(feature.ResultEdgeFeature):
|
|
|
57
57
|
choice_show={'application/octet-stream':["send_param", "send_data",],
|
|
58
58
|
'application/json':["send_data",],
|
|
59
59
|
'multipart/form-data':["send_param",],},
|
|
60
|
+
choice_edit=True,
|
|
60
61
|
description_ja="送信するデータのContent-Typeを指定します。",
|
|
61
62
|
description_en="Specifies the Content-Type of the data to be sent."),
|
|
62
63
|
dict(opt="send_apikey", type=Options.T_TEXT, default=None, required=False, multi=False, hide=False, choice=None,
|
|
@@ -105,7 +106,7 @@ class ClientHttp(feature.ResultEdgeFeature):
|
|
|
105
106
|
if args.url is None:
|
|
106
107
|
msg = dict(warn=f"Please specify the --url option.")
|
|
107
108
|
common.print_format(msg, args.format, tm, None, False, pf=pf)
|
|
108
|
-
return
|
|
109
|
+
return self.RESP_WARN, msg, None
|
|
109
110
|
query_param = {}
|
|
110
111
|
if args.proxy == 'yes':
|
|
111
112
|
from cmdbox.app.auth import signin
|
|
@@ -114,7 +115,7 @@ class ClientHttp(feature.ResultEdgeFeature):
|
|
|
114
115
|
if scope is None:
|
|
115
116
|
msg = dict(warn=f"Request scope is not set. Please set the request scope.")
|
|
116
117
|
common.print_format(msg, args.format, tm, None, False, pf=pf)
|
|
117
|
-
return
|
|
118
|
+
return self.RESP_WARN, msg, None
|
|
118
119
|
req:Request = scope['req']
|
|
119
120
|
args.send_method = req.method
|
|
120
121
|
args.send_content_type = req.headers.get('Content-Type', None)
|
|
@@ -136,7 +137,7 @@ class ClientHttp(feature.ResultEdgeFeature):
|
|
|
136
137
|
if res.status_code != 200:
|
|
137
138
|
msg = dict(error=f"Request failed with status code {res.status_code}.")
|
|
138
139
|
common.print_format(msg, False, tm, None, False, pf=pf)
|
|
139
|
-
return
|
|
140
|
+
return self.RESP_WARN, msg, None
|
|
140
141
|
content_type = res.headers.get('Content-Type', '')
|
|
141
142
|
if content_type.startswith('application/json'):
|
|
142
143
|
try:
|
|
@@ -144,11 +145,11 @@ class ClientHttp(feature.ResultEdgeFeature):
|
|
|
144
145
|
except ValueError as e:
|
|
145
146
|
msg = res.text
|
|
146
147
|
common.print_format(msg, False, tm, None, False, pf=pf)
|
|
147
|
-
return
|
|
148
|
+
return self.RESP_SUCCESS, msg, None
|
|
148
149
|
elif content_type.startswith('text/'):
|
|
149
150
|
msg = res.text
|
|
150
151
|
common.print_format(msg, False, tm, None, False, pf=pf)
|
|
151
|
-
return
|
|
152
|
+
return self.RESP_SUCCESS, msg, None
|
|
152
153
|
common.print_format(res.content, False, tm, None, False, pf=pf)
|
|
153
154
|
|
|
154
|
-
return
|
|
155
|
+
return self.RESP_SUCCESS, res.content, None
|
|
@@ -102,16 +102,16 @@ class ClientServerInfo(feature.OneshotResultEdgeFeature):
|
|
|
102
102
|
if args.svname is None:
|
|
103
103
|
msg = dict(warn=f"Please specify the --svname option.")
|
|
104
104
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
105
|
-
return
|
|
105
|
+
return self.RESP_WARN, msg, None
|
|
106
106
|
cl = client.Client(logger, redis_host=args.host, redis_port=args.port, redis_password=args.password, svname=args.svname)
|
|
107
107
|
|
|
108
108
|
ret = cl.server_info(retry_count=args.retry_count, retry_interval=args.retry_interval, timeout=args.timeout)
|
|
109
109
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
110
110
|
|
|
111
111
|
if 'success' not in ret:
|
|
112
|
-
return
|
|
112
|
+
return self.RESP_WARN, ret, cl
|
|
113
113
|
|
|
114
|
-
return
|
|
114
|
+
return self.RESP_SUCCESS, ret, cl
|
|
115
115
|
|
|
116
116
|
def is_cluster_redirect(self):
|
|
117
117
|
"""
|
|
@@ -159,7 +159,7 @@ class ClientServerInfo(feature.OneshotResultEdgeFeature):
|
|
|
159
159
|
server_info = dict(svname=redis_cli.svname, redis_host=redis_cli.host, redis_port=redis_cli.port, redis_password=redis_cli.password, data_dir=data_dir)
|
|
160
160
|
msg = dict(success=server_info)
|
|
161
161
|
redis_cli.rpush(reskey, msg)
|
|
162
|
-
return self.
|
|
162
|
+
return self.RESP_SUCCESS
|
|
163
163
|
except Exception as e:
|
|
164
164
|
logger.warning(f"Failed to get server info: {e}", exc_info=True)
|
|
165
165
|
redis_cli.rpush(reskey, dict(warn=f"Failed to get server info: {e}"))
|
|
@@ -85,7 +85,7 @@ class CmdList(feature.OneshotResultEdgeFeature):
|
|
|
85
85
|
if args.data is None:
|
|
86
86
|
msg = dict(warn=f"Please specify the --data option.")
|
|
87
87
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
88
|
-
return
|
|
88
|
+
return self.RESP_WARN, msg, None
|
|
89
89
|
kwd = args.kwd
|
|
90
90
|
if kwd is None or kwd == '':
|
|
91
91
|
kwd = '*'
|
|
@@ -105,6 +105,6 @@ class CmdList(feature.OneshotResultEdgeFeature):
|
|
|
105
105
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
106
106
|
|
|
107
107
|
if 'success' not in ret:
|
|
108
|
-
return
|
|
108
|
+
return self.RESP_WARN, ret, None
|
|
109
109
|
|
|
110
|
-
return
|
|
110
|
+
return self.RESP_SUCCESS, ret, None
|
|
@@ -85,11 +85,11 @@ class CmdLoad(feature.OneshotResultEdgeFeature):
|
|
|
85
85
|
if args.data is None:
|
|
86
86
|
msg = dict(warn=f"Please specify the --data option.")
|
|
87
87
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
88
|
-
return
|
|
88
|
+
return self.RESP_WARN, msg, None
|
|
89
89
|
if args.title is None:
|
|
90
90
|
msg = dict(warn=f"Please specify the --title option.")
|
|
91
91
|
common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
92
|
-
return
|
|
92
|
+
return self.RESP_WARN, msg, None
|
|
93
93
|
if not hasattr(self, 'signin_file_data') or self.signin_file_data is None:
|
|
94
94
|
self.signin_file_data = signin.Signin.load_signin_file(args.signin_file, None, self=self)
|
|
95
95
|
opt_path = Path(args.data) / ".cmds" / f"cmd-{args.title}.json"
|
|
@@ -97,12 +97,12 @@ class CmdLoad(feature.OneshotResultEdgeFeature):
|
|
|
97
97
|
if not signin.Signin._check_cmd(self.signin_file_data, args.groups, opt['mode'], opt['cmd'], logger):
|
|
98
98
|
ret = dict(warn=f"You do not have permission to execute this command.")
|
|
99
99
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
100
|
-
return
|
|
100
|
+
return self.RESP_WARN, ret, None
|
|
101
101
|
ret = dict(success=opt)
|
|
102
102
|
|
|
103
103
|
common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
|
|
104
104
|
|
|
105
105
|
if 'success' not in ret:
|
|
106
|
-
return
|
|
106
|
+
return self.RESP_WARN, ret, None
|
|
107
107
|
|
|
108
|
-
return
|
|
108
|
+
return self.RESP_SUCCESS, ret, None
|
|
@@ -124,4 +124,4 @@ class EdgeConfig(feature.UnsupportEdgeFeature):
|
|
|
124
124
|
app = edge.Edge(logger, args.data, self.appcls, self.ver)
|
|
125
125
|
msg = app.configure(self.get_mode(), self.get_cmd(), args, tm, pf)
|
|
126
126
|
common.print_format(msg, True, tm, None, False, pf=pf)
|
|
127
|
-
return
|
|
127
|
+
return self.RESP_SUCCESS, msg, None
|
|
@@ -62,7 +62,7 @@ class EdgeStart(feature.UnsupportEdgeFeature):
|
|
|
62
62
|
|
|
63
63
|
msg = dict(success="edge complate.")
|
|
64
64
|
common.print_format(msg, True, tm, None, False, pf=pf)
|
|
65
|
-
return
|
|
65
|
+
return self.RESP_SUCCESS, msg, None
|
|
66
66
|
|
|
67
67
|
def load_cmds(self, logger:logging.Logger, args:argparse.Namespace) -> Tuple[int, List[Dict[str, Any]]]:
|
|
68
68
|
"""
|
|
@@ -80,7 +80,7 @@ class EdgeStart(feature.UnsupportEdgeFeature):
|
|
|
80
80
|
if res.status_code != 200:
|
|
81
81
|
return res.status_code, dict(warn=f"Access failed. status_code={res.status_code}")
|
|
82
82
|
cmds = res.json()
|
|
83
|
-
return
|
|
83
|
+
return self.RESP_SUCCESS, cmds
|
|
84
84
|
|
|
85
85
|
def load_pipes(self, logger:logging.Logger, args:argparse.Namespace) -> Tuple[int, List[Dict[str, Any]]]:
|
|
86
86
|
"""
|
|
@@ -98,5 +98,5 @@ class EdgeStart(feature.UnsupportEdgeFeature):
|
|
|
98
98
|
if res.status_code != 200:
|
|
99
99
|
return res.status_code, dict(warn=f"Access failed. status_code={res.status_code}")
|
|
100
100
|
pipes = res.json()
|
|
101
|
-
return
|
|
101
|
+
return self.RESP_SUCCESS, pipes
|
|
102
102
|
|