Commit 11b2601e authored by qunfeng qiu's avatar qunfeng qiu
Browse files

Initial commit

parents
# Details
Date : 2023-10-27 16:38:11
Directory e:\\MyDesktop\\MyProgram\\PythonProject\\common_pkg
Total : 138 files, 31256 codes, 10094 comments, 5540 blanks, all 46890 lines
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
## Files
| filename | language | code | comment | blank | total |
| :--- | :--- | ---: | ---: | ---: | ---: |
| [__init__.py](/__init__.py) | Python | 0 | 0 | 1 | 1 |
| [cucc_common_pkg/__init__.py](/cucc_common_pkg/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/cfginfohandle.py](/cucc_common_pkg/cfginfohandle.py) | Python | 91 | 43 | 24 | 158 |
| [cucc_common_pkg/cucc_k8s.py](/cucc_common_pkg/cucc_k8s.py) | Python | 327 | 14 | 59 | 400 |
| [cucc_common_pkg/flask_wrapper.py](/cucc_common_pkg/flask_wrapper.py) | Python | 198 | 33 | 51 | 282 |
| [cucc_common_pkg/globalconst.py](/cucc_common_pkg/globalconst.py) | Python | 204 | 65 | 70 | 339 |
| [cucc_common_pkg/globalerror.py](/cucc_common_pkg/globalerror.py) | Python | 19 | 19 | 11 | 49 |
| [cucc_common_pkg/globalutility.py](/cucc_common_pkg/globalutility.py) | Python | 380 | 346 | 104 | 830 |
| [cucc_common_pkg/httptrans.py](/cucc_common_pkg/httptrans.py) | Python | 129 | 85 | 40 | 254 |
| [cucc_common_pkg/initflaskhanlde.py](/cucc_common_pkg/initflaskhanlde.py) | Python | 17 | 25 | 9 | 51 |
| [cucc_common_pkg/loginhandle.py](/cucc_common_pkg/loginhandle.py) | Python | 75 | 49 | 33 | 157 |
| [cucc_common_pkg/ludq_utils/README.md](/cucc_common_pkg/ludq_utils/README.md) | Markdown | 53 | 0 | 28 | 81 |
| [cucc_common_pkg/ludq_utils/__init__.py](/cucc_common_pkg/ludq_utils/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/aes_utils.py](/cucc_common_pkg/ludq_utils/aes_utils.py) | Python | 49 | 63 | 11 | 123 |
| [cucc_common_pkg/ludq_utils/app_exception.py](/cucc_common_pkg/ludq_utils/app_exception.py) | Python | 47 | 62 | 16 | 125 |
| [cucc_common_pkg/ludq_utils/app_response.py](/cucc_common_pkg/ludq_utils/app_response.py) | Python | 80 | 56 | 23 | 159 |
| [cucc_common_pkg/ludq_utils/base_const.py](/cucc_common_pkg/ludq_utils/base_const.py) | Python | 24 | 10 | 7 | 41 |
| [cucc_common_pkg/ludq_utils/base_db_service.py](/cucc_common_pkg/ludq_utils/base_db_service.py) | Python | 234 | 165 | 68 | 467 |
| [cucc_common_pkg/ludq_utils/base_redis_service.py](/cucc_common_pkg/ludq_utils/base_redis_service.py) | Python | 264 | 229 | 87 | 580 |
| [cucc_common_pkg/ludq_utils/cert_utils.py](/cucc_common_pkg/ludq_utils/cert_utils.py) | Python | 261 | 164 | 59 | 484 |
| [cucc_common_pkg/ludq_utils/common_app_config.py](/cucc_common_pkg/ludq_utils/common_app_config.py) | Python | 125 | 42 | 28 | 195 |
| [cucc_common_pkg/ludq_utils/common_base_webservice.py](/cucc_common_pkg/ludq_utils/common_base_webservice.py) | Python | 408 | 297 | 90 | 795 |
| [cucc_common_pkg/ludq_utils/common_base_webservice_for_stream.py](/cucc_common_pkg/ludq_utils/common_base_webservice_for_stream.py) | Python | 33 | 20 | 12 | 65 |
| [cucc_common_pkg/ludq_utils/logined_user.py](/cucc_common_pkg/ludq_utils/logined_user.py) | Python | 53 | 27 | 15 | 95 |
| [cucc_common_pkg/ludq_utils/md5_utils.py](/cucc_common_pkg/ludq_utils/md5_utils.py) | Python | 15 | 14 | 5 | 34 |
| [cucc_common_pkg/ludq_utils/rsa_utils.py](/cucc_common_pkg/ludq_utils/rsa_utils.py) | Python | 36 | 49 | 14 | 99 |
| [cucc_common_pkg/ludq_utils/send_notices_utils.py](/cucc_common_pkg/ludq_utils/send_notices_utils.py) | Python | 176 | 84 | 58 | 318 |
| [cucc_common_pkg/ludq_utils/util_methods.py](/cucc_common_pkg/ludq_utils/util_methods.py) | Python | 305 | 59 | 27 | 391 |
| [cucc_common_pkg/ludq_utils/utils_base.py](/cucc_common_pkg/ludq_utils/utils_base.py) | Python | 880 | 361 | 137 | 1,378 |
| [cucc_common_pkg/ludq_utils/utils_get_cluster_info/__init__.py](/cucc_common_pkg/ludq_utils/utils_get_cluster_info/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_get_cluster_info/cluster_info.py](/cucc_common_pkg/ludq_utils/utils_get_cluster_info/cluster_info.py) | Python | 69 | 54 | 13 | 136 |
| [cucc_common_pkg/ludq_utils/utils_get_cluster_info/get_cluster_info_utils.py](/cucc_common_pkg/ludq_utils/utils_get_cluster_info/get_cluster_info_utils.py) | Python | 1,221 | 208 | 146 | 1,575 |
| [cucc_common_pkg/ludq_utils/utils_http/__init__.py](/cucc_common_pkg/ludq_utils/utils_http/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_http/call_k8s_api_utils.py](/cucc_common_pkg/ludq_utils/utils_http/call_k8s_api_utils.py) | Python | 227 | 81 | 28 | 336 |
| [cucc_common_pkg/ludq_utils/utils_http/http_cookie.py](/cucc_common_pkg/ludq_utils/utils_http/http_cookie.py) | Python | 22 | 25 | 8 | 55 |
| [cucc_common_pkg/ludq_utils/utils_http/http_utils.py](/cucc_common_pkg/ludq_utils/utils_http/http_utils.py) | Python | 131 | 230 | 28 | 389 |
| [cucc_common_pkg/ludq_utils/utils_k8s/__init__.py](/cucc_common_pkg/ludq_utils/utils_k8s/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_k8s/cr_utils.py](/cucc_common_pkg/ludq_utils/utils_k8s/cr_utils.py) | Python | 148 | 94 | 25 | 267 |
| [cucc_common_pkg/ludq_utils/utils_k8s/k8s_api_object_utils.py](/cucc_common_pkg/ludq_utils/utils_k8s/k8s_api_object_utils.py) | Python | 3,036 | 615 | 269 | 3,920 |
| [cucc_common_pkg/ludq_utils/utils_k8s/k8s_api_object_utils_v2.py](/cucc_common_pkg/ludq_utils/utils_k8s/k8s_api_object_utils_v2.py) | Python | 1,399 | 526 | 162 | 2,087 |
| [cucc_common_pkg/ludq_utils/utils_k8s/k8s_api_objects.py](/cucc_common_pkg/ludq_utils/utils_k8s/k8s_api_objects.py) | Python | 890 | 141 | 87 | 1,118 |
| [cucc_common_pkg/ludq_utils/utils_k8s/k8s_model.py](/cucc_common_pkg/ludq_utils/utils_k8s/k8s_model.py) | Python | 43 | 22 | 15 | 80 |
| [cucc_common_pkg/ludq_utils/utils_k8s/k8s_utils.py](/cucc_common_pkg/ludq_utils/utils_k8s/k8s_utils.py) | Python | 629 | 279 | 85 | 993 |
| [cucc_common_pkg/ludq_utils/utils_k8s_istio/__init__.py](/cucc_common_pkg/ludq_utils/utils_k8s_istio/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_k8s_knative/__init__.py](/cucc_common_pkg/ludq_utils/utils_k8s_knative/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_k8s_knative/knative_service_obj.py](/cucc_common_pkg/ludq_utils/utils_k8s_knative/knative_service_obj.py) | Python | 516 | 228 | 151 | 895 |
| [cucc_common_pkg/ludq_utils/utils_k8s_knative/knative_utils.py](/cucc_common_pkg/ludq_utils/utils_k8s_knative/knative_utils.py) | Python | 86 | 44 | 16 | 146 |
| [cucc_common_pkg/ludq_utils/utils_k8s_knative/tekton_taskrun_obj.py](/cucc_common_pkg/ludq_utils/utils_k8s_knative/tekton_taskrun_obj.py) | Python | 28 | 23 | 10 | 61 |
| [cucc_common_pkg/ludq_utils/utils_k8s_knative/tekton_utils.py](/cucc_common_pkg/ludq_utils/utils_k8s_knative/tekton_utils.py) | Python | 82 | 43 | 16 | 141 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/__init__.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/base_app_vpc_utils.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/base_app_vpc_utils.py) | Python | 224 | 96 | 26 | 346 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/base_const_for_mesh_mng.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/base_const_for_mesh_mng.py) | Python | 95 | 10 | 29 | 134 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/base_model_for_mesh_mng.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/base_model_for_mesh_mng.py) | Python | 68 | 30 | 17 | 115 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/base_utils_for_mesh_mng.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/base_utils_for_mesh_mng.py) | Python | 202 | 42 | 21 | 265 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/ca_source_info.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/ca_source_info.py) | Python | 41 | 17 | 13 | 71 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/cluster_istio.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/cluster_istio.py) | Python | 1,236 | 248 | 248 | 1,732 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/csm_instance.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/csm_instance.py) | Python | 258 | 60 | 54 | 372 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/csm_instance_cluster.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/csm_instance_cluster.py) | Python | 110 | 38 | 28 | 176 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/csm_instance_db_service.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/csm_instance_db_service.py) | Python | 581 | 181 | 78 | 840 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/cuk_clb_info.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/cuk_clb_info.py) | Python | 35 | 24 | 13 | 72 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/describe_cluster_istio.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/describe_cluster_istio.py) | Python | 1,085 | 196 | 152 | 1,433 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/maintain_func_utils.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/maintain_func_utils.py) | Python | 1,186 | 347 | 152 | 1,685 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/manage_istio_in_k8s.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/manage_istio_in_k8s.py) | Python | 236 | 31 | 23 | 290 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/query_istio_in_k8s.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/query_istio_in_k8s.py) | Python | 2,116 | 556 | 264 | 2,936 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/spire_config.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/spire_config.py) | Python | 28 | 20 | 11 | 59 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/spire_func_utils.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/spire_func_utils.py) | Python | 955 | 204 | 155 | 1,314 |
| [cucc_common_pkg/ludq_utils/utils_mesh_mng/thread_delete_maintain_res_svc.py](/cucc_common_pkg/ludq_utils/utils_mesh_mng/thread_delete_maintain_res_svc.py) | Python | 50 | 12 | 12 | 74 |
| [cucc_common_pkg/ludq_utils/utils_promapi/__init__.py](/cucc_common_pkg/ludq_utils/utils_promapi/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_promapi/prom_config.py](/cucc_common_pkg/ludq_utils/utils_promapi/prom_config.py) | Python | 12 | 15 | 5 | 32 |
| [cucc_common_pkg/ludq_utils/utils_promapi/prom_result_vector.py](/cucc_common_pkg/ludq_utils/utils_promapi/prom_result_vector.py) | Python | 59 | 20 | 16 | 95 |
| [cucc_common_pkg/ludq_utils/utils_promapi/prom_utils.py](/cucc_common_pkg/ludq_utils/utils_promapi/prom_utils.py) | Python | 243 | 38 | 23 | 304 |
| [cucc_common_pkg/ludq_utils/utils_tg_billing/__init__.py](/cucc_common_pkg/ludq_utils/utils_tg_billing/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_tg_billing/billing_create_order_info.py](/cucc_common_pkg/ludq_utils/utils_tg_billing/billing_create_order_info.py) | Python | 51 | 20 | 14 | 85 |
| [cucc_common_pkg/ludq_utils/utils_tg_billing/billing_feededuct_info.py](/cucc_common_pkg/ludq_utils/utils_tg_billing/billing_feededuct_info.py) | Python | 29 | 17 | 8 | 54 |
| [cucc_common_pkg/ludq_utils/utils_tg_billing/billing_update_order_info.py](/cucc_common_pkg/ludq_utils/utils_tg_billing/billing_update_order_info.py) | Python | 19 | 15 | 8 | 42 |
| [cucc_common_pkg/ludq_utils/utils_tg_billing/billing_utils.py](/cucc_common_pkg/ludq_utils/utils_tg_billing/billing_utils.py) | Python | 143 | 85 | 46 | 274 |
| [cucc_common_pkg/ludq_utils/utils_tg_configcenter/__init__.py](/cucc_common_pkg/ludq_utils/utils_tg_configcenter/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_tg_configcenter/configcenter_region_quota.py](/cucc_common_pkg/ludq_utils/utils_tg_configcenter/configcenter_region_quota.py) | Python | 70 | 34 | 20 | 124 |
| [cucc_common_pkg/ludq_utils/utils_tg_configcenter/configcenter_response.py](/cucc_common_pkg/ludq_utils/utils_tg_configcenter/configcenter_response.py) | Python | 19 | 18 | 9 | 46 |
| [cucc_common_pkg/ludq_utils/utils_tg_configcenter/configcenter_utils.py](/cucc_common_pkg/ludq_utils/utils_tg_configcenter/configcenter_utils.py) | Python | 247 | 94 | 49 | 390 |
| [cucc_common_pkg/ludq_utils/utils_tg_iam/__init__.py](/cucc_common_pkg/ludq_utils/utils_tg_iam/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_tg_iam/iam_instance.py](/cucc_common_pkg/ludq_utils/utils_tg_iam/iam_instance.py) | Python | 14 | 16 | 11 | 41 |
| [cucc_common_pkg/ludq_utils/utils_tg_iam/iam_response.py](/cucc_common_pkg/ludq_utils/utils_tg_iam/iam_response.py) | Python | 9 | 12 | 6 | 27 |
| [cucc_common_pkg/ludq_utils/utils_tg_iam/iam_utils.py](/cucc_common_pkg/ludq_utils/utils_tg_iam/iam_utils.py) | Python | 268 | 110 | 58 | 436 |
| [cucc_common_pkg/ludq_utils/utils_tg_sso/__init__.py](/cucc_common_pkg/ludq_utils/utils_tg_sso/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_tg_sso/sso_utils.py](/cucc_common_pkg/ludq_utils/utils_tg_sso/sso_utils.py) | Python | 165 | 63 | 39 | 267 |
| [cucc_common_pkg/ludq_utils/utils_tg_vpc/__init__.py](/cucc_common_pkg/ludq_utils/utils_tg_vpc/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_tg_vpc/vpc_utils.py](/cucc_common_pkg/ludq_utils/utils_tg_vpc/vpc_utils.py) | Python | 541 | 102 | 85 | 728 |
| [cucc_common_pkg/ludq_utils/utils_v2.py](/cucc_common_pkg/ludq_utils/utils_v2.py) | Python | 52 | 26 | 15 | 93 |
| [cucc_common_pkg/ludq_utils/utils_webservice/__init__.py](/cucc_common_pkg/ludq_utils/utils_webservice/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [cucc_common_pkg/ludq_utils/utils_webservice/change_logging_level.py](/cucc_common_pkg/ludq_utils/utils_webservice/change_logging_level.py) | Python | 40 | 19 | 16 | 75 |
| [cucc_common_pkg/ludq_utils/utils_webservice/common_base_webservice_for_stream_v2.py](/cucc_common_pkg/ludq_utils/utils_webservice/common_base_webservice_for_stream_v2.py) | Python | 75 | 22 | 17 | 114 |
| [cucc_common_pkg/ludq_utils/utils_webservice/common_base_webservice_v2.py](/cucc_common_pkg/ludq_utils/utils_webservice/common_base_webservice_v2.py) | Python | 351 | 200 | 82 | 633 |
| [cucc_common_pkg/ludq_utils/utils_webservice/show_logging_level.py](/cucc_common_pkg/ludq_utils/utils_webservice/show_logging_level.py) | Python | 14 | 13 | 7 | 34 |
| [cucc_common_pkg/my_anykeyvalue_utils.py](/cucc_common_pkg/my_anykeyvalue_utils.py) | Python | 65 | 17 | 24 | 106 |
| [cucc_common_pkg/my_baseexception.py](/cucc_common_pkg/my_baseexception.py) | Python | 88 | 81 | 30 | 199 |
| [cucc_common_pkg/my_basehttpsrvlet.py](/cucc_common_pkg/my_basehttpsrvlet.py) | Python | 451 | 17 | 122 | 590 |
| [cucc_common_pkg/my_datahandle/__init__.py](/cucc_common_pkg/my_datahandle/__init__.py) | Python | 0 | 0 | 1 | 1 |
| [cucc_common_pkg/my_datahandle/const.py](/cucc_common_pkg/my_datahandle/const.py) | Python | 81 | 24 | 13 | 118 |
| [cucc_common_pkg/my_datahandle/datahandle_utility.py](/cucc_common_pkg/my_datahandle/datahandle_utility.py) | Python | 222 | 132 | 33 | 387 |
| [cucc_common_pkg/my_servicehandle.py](/cucc_common_pkg/my_servicehandle.py) | Python | 486 | 33 | 117 | 636 |
| [cucc_common_pkg/my_stringutils.py](/cucc_common_pkg/my_stringutils.py) | Python | 15 | 41 | 9 | 65 |
| [cucc_common_pkg/my_structure_utils.py](/cucc_common_pkg/my_structure_utils.py) | Python | 1,046 | 55 | 253 | 1,354 |
| [cucc_common_pkg/my_utils.py](/cucc_common_pkg/my_utils.py) | Python | 167 | 128 | 47 | 342 |
| [cucc_common_pkg/mysql_utils.py](/cucc_common_pkg/mysql_utils.py) | Python | 172 | 131 | 45 | 348 |
| [cucc_common_pkg/redishanlde.py](/cucc_common_pkg/redishanlde.py) | Python | 236 | 172 | 74 | 482 |
| [cucc_common_pkg/simple_sql_opt.py](/cucc_common_pkg/simple_sql_opt.py) | Python | 137 | 20 | 12 | 169 |
| [cucc_common_pkg/sky_baseexception.py](/cucc_common_pkg/sky_baseexception.py) | Python | 126 | 35 | 39 | 200 |
| [cucc_common_pkg/sky_httptrans.py](/cucc_common_pkg/sky_httptrans.py) | Python | 164 | 96 | 49 | 309 |
| [cucc_common_pkg/util_pkg/__init__.py](/cucc_common_pkg/util_pkg/__init__.py) | Python | 8 | 0 | 1 | 9 |
| [cucc_common_pkg/util_pkg/cke_cluster_info.py](/cucc_common_pkg/util_pkg/cke_cluster_info.py) | Python | 164 | 2 | 14 | 180 |
| [cucc_common_pkg/util_pkg/common_dao.py](/cucc_common_pkg/util_pkg/common_dao.py) | Python | 252 | 122 | 30 | 404 |
| [cucc_common_pkg/util_pkg/common_func.py](/cucc_common_pkg/util_pkg/common_func.py) | Python | 323 | 120 | 33 | 476 |
| [cucc_common_pkg/util_pkg/const.py](/cucc_common_pkg/util_pkg/const.py) | Python | 243 | 39 | 40 | 322 |
| [cucc_common_pkg/util_pkg/csk_cluster_info.py](/cucc_common_pkg/util_pkg/csk_cluster_info.py) | Python | 159 | 2 | 14 | 175 |
| [cucc_common_pkg/util_pkg/cuk_cluster_info.py](/cucc_common_pkg/util_pkg/cuk_cluster_info.py) | Python | 163 | 9 | 14 | 186 |
| [cucc_common_pkg/util_pkg/kube_cluster_info_get.py](/cucc_common_pkg/util_pkg/kube_cluster_info_get.py) | Python | 194 | 42 | 18 | 254 |
| [cucc_common_pkg/util_pkg/login_verify.py](/cucc_common_pkg/util_pkg/login_verify.py) | Python | 181 | 2 | 15 | 198 |
| [cucc_common_pkg/util_pkg/login_verify_low_require.py](/cucc_common_pkg/util_pkg/login_verify_low_require.py) | Python | 47 | 2 | 7 | 56 |
| [cucc_common_pkg/util_pkg/namespace_opt.py](/cucc_common_pkg/util_pkg/namespace_opt.py) | Python | 99 | 31 | 10 | 140 |
| [cucc_common_pkg/util_pkg/resource_obj_opt.py](/cucc_common_pkg/util_pkg/resource_obj_opt.py) | Python | 130 | 85 | 11 | 226 |
| [requirements.txt](/requirements.txt) | pip requirements | 46 | 0 | 1 | 47 |
| [setup.py](/setup.py) | Python | 73 | 11 | 4 | 88 |
| [test/__init__.py](/test/__init__.py) | Python | 0 | 10 | 1 | 11 |
| [test/test_flask_wrapper.py](/test/test_flask_wrapper.py) | Python | 16 | 10 | 9 | 35 |
| [test/test_httptrans.py](/test/test_httptrans.py) | Python | 64 | 13 | 23 | 100 |
| [test/test_k8s_op.py](/test/test_k8s_op.py) | Python | 136 | 15 | 40 | 191 |
| [test/test_ludq_k8s_utils.py](/test/test_ludq_k8s_utils.py) | Python | 202 | 284 | 30 | 516 |
| [test/test_ludq_utils_v2.py](/test/test_ludq_utils_v2.py) | Python | 21 | 15 | 9 | 45 |
| [test/test_my_anykeyvalue_tils.py](/test/test_my_anykeyvalue_tils.py) | Python | 21 | 10 | 11 | 42 |
| [test/test_my_baseexception.py](/test/test_my_baseexception.py) | Python | 69 | 10 | 18 | 97 |
| [test/test_my_servicehandle.py](/test/test_my_servicehandle.py) | Python | 202 | 10 | 72 | 284 |
| [test/test_my_stringutils.py](/test/test_my_stringutils.py) | Python | 30 | 10 | 16 | 56 |
| [test/test_my_structure_utils.py](/test/test_my_structure_utils.py) | Python | 402 | 10 | 49 | 461 |
| [test/test_mysqlutils.py](/test/test_mysqlutils.py) | Python | 90 | 10 | 28 | 128 |
| [test/test_redis_sentinel_handle.py](/test/test_redis_sentinel_handle.py) | Python | 43 | 15 | 18 | 76 |
| [test/test_redishandle.py](/test/test_redishandle.py) | Python | 76 | 18 | 33 | 127 |
| [test/test_utility.py](/test/test_utility.py) | Python | 409 | 10 | 112 | 531 |
[Summary](results.md) / Details / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
\ No newline at end of file
# Diff Details
Date : 2023-10-27 16:38:11
Directory e:\\MyDesktop\\MyProgram\\PythonProject\\common_pkg
Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
## Files
| filename | language | code | comment | blank | total |
| :--- | :--- | ---: | ---: | ---: | ---: |
[Summary](results.md) / [Details](details.md) / [Diff Summary](diff.md) / Diff Details
\ No newline at end of file
"filename", "language", "", "comment", "blank", "total"
"Total", "-", , 0, 0, 0
\ No newline at end of file
# Diff Summary
Date : 2023-10-27 16:38:11
Directory e:\\MyDesktop\\MyProgram\\PythonProject\\common_pkg
Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
## Languages
| language | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
## Directories
| path | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
[Summary](results.md) / [Details](details.md) / Diff Summary / [Diff Details](diff-details.md)
\ No newline at end of file
Date : 2023-10-27 16:38:11
Directory : e:\MyDesktop\MyProgram\PythonProject\common_pkg
Total : 0 files, 0 codes, 0 comments, 0 blanks, all 0 lines
Languages
+----------+------------+------------+------------+------------+------------+
| language | files | code | comment | blank | total |
+----------+------------+------------+------------+------------+------------+
+----------+------------+------------+------------+------------+------------+
Directories
+------+------------+------------+------------+------------+------------+
| path | files | code | comment | blank | total |
+------+------------+------------+------------+------------+------------+
+------+------------+------------+------------+------------+------------+
Files
+----------+----------+------------+------------+------------+------------+
| filename | language | code | comment | blank | total |
+----------+----------+------------+------------+------------+------------+
| Total | | 0 | 0 | 0 | 0 |
+----------+----------+------------+------------+------------+------------+
\ No newline at end of file
"filename", "language", "Python", "pip requirements", "Markdown", "comment", "blank", "total"
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\__init__.py", "Python", 0, 0, 0, 0, 1, 1
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\cfginfohandle.py", "Python", 91, 0, 0, 43, 24, 158
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\cucc_k8s.py", "Python", 327, 0, 0, 14, 59, 400
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\flask_wrapper.py", "Python", 198, 0, 0, 33, 51, 282
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\globalconst.py", "Python", 204, 0, 0, 65, 70, 339
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\globalerror.py", "Python", 19, 0, 0, 19, 11, 49
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\globalutility.py", "Python", 380, 0, 0, 346, 104, 830
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\httptrans.py", "Python", 129, 0, 0, 85, 40, 254
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\initflaskhanlde.py", "Python", 17, 0, 0, 25, 9, 51
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\loginhandle.py", "Python", 75, 0, 0, 49, 33, 157
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\README.md", "Markdown", 0, 0, 53, 0, 28, 81
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\aes_utils.py", "Python", 49, 0, 0, 63, 11, 123
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\app_exception.py", "Python", 47, 0, 0, 62, 16, 125
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\app_response.py", "Python", 80, 0, 0, 56, 23, 159
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\base_const.py", "Python", 24, 0, 0, 10, 7, 41
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\base_db_service.py", "Python", 234, 0, 0, 165, 68, 467
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\base_redis_service.py", "Python", 264, 0, 0, 229, 87, 580
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\cert_utils.py", "Python", 261, 0, 0, 164, 59, 484
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\common_app_config.py", "Python", 125, 0, 0, 42, 28, 195
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\common_base_webservice.py", "Python", 408, 0, 0, 297, 90, 795
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\common_base_webservice_for_stream.py", "Python", 33, 0, 0, 20, 12, 65
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\logined_user.py", "Python", 53, 0, 0, 27, 15, 95
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\md5_utils.py", "Python", 15, 0, 0, 14, 5, 34
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\rsa_utils.py", "Python", 36, 0, 0, 49, 14, 99
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\send_notices_utils.py", "Python", 176, 0, 0, 84, 58, 318
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\util_methods.py", "Python", 305, 0, 0, 59, 27, 391
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_base.py", "Python", 880, 0, 0, 361, 137, 1378
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_get_cluster_info\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_get_cluster_info\cluster_info.py", "Python", 69, 0, 0, 54, 13, 136
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_get_cluster_info\get_cluster_info_utils.py", "Python", 1221, 0, 0, 208, 146, 1575
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_http\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_http\call_k8s_api_utils.py", "Python", 227, 0, 0, 81, 28, 336
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_http\http_cookie.py", "Python", 22, 0, 0, 25, 8, 55
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_http\http_utils.py", "Python", 131, 0, 0, 230, 28, 389
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\cr_utils.py", "Python", 148, 0, 0, 94, 25, 267
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\k8s_api_object_utils.py", "Python", 3036, 0, 0, 615, 269, 3920
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\k8s_api_object_utils_v2.py", "Python", 1399, 0, 0, 526, 162, 2087
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\k8s_api_objects.py", "Python", 890, 0, 0, 141, 87, 1118
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\k8s_model.py", "Python", 43, 0, 0, 22, 15, 80
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\k8s_utils.py", "Python", 629, 0, 0, 279, 85, 993
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_istio\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_knative\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_knative\knative_service_obj.py", "Python", 516, 0, 0, 228, 151, 895
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_knative\knative_utils.py", "Python", 86, 0, 0, 44, 16, 146
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_knative\tekton_taskrun_obj.py", "Python", 28, 0, 0, 23, 10, 61
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_knative\tekton_utils.py", "Python", 82, 0, 0, 43, 16, 141
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\base_app_vpc_utils.py", "Python", 224, 0, 0, 96, 26, 346
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\base_const_for_mesh_mng.py", "Python", 95, 0, 0, 10, 29, 134
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\base_model_for_mesh_mng.py", "Python", 68, 0, 0, 30, 17, 115
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\base_utils_for_mesh_mng.py", "Python", 202, 0, 0, 42, 21, 265
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\ca_source_info.py", "Python", 41, 0, 0, 17, 13, 71
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\cluster_istio.py", "Python", 1236, 0, 0, 248, 248, 1732
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\csm_instance.py", "Python", 258, 0, 0, 60, 54, 372
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\csm_instance_cluster.py", "Python", 110, 0, 0, 38, 28, 176
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\csm_instance_db_service.py", "Python", 581, 0, 0, 181, 78, 840
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\cuk_clb_info.py", "Python", 35, 0, 0, 24, 13, 72
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\describe_cluster_istio.py", "Python", 1085, 0, 0, 196, 152, 1433
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\maintain_func_utils.py", "Python", 1186, 0, 0, 347, 152, 1685
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\manage_istio_in_k8s.py", "Python", 236, 0, 0, 31, 23, 290
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\query_istio_in_k8s.py", "Python", 2116, 0, 0, 556, 264, 2936
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\spire_config.py", "Python", 28, 0, 0, 20, 11, 59
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\spire_func_utils.py", "Python", 955, 0, 0, 204, 155, 1314
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\thread_delete_maintain_res_svc.py", "Python", 50, 0, 0, 12, 12, 74
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_promapi\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_promapi\prom_config.py", "Python", 12, 0, 0, 15, 5, 32
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_promapi\prom_result_vector.py", "Python", 59, 0, 0, 20, 16, 95
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_promapi\prom_utils.py", "Python", 243, 0, 0, 38, 23, 304
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_billing\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_billing\billing_create_order_info.py", "Python", 51, 0, 0, 20, 14, 85
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_billing\billing_feededuct_info.py", "Python", 29, 0, 0, 17, 8, 54
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_billing\billing_update_order_info.py", "Python", 19, 0, 0, 15, 8, 42
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_billing\billing_utils.py", "Python", 143, 0, 0, 85, 46, 274
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_configcenter\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_configcenter\configcenter_region_quota.py", "Python", 70, 0, 0, 34, 20, 124
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_configcenter\configcenter_response.py", "Python", 19, 0, 0, 18, 9, 46
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_configcenter\configcenter_utils.py", "Python", 247, 0, 0, 94, 49, 390
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_iam\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_iam\iam_instance.py", "Python", 14, 0, 0, 16, 11, 41
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_iam\iam_response.py", "Python", 9, 0, 0, 12, 6, 27
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_iam\iam_utils.py", "Python", 268, 0, 0, 110, 58, 436
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_sso\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_sso\sso_utils.py", "Python", 165, 0, 0, 63, 39, 267
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_vpc\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_vpc\vpc_utils.py", "Python", 541, 0, 0, 102, 85, 728
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_v2.py", "Python", 52, 0, 0, 26, 15, 93
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_webservice\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_webservice\change_logging_level.py", "Python", 40, 0, 0, 19, 16, 75
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_webservice\common_base_webservice_for_stream_v2.py", "Python", 75, 0, 0, 22, 17, 114
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_webservice\common_base_webservice_v2.py", "Python", 351, 0, 0, 200, 82, 633
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_webservice\show_logging_level.py", "Python", 14, 0, 0, 13, 7, 34
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_anykeyvalue_utils.py", "Python", 65, 0, 0, 17, 24, 106
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_baseexception.py", "Python", 88, 0, 0, 81, 30, 199
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_basehttpsrvlet.py", "Python", 451, 0, 0, 17, 122, 590
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_datahandle\__init__.py", "Python", 0, 0, 0, 0, 1, 1
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_datahandle\const.py", "Python", 81, 0, 0, 24, 13, 118
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_datahandle\datahandle_utility.py", "Python", 222, 0, 0, 132, 33, 387
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_servicehandle.py", "Python", 486, 0, 0, 33, 117, 636
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_stringutils.py", "Python", 15, 0, 0, 41, 9, 65
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_structure_utils.py", "Python", 1046, 0, 0, 55, 253, 1354
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_utils.py", "Python", 167, 0, 0, 128, 47, 342
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\mysql_utils.py", "Python", 172, 0, 0, 131, 45, 348
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\redishanlde.py", "Python", 236, 0, 0, 172, 74, 482
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\simple_sql_opt.py", "Python", 137, 0, 0, 20, 12, 169
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\sky_baseexception.py", "Python", 126, 0, 0, 35, 39, 200
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\sky_httptrans.py", "Python", 164, 0, 0, 96, 49, 309
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\__init__.py", "Python", 8, 0, 0, 0, 1, 9
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\cke_cluster_info.py", "Python", 164, 0, 0, 2, 14, 180
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\common_dao.py", "Python", 252, 0, 0, 122, 30, 404
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\common_func.py", "Python", 323, 0, 0, 120, 33, 476
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\const.py", "Python", 243, 0, 0, 39, 40, 322
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\csk_cluster_info.py", "Python", 159, 0, 0, 2, 14, 175
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\cuk_cluster_info.py", "Python", 163, 0, 0, 9, 14, 186
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\kube_cluster_info_get.py", "Python", 194, 0, 0, 42, 18, 254
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\login_verify.py", "Python", 181, 0, 0, 2, 15, 198
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\login_verify_low_require.py", "Python", 47, 0, 0, 2, 7, 56
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\namespace_opt.py", "Python", 99, 0, 0, 31, 10, 140
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\resource_obj_opt.py", "Python", 130, 0, 0, 85, 11, 226
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\requirements.txt", "pip requirements", 0, 46, 0, 0, 1, 47
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\setup.py", "Python", 73, 0, 0, 11, 4, 88
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\__init__.py", "Python", 0, 0, 0, 10, 1, 11
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_flask_wrapper.py", "Python", 16, 0, 0, 10, 9, 35
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_httptrans.py", "Python", 64, 0, 0, 13, 23, 100
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_k8s_op.py", "Python", 136, 0, 0, 15, 40, 191
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_ludq_k8s_utils.py", "Python", 202, 0, 0, 284, 30, 516
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_ludq_utils_v2.py", "Python", 21, 0, 0, 15, 9, 45
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_my_anykeyvalue_tils.py", "Python", 21, 0, 0, 10, 11, 42
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_my_baseexception.py", "Python", 69, 0, 0, 10, 18, 97
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_my_servicehandle.py", "Python", 202, 0, 0, 10, 72, 284
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_my_stringutils.py", "Python", 30, 0, 0, 10, 16, 56
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_my_structure_utils.py", "Python", 402, 0, 0, 10, 49, 461
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_mysqlutils.py", "Python", 90, 0, 0, 10, 28, 128
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_redis_sentinel_handle.py", "Python", 43, 0, 0, 15, 18, 76
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_redishandle.py", "Python", 76, 0, 0, 18, 33, 127
"e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_utility.py", "Python", 409, 0, 0, 10, 112, 531
"Total", "-", 31157, 46, 53, 10094, 5540, 46890
\ No newline at end of file
{"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/__init__.py":{"language":"Python","code":0,"comment":0,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_my_structure_utils.py":{"language":"Python","code":402,"comment":10,"blank":49},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_my_stringutils.py":{"language":"Python","code":30,"comment":10,"blank":16},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_my_servicehandle.py":{"language":"Python","code":202,"comment":10,"blank":72},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_redis_sentinel_handle.py":{"language":"Python","code":43,"comment":15,"blank":18},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_my_baseexception.py":{"language":"Python","code":69,"comment":10,"blank":18},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_my_anykeyvalue_tils.py":{"language":"Python","code":21,"comment":10,"blank":11},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_mysqlutils.py":{"language":"Python","code":90,"comment":10,"blank":28},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_ludq_k8s_utils.py":{"language":"Python","code":202,"comment":284,"blank":30},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_redishandle.py":{"language":"Python","code":76,"comment":18,"blank":33},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_ludq_utils_v2.py":{"language":"Python","code":21,"comment":15,"blank":9},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_k8s_op.py":{"language":"Python","code":136,"comment":15,"blank":40},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_httptrans.py":{"language":"Python","code":64,"comment":13,"blank":23},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/requirements.txt":{"language":"pip requirements","code":46,"comment":0,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_flask_wrapper.py":{"language":"Python","code":16,"comment":10,"blank":9},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/setup.py":{"language":"Python","code":73,"comment":11,"blank":4},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/test/test_utility.py":{"language":"Python","code":409,"comment":10,"blank":112},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/sky_httptrans.py":{"language":"Python","code":164,"comment":96,"blank":49},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/sky_baseexception.py":{"language":"Python","code":126,"comment":35,"blank":39},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/simple_sql_opt.py":{"language":"Python","code":137,"comment":20,"blank":12},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/redishanlde.py":{"language":"Python","code":236,"comment":172,"blank":74},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/my_utils.py":{"language":"Python","code":167,"comment":128,"blank":47},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/my_stringutils.py":{"language":"Python","code":15,"comment":41,"blank":9},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/my_structure_utils.py":{"language":"Python","code":1046,"comment":55,"blank":253},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/cuk_cluster_info.py":{"language":"Python","code":163,"comment":9,"blank":14},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/my_servicehandle.py":{"language":"Python","code":486,"comment":33,"blank":117},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/__init__.py":{"language":"Python","code":8,"comment":0,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/common_func.py":{"language":"Python","code":323,"comment":120,"blank":33},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/const.py":{"language":"Python","code":243,"comment":39,"blank":40},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/namespace_opt.py":{"language":"Python","code":99,"comment":31,"blank":10},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/csk_cluster_info.py":{"language":"Python","code":159,"comment":2,"blank":14},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/my_datahandle/__init__.py":{"language":"Python","code":0,"comment":0,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/login_verify_low_require.py":{"language":"Python","code":47,"comment":2,"blank":7},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/login_verify.py":{"language":"Python","code":181,"comment":2,"blank":15},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/kube_cluster_info_get.py":{"language":"Python","code":194,"comment":42,"blank":18},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/my_datahandle/datahandle_utility.py":{"language":"Python","code":222,"comment":132,"blank":33},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/my_datahandle/const.py":{"language":"Python","code":81,"comment":24,"blank":13},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/common_dao.py":{"language":"Python","code":252,"comment":122,"blank":30},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/cke_cluster_info.py":{"language":"Python","code":164,"comment":2,"blank":14},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/my_anykeyvalue_utils.py":{"language":"Python","code":65,"comment":17,"blank":24},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/my_baseexception.py":{"language":"Python","code":88,"comment":81,"blank":30},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/my_basehttpsrvlet.py":{"language":"Python","code":451,"comment":17,"blank":122},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/util_methods.py":{"language":"Python","code":305,"comment":59,"blank":27},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/mysql_utils.py":{"language":"Python","code":172,"comment":131,"blank":45},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_webservice/common_base_webservice_for_stream_v2.py":{"language":"Python","code":75,"comment":22,"blank":17},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_v2.py":{"language":"Python","code":52,"comment":26,"blank":15},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_webservice/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_webservice/change_logging_level.py":{"language":"Python","code":40,"comment":19,"blank":16},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_vpc/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_webservice/show_logging_level.py":{"language":"Python","code":14,"comment":13,"blank":7},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_webservice/common_base_webservice_v2.py":{"language":"Python","code":351,"comment":200,"blank":82},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_sso/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/util_pkg/resource_obj_opt.py":{"language":"Python","code":130,"comment":85,"blank":11},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_iam/iam_instance.py":{"language":"Python","code":14,"comment":16,"blank":11},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_vpc/vpc_utils.py":{"language":"Python","code":541,"comment":102,"blank":85},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_iam/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_iam/iam_utils.py":{"language":"Python","code":268,"comment":110,"blank":58},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_sso/sso_utils.py":{"language":"Python","code":165,"comment":63,"blank":39},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_configcenter/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_iam/iam_response.py":{"language":"Python","code":9,"comment":12,"blank":6},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_configcenter/configcenter_region_quota.py":{"language":"Python","code":70,"comment":34,"blank":20},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_billing/billing_update_order_info.py":{"language":"Python","code":19,"comment":15,"blank":8},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_billing/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_configcenter/configcenter_utils.py":{"language":"Python","code":247,"comment":94,"blank":49},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_billing/billing_utils.py":{"language":"Python","code":143,"comment":85,"blank":46},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_billing/billing_feededuct_info.py":{"language":"Python","code":29,"comment":17,"blank":8},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_billing/billing_create_order_info.py":{"language":"Python","code":51,"comment":20,"blank":14},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_tg_configcenter/configcenter_response.py":{"language":"Python","code":19,"comment":18,"blank":9},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/base_utils_for_mesh_mng.py":{"language":"Python","code":202,"comment":42,"blank":21},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_promapi/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/base_model_for_mesh_mng.py":{"language":"Python","code":68,"comment":30,"blank":17},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s_knative/knative_service_obj.py":{"language":"Python","code":516,"comment":228,"blank":151},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/base_const_for_mesh_mng.py":{"language":"Python","code":95,"comment":10,"blank":29},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_promapi/prom_result_vector.py":{"language":"Python","code":59,"comment":20,"blank":16},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_promapi/prom_utils.py":{"language":"Python","code":243,"comment":38,"blank":23},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_promapi/prom_config.py":{"language":"Python","code":12,"comment":15,"blank":5},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/base_app_vpc_utils.py":{"language":"Python","code":224,"comment":96,"blank":26},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s_knative/knative_utils.py":{"language":"Python","code":86,"comment":44,"blank":16},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/csm_instance_db_service.py":{"language":"Python","code":581,"comment":181,"blank":78},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s/k8s_api_object_utils_v2.py":{"language":"Python","code":1399,"comment":526,"blank":162},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s_knative/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s/k8s_api_object_utils.py":{"language":"Python","code":3036,"comment":615,"blank":269},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s/k8s_api_objects.py":{"language":"Python","code":890,"comment":141,"blank":87},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s_istio/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s/cr_utils.py":{"language":"Python","code":148,"comment":94,"blank":25},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/cluster_istio.py":{"language":"Python","code":1236,"comment":248,"blank":248},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s_knative/tekton_taskrun_obj.py":{"language":"Python","code":28,"comment":23,"blank":10},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s/k8s_model.py":{"language":"Python","code":43,"comment":22,"blank":15},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s_knative/tekton_utils.py":{"language":"Python","code":82,"comment":43,"blank":16},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/ca_source_info.py":{"language":"Python","code":41,"comment":17,"blank":13},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/maintain_func_utils.py":{"language":"Python","code":1186,"comment":347,"blank":152},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_k8s/k8s_utils.py":{"language":"Python","code":629,"comment":279,"blank":85},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/describe_cluster_istio.py":{"language":"Python","code":1085,"comment":196,"blank":152},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_base.py":{"language":"Python","code":880,"comment":361,"blank":137},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/rsa_utils.py":{"language":"Python","code":36,"comment":49,"blank":14},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/send_notices_utils.py":{"language":"Python","code":176,"comment":84,"blank":58},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/README.md":{"language":"Markdown","code":53,"comment":0,"blank":28},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/md5_utils.py":{"language":"Python","code":15,"comment":14,"blank":5},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/common_base_webservice_for_stream.py":{"language":"Python","code":33,"comment":20,"blank":12},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/logined_user.py":{"language":"Python","code":53,"comment":27,"blank":15},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/manage_istio_in_k8s.py":{"language":"Python","code":236,"comment":31,"blank":23},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/common_app_config.py":{"language":"Python","code":125,"comment":42,"blank":28},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/cert_utils.py":{"language":"Python","code":261,"comment":164,"blank":59},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/common_base_webservice.py":{"language":"Python","code":408,"comment":297,"blank":90},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/base_const.py":{"language":"Python","code":24,"comment":10,"blank":7},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/base_redis_service.py":{"language":"Python","code":264,"comment":229,"blank":87},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/base_db_service.py":{"language":"Python","code":234,"comment":165,"blank":68},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/app_response.py":{"language":"Python","code":80,"comment":56,"blank":23},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/aes_utils.py":{"language":"Python","code":49,"comment":63,"blank":11},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/query_istio_in_k8s.py":{"language":"Python","code":2116,"comment":556,"blank":264},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/loginhandle.py":{"language":"Python","code":75,"comment":49,"blank":33},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/initflaskhanlde.py":{"language":"Python","code":17,"comment":25,"blank":9},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/app_exception.py":{"language":"Python","code":47,"comment":62,"blank":16},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/globalerror.py":{"language":"Python","code":19,"comment":19,"blank":11},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/globalutility.py":{"language":"Python","code":380,"comment":346,"blank":104},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/globalconst.py":{"language":"Python","code":204,"comment":65,"blank":70},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/cucc_k8s.py":{"language":"Python","code":327,"comment":14,"blank":59},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/cfginfohandle.py":{"language":"Python","code":91,"comment":43,"blank":24},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/spire_config.py":{"language":"Python","code":28,"comment":20,"blank":11},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/thread_delete_maintain_res_svc.py":{"language":"Python","code":50,"comment":12,"blank":12},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_http/http_cookie.py":{"language":"Python","code":22,"comment":25,"blank":8},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/httptrans.py":{"language":"Python","code":129,"comment":85,"blank":40},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_http/call_k8s_api_utils.py":{"language":"Python","code":227,"comment":81,"blank":28},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/spire_func_utils.py":{"language":"Python","code":955,"comment":204,"blank":155},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_http/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_get_cluster_info/cluster_info.py":{"language":"Python","code":69,"comment":54,"blank":13},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/flask_wrapper.py":{"language":"Python","code":198,"comment":33,"blank":51},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_get_cluster_info/__init__.py":{"language":"Python","code":0,"comment":10,"blank":1},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_http/http_utils.py":{"language":"Python","code":131,"comment":230,"blank":28},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_get_cluster_info/get_cluster_info_utils.py":{"language":"Python","code":1221,"comment":208,"blank":146},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/csm_instance_cluster.py":{"language":"Python","code":110,"comment":38,"blank":28},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/cuk_clb_info.py":{"language":"Python","code":35,"comment":24,"blank":13},"file:///e%3A/MyDesktop/MyProgram/PythonProject/common_pkg/cucc_common_pkg/ludq_utils/utils_mesh_mng/csm_instance.py":{"language":"Python","code":258,"comment":60,"blank":54}}
\ No newline at end of file
# Summary
Date : 2023-10-27 16:38:11
Directory e:\\MyDesktop\\MyProgram\\PythonProject\\common_pkg
Total : 138 files, 31256 codes, 10094 comments, 5540 blanks, all 46890 lines
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
## Languages
| language | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| Python | 136 | 31,157 | 10,094 | 5,511 | 46,762 |
| Markdown | 1 | 53 | 0 | 28 | 81 |
| pip requirements | 1 | 46 | 0 | 1 | 47 |
## Directories
| path | files | code | comment | blank | total |
| :--- | ---: | ---: | ---: | ---: | ---: |
| . | 138 | 31,256 | 10,094 | 5,540 | 46,890 |
| . (Files) | 3 | 119 | 11 | 6 | 136 |
| cucc_common_pkg | 120 | 29,356 | 9,633 | 5,065 | 44,054 |
| cucc_common_pkg (Files) | 22 | 4,593 | 1,515 | 1,223 | 7,331 |
| cucc_common_pkg\\ludq_utils | 83 | 22,497 | 7,506 | 3,588 | 33,591 |
| cucc_common_pkg\\ludq_utils (Files) | 19 | 3,095 | 1,738 | 701 | 5,534 |
| cucc_common_pkg\\ludq_utils\\utils_get_cluster_info | 3 | 1,290 | 272 | 160 | 1,722 |
| cucc_common_pkg\\ludq_utils\\utils_http | 4 | 380 | 346 | 65 | 791 |
| cucc_common_pkg\\ludq_utils\\utils_k8s | 7 | 6,145 | 1,687 | 644 | 8,476 |
| cucc_common_pkg\\ludq_utils\\utils_k8s_istio | 1 | 0 | 10 | 1 | 11 |
| cucc_common_pkg\\ludq_utils\\utils_k8s_knative | 5 | 712 | 348 | 194 | 1,254 |
| cucc_common_pkg\\ludq_utils\\utils_mesh_mng | 18 | 8,506 | 2,122 | 1,297 | 11,925 |
| cucc_common_pkg\\ludq_utils\\utils_promapi | 4 | 314 | 83 | 45 | 442 |
| cucc_common_pkg\\ludq_utils\\utils_tg_billing | 5 | 242 | 147 | 77 | 466 |
| cucc_common_pkg\\ludq_utils\\utils_tg_configcenter | 4 | 336 | 156 | 79 | 571 |
| cucc_common_pkg\\ludq_utils\\utils_tg_iam | 4 | 291 | 148 | 76 | 515 |
| cucc_common_pkg\\ludq_utils\\utils_tg_sso | 2 | 165 | 73 | 40 | 278 |
| cucc_common_pkg\\ludq_utils\\utils_tg_vpc | 2 | 541 | 112 | 86 | 739 |
| cucc_common_pkg\\ludq_utils\\utils_webservice | 5 | 480 | 264 | 123 | 867 |
| cucc_common_pkg\\my_datahandle | 3 | 303 | 156 | 47 | 506 |
| cucc_common_pkg\\util_pkg | 12 | 1,963 | 456 | 207 | 2,626 |
| test | 15 | 1,781 | 450 | 469 | 2,700 |
Summary / [Details](details.md) / [Diff Summary](diff.md) / [Diff Details](diff-details.md)
\ No newline at end of file
Date : 2023-10-27 16:38:11
Directory : e:\MyDesktop\MyProgram\PythonProject\common_pkg
Total : 138 files, 31256 codes, 10094 comments, 5540 blanks, all 46890 lines
Languages
+------------------+------------+------------+------------+------------+------------+
| language | files | code | comment | blank | total |
+------------------+------------+------------+------------+------------+------------+
| Python | 136 | 31,157 | 10,094 | 5,511 | 46,762 |
| Markdown | 1 | 53 | 0 | 28 | 81 |
| pip requirements | 1 | 46 | 0 | 1 | 47 |
+------------------+------------+------------+------------+------------+------------+
Directories
+-------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| path | files | code | comment | blank | total |
+-------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
| . | 138 | 31,256 | 10,094 | 5,540 | 46,890 |
| . (Files) | 3 | 119 | 11 | 6 | 136 |
| cucc_common_pkg | 120 | 29,356 | 9,633 | 5,065 | 44,054 |
| cucc_common_pkg (Files) | 22 | 4,593 | 1,515 | 1,223 | 7,331 |
| cucc_common_pkg\ludq_utils | 83 | 22,497 | 7,506 | 3,588 | 33,591 |
| cucc_common_pkg\ludq_utils (Files) | 19 | 3,095 | 1,738 | 701 | 5,534 |
| cucc_common_pkg\ludq_utils\utils_get_cluster_info | 3 | 1,290 | 272 | 160 | 1,722 |
| cucc_common_pkg\ludq_utils\utils_http | 4 | 380 | 346 | 65 | 791 |
| cucc_common_pkg\ludq_utils\utils_k8s | 7 | 6,145 | 1,687 | 644 | 8,476 |
| cucc_common_pkg\ludq_utils\utils_k8s_istio | 1 | 0 | 10 | 1 | 11 |
| cucc_common_pkg\ludq_utils\utils_k8s_knative | 5 | 712 | 348 | 194 | 1,254 |
| cucc_common_pkg\ludq_utils\utils_mesh_mng | 18 | 8,506 | 2,122 | 1,297 | 11,925 |
| cucc_common_pkg\ludq_utils\utils_promapi | 4 | 314 | 83 | 45 | 442 |
| cucc_common_pkg\ludq_utils\utils_tg_billing | 5 | 242 | 147 | 77 | 466 |
| cucc_common_pkg\ludq_utils\utils_tg_configcenter | 4 | 336 | 156 | 79 | 571 |
| cucc_common_pkg\ludq_utils\utils_tg_iam | 4 | 291 | 148 | 76 | 515 |
| cucc_common_pkg\ludq_utils\utils_tg_sso | 2 | 165 | 73 | 40 | 278 |
| cucc_common_pkg\ludq_utils\utils_tg_vpc | 2 | 541 | 112 | 86 | 739 |
| cucc_common_pkg\ludq_utils\utils_webservice | 5 | 480 | 264 | 123 | 867 |
| cucc_common_pkg\my_datahandle | 3 | 303 | 156 | 47 | 506 |
| cucc_common_pkg\util_pkg | 12 | 1,963 | 456 | 207 | 2,626 |
| test | 15 | 1,781 | 450 | 469 | 2,700 |
+-------------------------------------------------------------------------------------------------------------------------------------+------------+------------+------------+------------+------------+
Files
+-------------------------------------------------------------------------------------------------------------------------------------+------------------+------------+------------+------------+------------+
| filename | language | code | comment | blank | total |
+-------------------------------------------------------------------------------------------------------------------------------------+------------------+------------+------------+------------+------------+
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\__init__.py | Python | 0 | 0 | 1 | 1 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\cfginfohandle.py | Python | 91 | 43 | 24 | 158 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\cucc_k8s.py | Python | 327 | 14 | 59 | 400 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\flask_wrapper.py | Python | 198 | 33 | 51 | 282 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\globalconst.py | Python | 204 | 65 | 70 | 339 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\globalerror.py | Python | 19 | 19 | 11 | 49 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\globalutility.py | Python | 380 | 346 | 104 | 830 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\httptrans.py | Python | 129 | 85 | 40 | 254 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\initflaskhanlde.py | Python | 17 | 25 | 9 | 51 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\loginhandle.py | Python | 75 | 49 | 33 | 157 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\README.md | Markdown | 53 | 0 | 28 | 81 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\aes_utils.py | Python | 49 | 63 | 11 | 123 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\app_exception.py | Python | 47 | 62 | 16 | 125 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\app_response.py | Python | 80 | 56 | 23 | 159 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\base_const.py | Python | 24 | 10 | 7 | 41 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\base_db_service.py | Python | 234 | 165 | 68 | 467 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\base_redis_service.py | Python | 264 | 229 | 87 | 580 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\cert_utils.py | Python | 261 | 164 | 59 | 484 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\common_app_config.py | Python | 125 | 42 | 28 | 195 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\common_base_webservice.py | Python | 408 | 297 | 90 | 795 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\common_base_webservice_for_stream.py | Python | 33 | 20 | 12 | 65 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\logined_user.py | Python | 53 | 27 | 15 | 95 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\md5_utils.py | Python | 15 | 14 | 5 | 34 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\rsa_utils.py | Python | 36 | 49 | 14 | 99 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\send_notices_utils.py | Python | 176 | 84 | 58 | 318 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\util_methods.py | Python | 305 | 59 | 27 | 391 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_base.py | Python | 880 | 361 | 137 | 1,378 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_get_cluster_info\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_get_cluster_info\cluster_info.py | Python | 69 | 54 | 13 | 136 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_get_cluster_info\get_cluster_info_utils.py | Python | 1,221 | 208 | 146 | 1,575 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_http\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_http\call_k8s_api_utils.py | Python | 227 | 81 | 28 | 336 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_http\http_cookie.py | Python | 22 | 25 | 8 | 55 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_http\http_utils.py | Python | 131 | 230 | 28 | 389 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\cr_utils.py | Python | 148 | 94 | 25 | 267 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\k8s_api_object_utils.py | Python | 3,036 | 615 | 269 | 3,920 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\k8s_api_object_utils_v2.py | Python | 1,399 | 526 | 162 | 2,087 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\k8s_api_objects.py | Python | 890 | 141 | 87 | 1,118 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\k8s_model.py | Python | 43 | 22 | 15 | 80 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s\k8s_utils.py | Python | 629 | 279 | 85 | 993 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_istio\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_knative\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_knative\knative_service_obj.py | Python | 516 | 228 | 151 | 895 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_knative\knative_utils.py | Python | 86 | 44 | 16 | 146 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_knative\tekton_taskrun_obj.py | Python | 28 | 23 | 10 | 61 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_k8s_knative\tekton_utils.py | Python | 82 | 43 | 16 | 141 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\base_app_vpc_utils.py | Python | 224 | 96 | 26 | 346 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\base_const_for_mesh_mng.py | Python | 95 | 10 | 29 | 134 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\base_model_for_mesh_mng.py | Python | 68 | 30 | 17 | 115 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\base_utils_for_mesh_mng.py | Python | 202 | 42 | 21 | 265 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\ca_source_info.py | Python | 41 | 17 | 13 | 71 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\cluster_istio.py | Python | 1,236 | 248 | 248 | 1,732 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\csm_instance.py | Python | 258 | 60 | 54 | 372 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\csm_instance_cluster.py | Python | 110 | 38 | 28 | 176 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\csm_instance_db_service.py | Python | 581 | 181 | 78 | 840 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\cuk_clb_info.py | Python | 35 | 24 | 13 | 72 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\describe_cluster_istio.py | Python | 1,085 | 196 | 152 | 1,433 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\maintain_func_utils.py | Python | 1,186 | 347 | 152 | 1,685 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\manage_istio_in_k8s.py | Python | 236 | 31 | 23 | 290 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\query_istio_in_k8s.py | Python | 2,116 | 556 | 264 | 2,936 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\spire_config.py | Python | 28 | 20 | 11 | 59 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\spire_func_utils.py | Python | 955 | 204 | 155 | 1,314 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_mesh_mng\thread_delete_maintain_res_svc.py | Python | 50 | 12 | 12 | 74 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_promapi\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_promapi\prom_config.py | Python | 12 | 15 | 5 | 32 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_promapi\prom_result_vector.py | Python | 59 | 20 | 16 | 95 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_promapi\prom_utils.py | Python | 243 | 38 | 23 | 304 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_billing\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_billing\billing_create_order_info.py | Python | 51 | 20 | 14 | 85 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_billing\billing_feededuct_info.py | Python | 29 | 17 | 8 | 54 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_billing\billing_update_order_info.py | Python | 19 | 15 | 8 | 42 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_billing\billing_utils.py | Python | 143 | 85 | 46 | 274 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_configcenter\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_configcenter\configcenter_region_quota.py | Python | 70 | 34 | 20 | 124 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_configcenter\configcenter_response.py | Python | 19 | 18 | 9 | 46 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_configcenter\configcenter_utils.py | Python | 247 | 94 | 49 | 390 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_iam\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_iam\iam_instance.py | Python | 14 | 16 | 11 | 41 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_iam\iam_response.py | Python | 9 | 12 | 6 | 27 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_iam\iam_utils.py | Python | 268 | 110 | 58 | 436 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_sso\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_sso\sso_utils.py | Python | 165 | 63 | 39 | 267 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_vpc\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_tg_vpc\vpc_utils.py | Python | 541 | 102 | 85 | 728 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_v2.py | Python | 52 | 26 | 15 | 93 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_webservice\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_webservice\change_logging_level.py | Python | 40 | 19 | 16 | 75 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_webservice\common_base_webservice_for_stream_v2.py | Python | 75 | 22 | 17 | 114 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_webservice\common_base_webservice_v2.py | Python | 351 | 200 | 82 | 633 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\ludq_utils\utils_webservice\show_logging_level.py | Python | 14 | 13 | 7 | 34 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_anykeyvalue_utils.py | Python | 65 | 17 | 24 | 106 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_baseexception.py | Python | 88 | 81 | 30 | 199 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_basehttpsrvlet.py | Python | 451 | 17 | 122 | 590 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_datahandle\__init__.py | Python | 0 | 0 | 1 | 1 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_datahandle\const.py | Python | 81 | 24 | 13 | 118 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_datahandle\datahandle_utility.py | Python | 222 | 132 | 33 | 387 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_servicehandle.py | Python | 486 | 33 | 117 | 636 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_stringutils.py | Python | 15 | 41 | 9 | 65 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_structure_utils.py | Python | 1,046 | 55 | 253 | 1,354 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\my_utils.py | Python | 167 | 128 | 47 | 342 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\mysql_utils.py | Python | 172 | 131 | 45 | 348 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\redishanlde.py | Python | 236 | 172 | 74 | 482 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\simple_sql_opt.py | Python | 137 | 20 | 12 | 169 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\sky_baseexception.py | Python | 126 | 35 | 39 | 200 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\sky_httptrans.py | Python | 164 | 96 | 49 | 309 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\__init__.py | Python | 8 | 0 | 1 | 9 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\cke_cluster_info.py | Python | 164 | 2 | 14 | 180 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\common_dao.py | Python | 252 | 122 | 30 | 404 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\common_func.py | Python | 323 | 120 | 33 | 476 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\const.py | Python | 243 | 39 | 40 | 322 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\csk_cluster_info.py | Python | 159 | 2 | 14 | 175 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\cuk_cluster_info.py | Python | 163 | 9 | 14 | 186 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\kube_cluster_info_get.py | Python | 194 | 42 | 18 | 254 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\login_verify.py | Python | 181 | 2 | 15 | 198 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\login_verify_low_require.py | Python | 47 | 2 | 7 | 56 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\namespace_opt.py | Python | 99 | 31 | 10 | 140 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\cucc_common_pkg\util_pkg\resource_obj_opt.py | Python | 130 | 85 | 11 | 226 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\requirements.txt | pip requirements | 46 | 0 | 1 | 47 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\setup.py | Python | 73 | 11 | 4 | 88 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\__init__.py | Python | 0 | 10 | 1 | 11 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_flask_wrapper.py | Python | 16 | 10 | 9 | 35 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_httptrans.py | Python | 64 | 13 | 23 | 100 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_k8s_op.py | Python | 136 | 15 | 40 | 191 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_ludq_k8s_utils.py | Python | 202 | 284 | 30 | 516 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_ludq_utils_v2.py | Python | 21 | 15 | 9 | 45 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_my_anykeyvalue_tils.py | Python | 21 | 10 | 11 | 42 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_my_baseexception.py | Python | 69 | 10 | 18 | 97 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_my_servicehandle.py | Python | 202 | 10 | 72 | 284 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_my_stringutils.py | Python | 30 | 10 | 16 | 56 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_my_structure_utils.py | Python | 402 | 10 | 49 | 461 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_mysqlutils.py | Python | 90 | 10 | 28 | 128 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_redis_sentinel_handle.py | Python | 43 | 15 | 18 | 76 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_redishandle.py | Python | 76 | 18 | 33 | 127 |
| e:\MyDesktop\MyProgram\PythonProject\common_pkg\test\test_utility.py | Python | 409 | 10 | 112 | 531 |
| Total | | 31,256 | 10,094 | 5,540 | 46,890 |
+-------------------------------------------------------------------------------------------------------------------------------------+------------------+------------+------------+------------+------------+
\ No newline at end of file
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
.idea/*
.idea/
.idea
*.idea/
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
.static_storage/
.media/
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
.idea/
*.iml
.vscode/
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Version: 1.0
@Python Version:3.6.6
@Author: ludq1
@Email: ludq1@chinaunicom.cn
@date: 2023/04/07 11:40:00
@Description:
"""
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Version: 1.0
@Python Version:3.6.6
@Author: ludq1
@Email: ludq1@chinaunicom.cn
@date: 2023/04/07 11:40:00
@Description:
"""
import os
from .globalconst import RedisConnConst, RedisSentinelConnConst, RedisSentinelConnEnvConst, RedisConnEnvConst, \
RedisInfoKeysConst
class CfgInfoHandle:
def __init__(self, flask_app=None):
r"""
登录处理初始化
Args:
flask_app: flask app
list_filter_url: url过滤,不需要被登录检查的 list[dict]
"""
# 初始化,处理是否接入flask
self.app = flask_app
if flask_app is not None:
self.init_app(flask_app)
@classmethod
def init_app(self, app):
r"""
初始化flask变量,走所有服务之前去验证登录
Args:
app:
Returns:
"""
pass
def get_redis_info(self, str_master_ip_port: str = None, str_slave_ip_port: str = None, str_redis_auth: str = None,
str_redis_db: str = None) -> dict:
r"""
获取redis环境信息
Args:
str_master_ip_port: redis 主节点信息
str_slave_ip_port: redis 从节点信息
str_redis_auth: redis 密码
str_redis_db: redis 库index
Returns: 返回redis连接信息
"""
env_dist = os.environ # environ是在os.py中定义的一个dict environ = {}
if str_master_ip_port is not None:
master_ip = str_master_ip_port.split(':')[0]
master_port = str_master_ip_port.split(':')[1]
else:
master_ip = env_dist.get(RedisConnEnvConst.CONN_MR_IP) if env_dist.get(
RedisConnEnvConst.CONN_MR_IP) else "csm-redis-master"
master_port = env_dist.get(RedisConnEnvConst.CONN_MR_PORT) if env_dist.get(
RedisConnEnvConst.CONN_MR_PORT) else "6379"
if str_slave_ip_port is not None:
slave_ip = str_slave_ip_port.split(':')[0]
slave_port = str_slave_ip_port.split(':')[1]
else:
slave_ip = env_dist.get(RedisConnEnvConst.CONN_SL_IP) if env_dist.get(
RedisConnEnvConst.CONN_SL_IP) else "csm-redis-slave"
slave_port = env_dist.get(RedisConnEnvConst.CONN_SL_PORT) if env_dist.get(
RedisConnEnvConst.CONN_SL_PORT) else "6379"
if str_redis_auth is not None:
redis_auth = str_redis_auth
else:
redis_auth = env_dist.get(RedisConnEnvConst.CONN_MR_AUTH) if env_dist.get(
RedisConnEnvConst.CONN_MR_AUTH) else "!@#rjyjy"
if str_redis_db is not None:
redis_index = str_redis_db
else:
redis_index = env_dist.get(RedisConnEnvConst.CONN_MR_DB) if env_dist.get(
RedisConnEnvConst.CONN_MR_DB) else "9"
master_dict_conn = {
RedisConnConst.CONN_IP: master_ip
, RedisConnConst.CONN_PORT: master_port
, RedisConnConst.CONN_AUTH: redis_auth
, RedisConnConst.CONN_DB: redis_index
}
slave_dict_conn = {
RedisConnConst.CONN_IP: slave_ip
, RedisConnConst.CONN_PORT: slave_port
, RedisConnConst.CONN_AUTH: redis_auth
, RedisConnConst.CONN_DB: redis_index
}
dict_conn = {
RedisInfoKeysConst.REDIS_MASTER_KEY: master_dict_conn
, RedisInfoKeysConst.REDIS_SLAVE_KEY: slave_dict_conn
}
return dict_conn
def get_redis_sentinel_info(self, list_sentinels: list = None, str_clustername: str = None,
str_redis_auth: str = None, str_redis_db: str = None) -> dict:
r"""
获取redis的sentinel信息
Args:
list_sentinels: 哨兵集群,内部是tuple
str_clustername: 哨兵集群名称
str_redis_auth: redis密码
str_redis_db: 当前操作的redis库
Returns:
"""
env_dist = os.environ # environ是在os.py中定义的一个dict environ = {}
if list_sentinels is not None:
sentinel_cluster_hosts = list_sentinels
else:
sentinel_cluster_hosts = env_dist.get(RedisSentinelConnEnvConst.CONN_HOSTS) if env_dist.get(
RedisSentinelConnEnvConst.CONN_HOSTS) else [('redis-sentinel', '26379')]
if str_clustername is not None:
sentinel_cluster_name = str_clustername
else:
sentinel_cluster_name = env_dist.get(RedisSentinelConnEnvConst.CONN_CLUSTERNAME) if env_dist.get(
RedisSentinelConnEnvConst.CONN_CLUSTERNAME) else "csmredis"
if str_redis_auth is not None:
redis_auth = str_redis_auth
else:
redis_auth = env_dist.get(RedisSentinelConnEnvConst.CONN_AUTH) if env_dist.get(
RedisSentinelConnEnvConst.CONN_AUTH) else "!@#rjyjy"
if str_redis_db is not None:
redis_index = str_redis_db
else:
redis_index = env_dist.get(RedisSentinelConnEnvConst.CONN_DB) if env_dist.get(
RedisSentinelConnEnvConst.CONN_DB) else "9"
dict_conn = {
RedisSentinelConnConst.CONN_HOSTS: sentinel_cluster_hosts
, RedisSentinelConnConst.CONN_CLUSTERNAME: sentinel_cluster_name
, RedisConnConst.CONN_AUTH: redis_auth
, RedisConnConst.CONN_DB: redis_index
}
return dict_conn
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Version: 1.0
@Python Version:3.6.6
@Author: ludq1
@Email: ludq1@chinaunicom.cn
@date: 2023/04/07 11:40:00
@Description:
"""
import urllib.parse
import requests
from .globalconst import GlobalConst, HttpConst, SkyGlobalConst
from .my_utils import MyUtils
from .sky_baseexception import MyBaseException, create_base_exception
from .sky_httptrans import HttpTrans
class K8sOps(object):
# 标准API
STANDARD_API = "/api"
# 标准API版本
STANDARD_API_VERSION = "/v1"
# 自定义API
CRD_API = "/apis"
# k8s的ns固定路径
K8S_NS = "/namespaces"
def __init__(self, params):
'''
Constructor
'''
def crd_cs_list_obj(self, str_k8s_ip_port: str = None, str_k8s_token: str = None, str_prefix_url: str = CRD_API,
str_crd_group_version: str = None,
str_crd_obj: str = None, dict_args: dict = None) -> dict:
'''
获取自定义集群的对象列表
Args:
str_k8s_ip_port: k8s 端口
str_k8s_token: k8s token
str_prefix_url: k8s api固定前缀路径 ,/apis
str_crd_group_version: k8s crd 组和版本 /networking.istio.io/v1alpha3
str_crd_obj: k8s crd 对象名称 /virtualservices
dict_args: 查询传递参数 {"dd":"dd"}
Returns: 返回对象字典
'''
url_args = ''
if dict_args is not None:
url_args = '?'
for tmp_k, tmp_v in dict_args.items():
if url_args == '?':
url_args = url_args + tmp_k + '=' + urllib.parse.quote(tmp_v)
else:
url_args = "&" + url_args + tmp_k + '=' + urllib.parse.quote(tmp_v)
str_url = GlobalConst.DEFAULT_URLSCHEMA_SECRUE + str_k8s_ip_port + str_prefix_url + str_crd_group_version + str_crd_obj + url_args
http_trans = HttpTrans(None)
arg_extra_dict_header = {HttpConst.HEADER_KEY_CONTENT_TYPE: HttpConst.CONTENT_TYPE_JSON
, HttpConst.AUTH_KEY: HttpConst.AUTH_BEARER_PREFIX + str_k8s_token
}
try:
m_response = http_trans.get_data(
urlstr=str_url,
trans_data=dict_args,
dict_header=arg_extra_dict_header
)
ret_dict = {}
if not m_response.ok:
raise create_base_exception(
'访问url出错,访问地址:{0},返回码{1}'.format(str_url + ":" + m_response.text, m_response.status_code)
)
else:
ret_dict[SkyGlobalConst.RETKEY_RET_CODE] = SkyGlobalConst.RETCODE_SUCESS_CODE
ret_dict[SkyGlobalConst.RETKEY_RET_VAL] = SkyGlobalConst.RETCODE_SUCESS_CODE
str_ret = m_response.text
dict_ret = MyUtils.jsonstr2json(m_response.text)
if dict_ret is None:
raise create_base_exception(
'返回的内容不是有效的json字符串:{}'.format(str_ret)
)
ret_dict[SkyGlobalConst.RETKEY_DATAROWS] = dict_ret
except requests.exceptions.RequestException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except MyBaseException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except Exception as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
return ret_dict
def crd_ns_list_obj(self, str_k8s_ip_port: str = None, str_k8s_token: str = None, str_prefix_url: str = CRD_API,
str_crd_group_version: str = None,
str_crd_ns_url: str = K8S_NS, str_crd_ns_name: str = None, str_crd_obj: str = None,
dict_args: dict = None) -> dict:
'''
获取自定义集群的对象列表
Args:
str_k8s_ip_port: k8s 端口
str_k8s_token: k8s token
str_prefix_url: k8s api固定前缀路径 ,/apis
str_crd_ns_url: k8s 命名空间固定路径 ,/namespaces
str_crd_ns_name: k8s crd 集群命名空间 ,/csm
str_crd_group_version: k8s crd 组和版本 /networking.istio.io/v1alpha3
str_crd_obj: k8s crd 对象名称 /virtualservices
dict_args: 查询传递参数 {"dd":"dd"}
Returns: 返回对象字典
'''
url_args = ''
if dict_args is not None:
url_args = '?'
for tmp_k, tmp_v in dict_args.items():
if url_args == '?':
url_args = url_args + tmp_k + '=' + urllib.parse.quote(tmp_v)
else:
url_args = "&" + url_args + tmp_k + '=' + urllib.parse.quote(tmp_v)
str_url = GlobalConst.DEFAULT_URLSCHEMA_SECRUE + str_k8s_ip_port + str_prefix_url + str_crd_group_version + str_crd_ns_url + str_crd_ns_name + str_crd_obj + url_args
http_trans = HttpTrans(None)
arg_extra_dict_header = {HttpConst.HEADER_KEY_CONTENT_TYPE: HttpConst.CONTENT_TYPE_JSON
, HttpConst.AUTH_KEY: HttpConst.AUTH_BEARER_PREFIX + str_k8s_token
}
try:
m_response = http_trans.get_data(
urlstr=str_url,
trans_data=dict_args,
dict_header=arg_extra_dict_header
)
ret_dict = {}
if not m_response.ok:
raise create_base_exception(
'访问url出错,访问地址:{0},返回码{1}'.format(str_url + ":" + m_response.text, m_response.status_code)
)
else:
ret_dict[SkyGlobalConst.RETKEY_RET_CODE] = SkyGlobalConst.RETCODE_SUCESS_CODE
ret_dict[SkyGlobalConst.RETKEY_RET_VAL] = SkyGlobalConst.RETCODE_SUCESS_CODE
str_ret = m_response.text
dict_ret = MyUtils.jsonstr2json(m_response.text)
if dict_ret is None:
raise create_base_exception(
'返回的内容不是有效的json字符串:{}'.format(str_ret)
)
ret_dict[SkyGlobalConst.RETKEY_DATAROWS] = dict_ret
except requests.exceptions.RequestException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except MyBaseException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except Exception as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
return ret_dict
def crd_ns_create_obj(self, str_k8s_ip_port: str = None, str_k8s_token: str = None, str_prefix_url: str = CRD_API,
str_crd_group_version: str = None,
str_crd_ns_url: str = K8S_NS, str_crd_ns_name: str = None, str_crd_obj: str = None,
dict_args: dict = None) -> dict:
'''
创建自定义集群的对象列表
Args:
str_k8s_ip_port: k8s 端口
str_k8s_token: k8s token
str_prefix_url: k8s api固定前缀路径 ,/apis
str_crd_ns_url: k8s 命名空间固定路径 ,/namespaces
str_crd_ns_name: k8s crd 集群命名空间 ,/csm
str_crd_group_version: k8s crd 组和版本 /networking.istio.io/v1alpha3
str_crd_obj: k8s crd 对象名称 /virtualservices
dict_args: 查询传递参数 {"dd":"dd"}
Returns: 返回对象字典
'''
str_url = GlobalConst.DEFAULT_URLSCHEMA_SECRUE + str_k8s_ip_port + str_prefix_url + str_crd_group_version + str_crd_ns_url + str_crd_ns_name + str_crd_obj
http_trans = HttpTrans(None)
arg_extra_dict_header = {HttpConst.HEADER_KEY_CONTENT_TYPE: HttpConst.CONTENT_TYPE_JSON
, HttpConst.AUTH_KEY: HttpConst.AUTH_BEARER_PREFIX + str_k8s_token
}
try:
m_response = http_trans.post_encodeddata_standard(
urlstr=str_url,
trans_data=dict_args,
dict_header=arg_extra_dict_header
)
ret_dict = {}
if not m_response.ok:
raise create_base_exception(
'访问url出错,访问地址:{0},返回码{1}'.format(str_url + ":" + m_response.text, m_response.status_code)
)
else:
ret_dict[SkyGlobalConst.RETKEY_RET_CODE] = SkyGlobalConst.RETCODE_SUCESS_CODE
ret_dict[SkyGlobalConst.RETKEY_RET_VAL] = SkyGlobalConst.RETCODE_SUCESS_CODE
str_ret = m_response.text
dict_ret = MyUtils.jsonstr2json(m_response.text)
if dict_ret is None:
raise create_base_exception(
'返回的内容不是有效的json字符串:{}'.format(str_ret)
)
ret_dict[SkyGlobalConst.RETKEY_DATAROWS] = dict_ret
except requests.exceptions.RequestException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except MyBaseException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except Exception as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
return ret_dict
def crd_ns_patch_obj(self, str_k8s_ip_port: str = None, str_k8s_token: str = None, str_prefix_url: str = CRD_API,
str_crd_group_version: str = None,
str_crd_ns_url: str = K8S_NS, str_crd_ns_name: str = None, str_crd_obj: str = None,
str_crd_obj_name: str = None,
dict_args: dict = None) -> dict:
'''
更新自定义集群的对象列表
Args:
str_k8s_ip_port: k8s 端口
str_k8s_token: k8s token
str_prefix_url: k8s api固定前缀路径 ,/apis
str_crd_ns_url: k8s 命名空间固定路径 ,/namespaces
str_crd_ns_name: k8s crd 集群命名空间 ,/csm
str_crd_group_version: k8s crd 组和版本 /networking.istio.io/v1alpha3
str_crd_obj: k8s crd 对象名称 /virtualservices
str_crd_obj_name: k8s crd 对象实例名称 /wen-gateway
dict_args: 查询传递参数 {"dd":"dd"}
Returns: 返回对象字典
'''
str_url = GlobalConst.DEFAULT_URLSCHEMA_SECRUE + str_k8s_ip_port + str_prefix_url + str_crd_group_version + str_crd_ns_url + str_crd_ns_name + str_crd_obj + str_crd_obj_name
http_trans = HttpTrans(None)
arg_extra_dict_header = {HttpConst.HEADER_KEY_CONTENT_TYPE: HttpConst.CONTENT_TYPE_PATH_JSON
, HttpConst.AUTH_KEY: HttpConst.AUTH_BEARER_PREFIX + str_k8s_token
}
try:
m_response = http_trans.patch_encodeddata_standard(
urlstr=str_url,
trans_data=dict_args,
dict_header=arg_extra_dict_header
)
ret_dict = {}
if not m_response.ok:
raise create_base_exception(
'访问url出错,访问地址:{0},返回码{1}'.format(str_url + ":" + m_response.text, m_response.status_code)
)
else:
ret_dict[SkyGlobalConst.RETKEY_RET_CODE] = SkyGlobalConst.RETCODE_SUCESS_CODE
ret_dict[SkyGlobalConst.RETKEY_RET_VAL] = SkyGlobalConst.RETCODE_SUCESS_CODE
str_ret = m_response.text
dict_ret = MyUtils.jsonstr2json(m_response.text)
if dict_ret is None:
raise create_base_exception(
'返回的内容不是有效的json字符串:{}'.format(str_ret)
)
ret_dict[SkyGlobalConst.RETKEY_DATAROWS] = dict_ret
except requests.exceptions.RequestException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except MyBaseException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except Exception as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
return ret_dict
def crd_ns_get_obj(self, str_k8s_ip_port: str = None, str_k8s_token: str = None, str_prefix_url: str = CRD_API,
str_crd_group_version: str = None,
str_crd_ns_url: str = K8S_NS, str_crd_ns_name: str = None, str_crd_obj: str = None,
str_crd_obj_name: str = None,
dict_args: dict = None) -> dict:
'''
获取自定义集群的对象信息
Args:
str_k8s_ip_port: k8s 端口
str_k8s_token: k8s token
str_prefix_url: k8s api固定前缀路径 ,/apis
str_crd_ns_url: k8s 命名空间固定路径 ,/namespaces
str_crd_ns_name: k8s crd 集群命名空间 ,/csm
str_crd_group_version: k8s crd 组和版本 /networking.istio.io/v1alpha3
str_crd_obj: k8s crd 对象名称 /virtualservices
str_crd_obj_name: k8s crd 对象实例名称 /wen-gateway
dict_args: 查询传递参数 {"dd":"dd"}
Returns: 返回对象字典
'''
str_url = GlobalConst.DEFAULT_URLSCHEMA_SECRUE + str_k8s_ip_port + str_prefix_url + str_crd_group_version + str_crd_ns_url + str_crd_ns_name + str_crd_obj + str_crd_obj_name
http_trans = HttpTrans(None)
arg_extra_dict_header = {HttpConst.HEADER_KEY_CONTENT_TYPE: HttpConst.CONTENT_TYPE_PATH_JSON
, HttpConst.AUTH_KEY: HttpConst.AUTH_BEARER_PREFIX + str_k8s_token
}
try:
m_response = http_trans.get_data(
urlstr=str_url,
trans_data=dict_args,
dict_header=arg_extra_dict_header
)
ret_dict = {}
if not m_response.ok:
raise create_base_exception(
'访问url出错,访问地址:{0},返回码{1}'.format(str_url + ":" + m_response.text, m_response.status_code)
)
else:
ret_dict[SkyGlobalConst.RETKEY_RET_CODE] = SkyGlobalConst.RETCODE_SUCESS_CODE
ret_dict[SkyGlobalConst.RETKEY_RET_VAL] = SkyGlobalConst.RETCODE_SUCESS_CODE
str_ret = m_response.text
dict_ret = MyUtils.jsonstr2dict(m_response.text)
if dict_ret is None:
raise create_base_exception(
'返回的内容不是有效的json字符串:{}'.format(str_ret)
)
ret_dict[SkyGlobalConst.RETKEY_DATAROWS] = dict_ret
except requests.exceptions.RequestException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except MyBaseException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except Exception as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
return ret_dict
def crd_ns_delete_obj(self, str_k8s_ip_port: str = None, str_k8s_token: str = None, str_prefix_url: str = CRD_API,
str_crd_group_version: str = None,
str_crd_ns_url: str = K8S_NS, str_crd_ns_name: str = None, str_crd_obj: str = None,
str_crd_obj_name: str = None,
dict_args: dict = None) -> dict:
'''
删除自定义集群的对象信息
Args:
str_k8s_ip_port: k8s 端口
str_k8s_token: k8s token
str_prefix_url: k8s api固定前缀路径 ,/apis
str_crd_ns_url: k8s 命名空间固定路径 ,/namespaces
str_crd_ns_name: k8s crd 集群命名空间 ,/csm
str_crd_group_version: k8s crd 组和版本 /networking.istio.io/v1alpha3
str_crd_obj: k8s crd 对象名称 /virtualservices
str_crd_obj_name: k8s crd 对象实例名称 /wen-gateway
dict_args: 查询传递参数 {"dd":"dd"}
Returns: 返回对象字典
'''
str_url = GlobalConst.DEFAULT_URLSCHEMA_SECRUE + str_k8s_ip_port + str_prefix_url + str_crd_group_version + str_crd_ns_url + str_crd_ns_name + str_crd_obj + str_crd_obj_name
http_trans = HttpTrans(None)
arg_extra_dict_header = {HttpConst.HEADER_KEY_CONTENT_TYPE: HttpConst.CONTENT_TYPE_PATH_JSON
, HttpConst.AUTH_KEY: HttpConst.AUTH_BEARER_PREFIX + str_k8s_token
}
try:
m_response = http_trans.delete_encodeddata_standard(
urlstr=str_url,
trans_data=dict_args,
dict_header=arg_extra_dict_header
)
ret_dict = {}
if not m_response.ok:
raise create_base_exception(
'访问url出错,访问地址:{0},返回码{1}'.format(str_url + ":" + m_response.text, m_response.status_code)
)
else:
ret_dict[SkyGlobalConst.RETKEY_RET_CODE] = SkyGlobalConst.RETCODE_SUCESS_CODE
ret_dict[SkyGlobalConst.RETKEY_RET_VAL] = SkyGlobalConst.RETCODE_SUCESS_CODE
except requests.exceptions.RequestException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except MyBaseException as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
except Exception as exception:
return MyBaseException.format_exception_to_standard_dict(exception)
return ret_dict
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Version: 1.0
@Python Version:3.6.6
@Author: ludq1
@Email: ludq1@chinaunicom.cn
@date: 2023/04/07 11:40:00
@Description:
"""
import functools
import logging
from typing import List, Union
from flask import g, current_app, Flask
from .globalconst import GlobalConst
from .globalutility import Utility
from .my_baseexception import MyBaseException
from .my_stringutils import MyStringUtils
def get_current_app() -> Flask:
r'''
获取当前current_app
Returns:
'''
return current_app._get_current_object() # pylint: disable=protected-access
def get_app_logger() -> logging.Logger:
r'''
获取 current_app 的logger
Returns:
'''
return get_current_app().logger
def gen_userinfo(global_obj=None, redis_info: dict = None, key_userinfo: str = GlobalConst.G_KEY_USERINFO):
r'''
装饰器函数, 用于获取用户基本信息,角色信息,权限列表信息等
Args:
global_obj: 存储用户信息的全局变量,默认为 Flask.g
redis_info: 获取用户信息的 redis 信息 , 默认为使用环境变量读取指定配置文件的内容
key_userinfo: 存储用户信息时使用的key
Returns:
'''
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kw):
try:
# LONG_TODO 访问redis 获取用户信息
print(redis_info)
dict_userinfo: dict = None
setattr(global_obj, key_userinfo, dict_userinfo)
except Exception:
pass
return func(*args, **kw)
return wrapper
return decorator
def login_required(global_obj=None, key_userinfo: str = GlobalConst.G_KEY_USERINFO,
key_usersystem_in_userinfo: str = GlobalConst.G_USERINFO_KEY_USER_SYSTEM,
key_userid_in_userinfo: str = GlobalConst.G_USERINFO_KEY_USER_ID,
expected_usersystem: str = None,
retcode: str = GlobalConst.RETCODE_FOR_NOT_LOGIN,
retval: str = GlobalConst.RETVAL_FOR_NOT_LOGIN):
r'''
装饰器函数, 用户判断用户是否已经登陆
Args:
global_obj: 获取用户信息时使用的全局变量,默认为 Flask.g
key_userinfo: 获取用户信息时使用的key
key_usersystem_in_userinfo: 获取用户所属系统时使用的key
key_userid_in_userinfo: 获取用户id时使用的key
expected_usersystem: 期望的用户所属系统,默认为None, 此时用户信息中的用户系统为 None 或 default 时即匹配
retcode_for_not_login:
retval_for_not_login:
Returns:
'''
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kw):
# 加入一个环境变量, 用于更灵活的控制
if Utility.get_env(GlobalConst.ENV_LOGIN_REQUIRED) == '1':
# 从 g 中获取用户信息, 判断用户是否已经登陆
gg_used = global_obj or g
g_userinfo: dict = getattr(gg_used, key_userinfo, None)
if g_userinfo is None or not g_userinfo:
return MyBaseException.format_to_standard_dict(ret_code=retcode, ret_val=retval)
# 判断用户信息中的用户类型是否是期望的用户
default_usersystem = 'default'
g_usersystem = g_userinfo.get(key_usersystem_in_userinfo, default_usersystem)
m_expected_usersystem = expected_usersystem or default_usersystem
if not m_expected_usersystem == g_usersystem:
return MyBaseException.format_to_standard_dict(ret_code=retcode, ret_val=retval,
submitted_msg=Utility.join_str_with_none(
'已登陆的用户所属系统(', g_usersystem, ')不是期望值(',
m_expected_usersystem, ')'))
# 获取用户id不为空,确认用户登陆
g_userid = g_userinfo.get(key_userid_in_userinfo, None)
if MyStringUtils.is_empty(g_userid):
return MyBaseException.format_to_standard_dict(ret_code=retcode, ret_val=retval,
submitted_msg=Utility.join_str_with_none(
'已登陆的用户id为空'))
return func(*args, **kw)
return wrapper
return decorator
def permission_required(permissions: Union[List[Union[List, str]], str], global_obj=None,
key_userinfo: str = GlobalConst.G_KEY_USERINFO,
key_permission_in_userinfo: str = GlobalConst.G_USERINFO_KEY_PERMISSION,
retcode: str = GlobalConst.RETCODE_FOR_NO_PERMISSION,
retval: str = GlobalConst.RETVAL_FOR_NO_PERMISSION):
r'''
装饰器函数, 用户判断用户是否具备指定权限
Args:
global_obj: 获取用户信息时使用的全局变量,默认为 Flask.g
key_userinfo: 获取用户信息时使用的key
key_permission_in_userinfo: 获取用户权限时使用的key
permissions: 需要的权限或权限列表, 如果是字符串,则直接表示需要的权限,如果是列表,则表示列表中的任意权限满足即可,如果列表中的项还是列表(子列表),则子列表中的所有项都必须得到满足才认为该子项满足,同时该子项不能为空(为空认为无效)
retcode_for_not_login:
retval_for_not_login:
Returns:
'''
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kw):
# 加入一个环境变量, 用于更灵活的控制
if Utility.get_env(GlobalConst.ENV_PERMISSION_REQUIRED) == '1':
# 从 g 中获取用户信息, 判断用户是否是否具备指定权限
# 判断用户是否已经登陆
gg_used = global_obj or g
g_userinfo: dict = getattr(gg_used, key_userinfo, None)
if not g_userinfo:
return MyBaseException.format_to_standard_dict(ret_code=retcode,
ret_val=retval,
submitted_msg=GlobalConst.RETVAL_FOR_NOT_LOGIN)
# 获取用户权限列表
g_permissions: tuple = g_userinfo.get(key_permission_in_userinfo, None)
if not g_permissions:
return MyBaseException.format_to_standard_dict(ret_code=retcode,
ret_val=retval, submitted_msg='用户权限列表的key不存在')
bool_satisfied = False
if isinstance(permissions, str):
# 如果需求的权限是字符串
if permissions in g_permissions:
bool_satisfied = True
else:
# 如果需求的权限不是字符串,则进行迭代遍历, 有一项满足即认为是满足
for tmp_required_content in permissions:
if isinstance(tmp_required_content, str):
# 如果迭代项是字符串, 有一项满足,即认为满足
if tmp_required_content in g_permissions:
bool_satisfied = True
break
else:
# 如果迭代项不是字符串, 则进行迭代遍历, 此时必须满足所有项才认为是满足
# 同时要求的权限不能为空
if tmp_required_content:
tmp_bool_satified = True
for tmp_tmp_required_content in tmp_required_content:
if not tmp_tmp_required_content in g_permissions:
tmp_bool_satified = False
break
if tmp_bool_satified:
bool_satisfied = True
break
if not bool_satisfied:
return MyBaseException.format_to_standard_dict(ret_code=retcode,
ret_val=retval,
submitted_msg=Utility.join_str('用户缺少权限',
permissions))
return func(*args, **kw)
return wrapper
return decorator
def role_required(roleids: Union[List[str], str], global_obj=None, key_userinfo: str = GlobalConst.G_KEY_USERINFO,
key_role_in_userinfo: str = GlobalConst.G_USERINFO_KEY_USERROLE,
retcode: str = GlobalConst.RETCODE_FOR_MISS_ROLE,
retval: str = GlobalConst.RETVAL_FOR_MISS_ROLE):
r'''
装饰器函数, 用户判断用户是否具备指定角色
Args:
global_obj: 获取用户信息时使用的全局变量,默认为 Flask.g
key_userinfo: 获取用户信息时使用的key
key_role_in_userinfo: 获取用户权限时使用的key
roleids: 需要的角色或角色列表, 如果是字符串,则直接表示需要的权限,如果是列表,则表示列表中的任意权限满足即可,如果列表中的项还是列表(子列表),则子列表中的所有项都必须得到满足该子项才算作是满足,同时该子项不能为空(为空认为无效)
retcode_for_not_login:
retval_for_not_login:
Returns:
'''
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kw):
# 加入一个环境变量, 用于更灵活的控制
if Utility.get_env(GlobalConst.ENV_ROLE_REQUIRED) == '1':
# 从 g 中获取用户信息, 判断用户是否是否具备指定角色
# 判断用户是否已经登陆
gg_used = global_obj or g
g_userinfo: dict = getattr(gg_used, key_userinfo, None)
if not g_userinfo:
return MyBaseException.format_to_standard_dict(ret_code=retcode,
ret_val=retval,
submitted_msg=GlobalConst.RETVAL_FOR_NOT_LOGIN)
# 获取用户权限列表
g_roles: tuple = g_userinfo.get(key_role_in_userinfo, None)
if not g_roles:
return MyBaseException.format_to_standard_dict(ret_code=retcode,
ret_val=retval, submitted_msg='用户角色列表的key不存在')
bool_satisfied = False
if isinstance(roleids, str):
# 如果需求的权限是字符串
if roleids in g_roles:
bool_satisfied = True
else:
# 如果需求的权限不是字符串,则进行迭代遍历, 有一项满足即认为是满足
for tmp_required_content in roleids:
if isinstance(tmp_required_content, str):
# 如果迭代项是字符串, 有一项满足,即认为满足
if tmp_required_content in g_roles:
bool_satisfied = True
break
else:
# 如果迭代项不是字符串, 则进行迭代遍历, 此时必须满足所有项才认为是满足
# 同时要求的权限不能为空
if tmp_required_content:
tmp_bool_satified = True
for tmp_tmp_required_content in tmp_required_content:
if not tmp_tmp_required_content in g_roles:
tmp_bool_satified = False
break
if tmp_bool_satified:
bool_satisfied = True
break
if not bool_satisfied:
return MyBaseException.format_to_standard_dict(ret_code=retcode,
ret_val=retval,
submitted_msg=Utility.join_str('用户缺少角色',
roleids))
return func(*args, **kw)
return wrapper
return decorator
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Version: 1.0
@Python Version:3.6.6
@Author: ludq1
@Email: ludq1@chinaunicom.cn
@date: 2023/04/07 11:40:00
@Description:
"""
class EnvNameConst:
r"""
环境变量名称常量
"""
ENV_LOGIN_REQUIRED = 'ENV_LOGIN_REQUIRED'
ENV_PERMISSION_REQUIRED = 'ENV_PERMISSION_REQUIRED'
ENV_ROLE_REQUIRED = 'ENV_ROLE_REQUIRED'
ENV_DONT_OVERRITE_USERINFO_FROM_FRANT = "DontOverrideUserInfoFromFront"
ENV_LOCAL_RUN = "LOCAL_RUN"
ENV_MYSQLPOOL_SERVICE = "MYSQLPOOL_SERVICE"
class UserInfoKeyConst:
r"""
缓存中用户信息的key
"""
G_USERINFO = 'userinfo'
PERMISSION = 'permissions'
USERROLE = 'roles'
USER_SYSTEM = 'usersystem'
TENANT_ID = 'tenantid'
USER_ID = 'userid'
USER_NAME = 'username'
DEPT_NAME_SHORT = 'dept_name'
DEPT_NAME_FULL = 'deptname'
DEPT_ID = 'dept_id'
OU_ID = 'OUID'
OU_NAME = 'OU'
EMAIL = 'email'
class GlobalReqKeyConst:
r"""
全局的Http请求key常量
"""
TRANSJSONARRAY = "transjsonarray"
TRANSSQL = "transsql"
SQL = "sql"
PROCEDURENAME = "procedurename"
CONDITIONEXEC = "conditionexec"
QUERYSTR = "querystr"
CHECKCONTENT = "checkcontent"
COLUMNNAME = "columnname"
COLUMNTYPE = "columntype"
CHECKTYPE = "checktype"
COMPAREVALUE = "comparevalue"
CHECKTIPS = "checktips"
EXECTYPE = "exectype"
EXECKEYWHENTRUE = "execkeywhensuccess"
EXECKEYWHENFALSE = "execkeywhenfalse"
COLUMNTYPE_STRING = "string"
COLUMNTYPE_INT = "int"
COLUMNTYPE_LONG = "long"
COLUMNTYPE_DOUBLE = "double"
COLUMNTYPE_DATE = "date"
CHECKTYPE_EQ = "eq"
CHECKTYPE_REGEQ = "regeq"
CHECKTYPE_NOTEQ = "noteq"
CHECKTYPE_REGNOTEQ = "regnoteq"
CHECKTYPE_GT = "gt"
CHECKTYPE_GE = "ge"
CHECKTYPE_LT = "lt"
CHECKTYPE_LE = "le"
EXECTYPE_ROLLBACK = "rollback"
EXECTYPE_COMMIT = "commit"
EXECTYPE_CONTINUE = "continue"
EXECTYPE_BRANCH = "branch"
class GlobalRetKeyConst:
r"""
全局的Http请求返回的json的key常量
"""
RET_CODE = "RetCode"
RET_VAL = "RetVal"
SUBMITTEDWEBARG = "SubmittedWebArg"
DATAROWS = "DataRows"
ROWCOUNT = "RowCount"
PAGECOUNT = "PageCount"
class SkyGlobalRetKeyConst:
r"""
天宫全局的Http请求返回的json的key常量
"""
RET_CODE = "code"
RET_VAL = "message"
SUBMITTEDWEBARG = "SubmittedWebArg"
DATAROWS = "data"
ROWCOUNT = "RowCount"
PAGECOUNT = "PageCount"
class GlobalConst:
"""
全局常量类
"""
RETKEY_RET_CODE = GlobalRetKeyConst.RET_CODE
RETKEY_RET_VAL = GlobalRetKeyConst.RET_VAL
RETKEY_SUBMITTEDWEBARG = GlobalRetKeyConst.SUBMITTEDWEBARG
RETCODE_COMMON_ERROR = "0"
RETCODE_SUCESS_CODE = "1"
RETKEY_DATAROWS = GlobalRetKeyConst.DATAROWS
RETKEY_ROWCOUNT = GlobalRetKeyConst.ROWCOUNT
RETKEY_PAGECOUNT = GlobalRetKeyConst.PAGECOUNT
RETCODE_FOR_NOT_LOGIN = '10000'
RETVAL_FOR_NOT_LOGIN = '用户未登录'
RETCODE_FOR_NO_PERMISSION = '10001'
RETVAL_FOR_NO_PERMISSION = '权限不足'
RETCODE_FOR_MISS_ROLE = '10002'
RETVAL_FOR_MISS_ROLE = '缺少角色'
G_KEY_USERINFO = UserInfoKeyConst.G_USERINFO
G_USERINFO_KEY_USER_SYSTEM = UserInfoKeyConst.USER_SYSTEM
G_USERINFO_KEY_USER_ID = UserInfoKeyConst.USER_ID
G_USERINFO_KEY_PERMISSION = UserInfoKeyConst.PERMISSION
G_USERINFO_KEY_USERROLE = UserInfoKeyConst.USERROLE
ENV_LOGIN_REQUIRED = EnvNameConst.ENV_LOGIN_REQUIRED
ENV_PERMISSION_REQUIRED = EnvNameConst.ENV_PERMISSION_REQUIRED
ENV_ROLE_REQUIRED = EnvNameConst.ENV_ROLE_REQUIRED
CHARACTERENCODING_UTF8 = "UTF-8"
DEFAULTCONFIG_CHARACTERENCODING = CHARACTERENCODING_UTF8
DEFAULTCONFIG_CONTENTTYPE = "text/html;charset=utf-8"
DEFAULT_URLSCHEMA = "http://"
DEFAULT_URLSCHEMA_SECRUE = "https://"
RUNTIMEENV_PROD = "prod"
RUNTIMEENV_UAT = "uat"
RUNTIMEENV_DEV = "dev"
class SkyGlobalConst:
"""
全局常量类
"""
RETKEY_RET_CODE = SkyGlobalRetKeyConst.RET_CODE
RETKEY_RET_VAL = SkyGlobalRetKeyConst.RET_VAL
RETKEY_SUBMITTEDWEBARG = SkyGlobalRetKeyConst.SUBMITTEDWEBARG
RETCODE_COMMON_ERROR = "ERROR"
RETCODE_SUCESS_CODE = "OK"
RETKEY_DATAROWS = SkyGlobalRetKeyConst.DATAROWS
RETKEY_ROWCOUNT = SkyGlobalRetKeyConst.ROWCOUNT
RETKEY_PAGECOUNT = SkyGlobalRetKeyConst.PAGECOUNT
RETCODE_FOR_NOT_LOGIN = '10000'
RETVAL_FOR_NOT_LOGIN = '用户未登录'
RETCODE_FOR_NO_PERMISSION = '10001'
RETVAL_FOR_NO_PERMISSION = '权限不足'
RETCODE_FOR_MISS_ROLE = '10002'
RETVAL_FOR_MISS_ROLE = '缺少角色'
G_KEY_USERINFO = UserInfoKeyConst.G_USERINFO
G_USERINFO_KEY_USER_SYSTEM = UserInfoKeyConst.USER_SYSTEM
G_USERINFO_KEY_USER_ID = UserInfoKeyConst.USER_ID
G_USERINFO_KEY_PERMISSION = UserInfoKeyConst.PERMISSION
G_USERINFO_KEY_USERROLE = UserInfoKeyConst.USERROLE
ENV_LOGIN_REQUIRED = EnvNameConst.ENV_LOGIN_REQUIRED
ENV_PERMISSION_REQUIRED = EnvNameConst.ENV_PERMISSION_REQUIRED
ENV_ROLE_REQUIRED = EnvNameConst.ENV_ROLE_REQUIRED
CHARACTERENCODING_UTF8 = "UTF-8"
DEFAULTCONFIG_CHARACTERENCODING = CHARACTERENCODING_UTF8
DEFAULTCONFIG_CONTENTTYPE = "text/html;charset=utf-8"
DEFAULT_URLSCHEMA = "http://"
DEFAULT_URLSCHEMA_SECRUE = "https://"
RUNTIMEENV_PROD = "prod"
RUNTIMEENV_UAT = "uat"
RUNTIMEENV_DEV = "dev"
class HttpConst:
"""
http 常量
"""
HEADER_KEY_REQUEST_METHOD = "Request Method"
HEADER_KEY_CONTENT_TYPE = "Content-Type"
HEADER_KEY_COOKIE = "Cookie"
REQUEST_METHOD_GET = "GET"
REQUEST_METHOD_POST = "POST"
CONTENT_TYPE_URLENCODED = "application/x-www-form-urlencoded"
CONTENT_TYPE_JSON = "application/json"
CONTENT_TYPE_PATH_JSON = "application/merge-patch+json"
AUTH_KEY = "Authorization"
AUTH_BEARER_PREFIX = "Bearer "
HEADERKEY_ACCESS_CONTROL_ALLOW_ORIGIN = "Access-Control-Allow-Origin"
class RedisInfoKeysConst:
"""
redis 信息格式key
"""
REDIS_MASTER_KEY = "redis_master"
REDIS_SLAVE_KEY = "redis_slave"
class RedisConnEnvConst:
"""
redis 环境变量
"""
CONN_MR_IP = "REDIS_MR_CONN_IP"
CONN_MR_PORT = "REDIS_MR_PORT"
CONN_MR_AUTH = "REDIS_MR_AUTH"
CONN_MR_DB = "REDIS_MR_DB_INDEX"
CONN_SL_IP = "REDIS_SL_CONN_IP"
CONN_SL_PORT = "REDIS_SL_PORT"
CONN_SL_AUTH = "REDIS_SL_AUTH"
CONN_SL_DB = "REDIS_SL_DB_INDEX"
class RedisConnConst:
"""
redis 常量
"""
CONN_IP = "conn_ip"
CONN_PORT = "conn_port"
CONN_AUTH = "conn_auth"
CONN_DB = "conn_db"
class RedisSentinelConnEnvConst:
"""
redis哨兵 环境变量
"""
CONN_IP = "REDIS_SENTINEL_CONN_IP"
CONN_PORT = "REDIS_SENTINEL_PORT"
CONN_AUTH = "REDIS_SENTINEL_AUTH"
CONN_DB = "REDIS_SENTINEL_DB_INDEX"
class RedisSentinelConnConst:
"""
redis 常量
"""
CONN_IP = "conn_ip"
CONN_PORT = "conn_port"
CONN_CLUSTERNAME = "conn_clustername"
CONN_HOSTS = "conn_hosts"
class RedisConst:
"""
Redis常量
"""
# 最大周期
EXPIRE_TIME = "expire_time"
class RedisDbNumConst:
"""
Redis库分布
"""
# 验证码
ID_INFO = "9"
# 登录信息
LOGIN_INFO = "10"
class DateTimeConst:
r"""
日期常量类
"""
ALL_DATEFORMAT_PATTERNS = [
'%Y/%m/%d %H:%M:%S.%f',
'%Y-%m-%d %H:%M:%S.%f',
'%Y/%m/%d %H:%M:%S',
'%Y-%m-%d %H:%M:%S',
'%Y/%m/%d',
'%Y-%m-%d',
'%Y-%m-%dT%H:%M:%SZ'
]
COMMON_DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S'
RFC3339_DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
COMMON_DATE_FORMAT = '%Y-%m-%d'
class RegexPatternConst:
r"""
正则表达式常量类
"""
URL_PATTERN = '^(https?):\\/\\/([\\w-]+(\\.[\\w-]+)*\\/?)+(\\?([\\w\\-\\.,@?^=%&:\\/~\\+#]*)+)?$'
class FlaskConfigIDConst:
r"""
flask 全局config id
"""
# InitFlaskInfo 在flask配置信息的唯一标识ID
FLASK_INIT = "chinaunicom.flask.init."
# 初始化信息
INIT_CONFIG_ID = FLASK_INIT + "cfg.handle.id"
# redis 类 id
REDIS_CLASS_ID = FLASK_INIT + "redis.handle.id"
class CookiesConstKey:
r"""
业务需要用的关键的key
"""
# CSM登录标识
LOGIN_SESSTION_KEY = "CSMSESSTIONID"
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Version: 1.0
@Python Version:3.6.6
@Author: ludq1
@Email: ludq1@chinaunicom.cn
@date: 2023/04/07 11:40:00
@Description:
"""
class HttpError:
"""
http错误信息
"""
ENV_LOGIN_REQUIRED = 'ENV_LOGIN_REQUIRED'
ENV_PERMISSION_REQUIRED = 'ENV_PERMISSION_REQUIRED'
ENV_ROLE_REQUIRED = 'ENV_ROLE_REQUIRED'
ENV_DONT_OVERRITE_USERINFO_FROM_FRANT = "DontOverrideUserInfoFromFront"
ENV_LOCAL_RUN = "LOCAL_RUN"
ENV_MYSQLPOOL_SERVICE = "MYSQLPOOL_SERVICE"
class RedisError:
"""
redis错误信息
"""
ERROR_INIT_CONN = '缺少初始化连接参数'
ERROR_LACK_CONN_PARM = '缺少连接参数'
ERROR_AUTH = '密码错误'
ERROR_CONN = '连接异常'
ERROR_CONN_POOL_NONE = '连接池为空'
ERROR_SENTI_MASTER_NOT_FOUND = '主节点未找到'
ERROR_SENTI_SLAVE_NOT_FOUND = '从节点未找到'
ERROR_INSERT_VALUE_TYPE = '插入值非字符串'
class CommonError:
"""
常用错误
"""
ERROR_LACK_PARM = '缺少参数'
ERROR_USER_UNLOGIN = '用户未登录,请先登录'
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Version: 1.0
@Python Version:3.6.6
@Author: ludq1
@Email: ludq1@chinaunicom.cn
@date: 2023/04/07 11:40:00
@Description:
"""
import logging
import re
import uuid
from datetime import datetime
from functools import reduce
from typing import Union, Optional
import urllib3
from urllib3.util import Url
from .globalconst import GlobalConst, DateTimeConst, RegexPatternConst
from .my_baseexception import create_base_exception
from .my_stringutils import MyStringUtils
from .my_utils import MyUtils
class Utility:
"""
全局工具类
"""
@classmethod
def gen_new_domain_from_csm_domain(
cls,
csm_domain: str,
replace_csm_console_to: str,
csm_console: str = "csm.console",
) -> str:
r"""
根据 https://csm.console.tg.unicom.local/csm-microsrv 地址,
将 csm.console 替换成指定内容, 生成类似 https://cke.console.tg.unicom.local 的地址
:param csm_domain: 示例 https://csm.console.tg.unicom.local/csm-microsrv
:param replace_csm_console_to: 示例 cke.console
:param csm_console: 为了扩展该方法, 可以将其他域名进行替换, 该参数默认值为 csm.console
"""
if not csm_domain:
return ""
parse_result: Url = urllib3.util.parse_url(csm_domain)
scheme = parse_result.scheme
host: str = parse_result.host
port = parse_result.port
host = host.replace(csm_console, replace_csm_console_to)
if port is not None:
result = f"{scheme}://{host}:{port}"
else:
result = f"{scheme}://{host}"
return result
@classmethod
def dict2jsonstr(cls, a_dict: dict, value_when_obj_is_none: str = 'null') -> str:
r"""
将dict转成jsonstr
Args:
a_dict: 待转成json字符串的 dict
value_when_obj_is_none: 当 a_dict 为 None 时返回的字符串,默认为null
Returns:
"""
return MyUtils.dict2jsonstr(a_dict, value_when_obj_is_none)
@classmethod
def list2jsonstr(cls, a_list: Union[list, tuple], value_when_obj_is_none: str = 'null') -> str:
r"""
将list or tuple 转成jsonstr
Args:
a_list: 待转成json字符串的 list or tuple
value_when_obj_is_none: 当 a_list 为 None 时返回的字符串,默认为null
Returns:
"""
return MyUtils.list2jsonstr(a_list, value_when_obj_is_none)
@classmethod
def jsonstr2dict(cls, a_jsonstr: str, b_raise_error_when_illegal: bool = False) -> dict:
r"""
将 jsonstr 转成 dict
Args:
a_jsonstr: json格式的字符串
b_raise_error_when_illegal: 当字符串不合法时抛出异常还是返回None
Returns:
"""
return MyUtils.jsonstr2dict(a_jsonstr, b_raise_error_when_illegal)
@classmethod
def jsonstr2list(cls, a_jsonarrstr: str, b_raise_error_when_illegal: bool = False) -> list:
r"""
将 jsonstr 转成 list
Args:
a_jsonarrstr: jsonarr格式的字符串
b_raise_error_when_illegal: 当字符串不合法时抛出异常还是返回None
Returns:
"""
return MyUtils.jsonstr2list(a_jsonarrstr, b_raise_error_when_illegal)
@classmethod
def format_result(cls, ret_val: str, ret_code: str) -> str:
r"""
将ret_val和ret_code格式化成 ryy项目组使用的标准json 字符串,
即 { "RetCode": ret_code , "RetVal": ret_val }
Args:
ret_val:string 返回结果
ret_code:string 返回码
Returns: json 返回json数据
"""
dict_ret = {
GlobalConst.RETKEY_RET_VAL: ret_val,
GlobalConst.RETKEY_RET_CODE: ret_code
}
return cls.dict2jsonstr(dict_ret)
@classmethod
def format_error(cls, ret_val: str, ret_code: str = GlobalConst.RETCODE_COMMON_ERROR) -> str:
r"""
格式化错误信息
Args:
ret_val: string 输出结果
ret_code:string 返回码
Returns: json 返回错误结果
"""
return cls.format_result(ret_val, ret_code)
@classmethod
def format_success(cls, ret_val: str, ret_code: str = GlobalConst.RETCODE_SUCESS_CODE) -> str:
r"""
格式化错误信息
Args:
ret_val: string
ret_code:string 返回码
Returns: json 返回正确结果
"""
return cls.format_result(ret_val, ret_code)
@classmethod
def do_filter_xss(cls, to_filter_str: str) -> str:
r"""
防xss处理,将 < 替换成#《#,将 > 替换成 #》#
Args:
to_filter_str: string
Returns:
"""
return MyUtils.do_filter_xss(to_filter_str)
@classmethod
def now_day(cls, a_date: datetime = None, format_str: str = None) -> str:
r"""
以 %Y-%m-%d 格式化日期,默认为当前日期,时间为当前时区的时间字符串
Args:
a_date:
format_str:
Returns:
"""
if a_date is None:
a_date = datetime.now()
return cls.format_date(a_date, format_str or DateTimeConst.COMMON_DATE_FORMAT)
@classmethod
def now_daytime(cls, a_date: datetime = None, format_str: str = None) -> str:
r"""
以 %Y-%m-%d %H:%M:%S 格式化日期,默认为当前日期,时间为当前时区的时间字符串
Args:
a_date:
format_str:
Returns:
"""
if a_date is None:
a_date = datetime.now()
return cls.format_date(a_date, format_str or DateTimeConst.COMMON_DATETIME_FORMAT)
@classmethod
def now_daytime_utc(cls, a_date: datetime = None, format_str: str = None) -> str:
r"""
以 %Y-%m-%dT%H:%M:%SZ 格式化日期,默认为 datetime.utcnow(),,时间为标准时区的时间字符串
Args:
a_date:
format_str:
Returns:
"""
if a_date is None:
a_date = datetime.utcnow()
return cls.format_date(a_date, format_str or DateTimeConst.RFC3339_DATETIME_FORMAT)
@classmethod
def format_date_to_utc(cls, a_date: datetime, format_str: str = None) -> str:
r"""
以 %Y-%m-%d %H:%M:%S 格式化日期,默认为当前日期,格式化后的字符串不会转换时区
Args:
a_date:
format_str:
Returns:
"""
if not isinstance(a_date, datetime):
raise ValueError("a_date 不是日期类型")
return a_date.strftime(format_str or DateTimeConst.RFC3339_DATETIME_FORMAT)
@classmethod
def format_date(cls, a_date: datetime, format_str: str = None) -> str:
r"""
以 %Y-%m-%d %H:%M:%S 格式化日期,默认为当前日期,格式化后的字符串不会转换时区
Args:
a_date:
format_str:
Returns:
"""
if not isinstance(a_date, datetime):
raise ValueError("a_date 不是日期类型")
return a_date.strftime(format_str or DateTimeConst.COMMON_DATETIME_FORMAT)
@classmethod
def parse_datestr(cls, a_datestr: str, pattern_str: str = None) -> Optional[datetime]:
r"""
解析日期字符串为日期, 解析失败返回None,解析的时间是当前时区的时间,
如果要转换时区,请使用以下语句,先进行时区替换
create_time = create_time.replace(tzinfo=pytz.timezone("UTC")).astimezone(pytz.timezone("Asia/Shanghai"))
Args:
a_datestr: 自动对 a_datestr 进行trim 操作
pattern_str:
Returns:
"""
# 判断字符串是否是 blank,无需解析的情况
if isinstance(a_datestr, datetime):
return a_datestr
if MyStringUtils.is_empty(a_datestr, trim=True):
return None
# 强制转成字符串
a_datestr = MyStringUtils.to_str(a_datestr, trim=True)
# 尝试使用提供的 pattern 解析字符串
if not MyStringUtils.is_empty(pattern_str, trim=True):
try:
return datetime.strptime(a_datestr, MyStringUtils.to_str(pattern_str))
except Exception:
pass
for tmp_pattern in DateTimeConst.ALL_DATEFORMAT_PATTERNS:
try:
return datetime.strptime(a_datestr, tmp_pattern)
except Exception:
pass
return None
@classmethod
def check_param_equal(cls, to_check_param: str, base_value: str, err_msg: str) -> None:
r"""
检查 to_check_param 和 base_value 是否相等,不相等则抛出异常
Args:
to_check_param:
base_value:
err_msg:
Returns:
"""
if not MyStringUtils.equals(to_check_param, base_value):
raise create_base_exception('参数检查错误:{}'.format(err_msg))
@classmethod
def check_param_bool(cls, to_check_param: bool, err_msg: str) -> None:
r"""
检查 to_check_param 是否为true,否则抛出异常
Args:
to_check_param:
err_msg:
Returns:
"""
if bool is None or not isinstance(to_check_param, bool):
raise create_base_exception('参数检查错误(参数类型不是bool):{}'.format(err_msg))
if not to_check_param:
raise create_base_exception('参数检查错误:{}'.format(err_msg))
@classmethod
def check_param_none_or_empty(cls, to_check_param: str, err_msg: str, trim: bool = False) -> None:
r"""
检查 to_check_param 是否为true,否则抛出异常
Args:
to_check_param:
err_msg:
trim:
Returns:
"""
if MyStringUtils.is_empty(MyStringUtils.to_str(to_check_param), trim=trim):
raise create_base_exception('参数检查错误:{}'.format(err_msg))
@classmethod
def check_param_jsonstr(cls, to_check_param: str, err_msg: str) -> dict:
r"""
检查 to_check_param 是否是json格式的字符串,不是则抛出异常 , 是则返回dict
Args:
to_check_param:
err_msg:
Returns:
"""
a_dict = cls.jsonstr2dict(to_check_param)
if a_dict is None:
raise create_base_exception('参数检查错误:{}'.format(err_msg))
else:
return a_dict
@classmethod
def do_filter_mysql_param(cls, to_filter_param: str, append_fix: str = "'") -> Optional[str]:
r"""
mysql防注入使用,用于过滤(替换)拼接字符串中的参数,当拼接`key`='value'时,对value中的特殊字符进行替换
Args:
to_filter_param:
append_fix:
Returns:
"""
if to_filter_param is None:
return None
if isinstance(to_filter_param, int):
to_filter_param = f"{to_filter_param}"
elif isinstance(to_filter_param, dict):
to_filter_param = MyUtils.dict2jsonstr(to_filter_param)
elif isinstance(to_filter_param, list):
to_filter_param = MyUtils.list2jsonstr(to_filter_param)
elif hasattr(to_filter_param, "to_dict"):
to_filter_param = MyUtils.dict2jsonstr(to_filter_param.to_dict())
elif not isinstance(to_filter_param, str):
raise create_base_exception(f'精确参数to_filter_param 不是字符串/数字/字典/列表/to_dict对象')
elif not isinstance(append_fix, str):
raise create_base_exception('append_fix 不是字符串')
if not MyStringUtils.is_empty(to_filter_param):
to_filter_param = to_filter_param.replace("\\", "\\\\").replace("'", "\\'")
return '{0}{1}{0}'.format(append_fix, to_filter_param)
@classmethod
def do_filter_mysql_field(cls, to_filter_field: str, append_fix: str = "`") -> Optional[str]:
r"""
sql防注入使用,用于过滤(替换)拼接字符串中的参数,当拼接`key`='value'时,对key中的特殊字符进行替换
Args:
to_filter_field:
append_fix: 默认为 `
Returns:
"""
if to_filter_field is None or to_filter_field == '':
return to_filter_field
if not isinstance(to_filter_field, str):
raise create_base_exception('to_filter_field 不是字符串')
elif not isinstance(append_fix, str):
raise create_base_exception('append_fix 不是字符串')
to_filter_field = to_filter_field.replace("\\", "\\\\")
to_filter_field = to_filter_field.replace(append_fix, f"\\{append_fix}")
return '{0}{1}{0}'.format(append_fix, to_filter_field)
@classmethod
def do_filter_mysql_param_with_single_quotes_for_fuzzy_search(
cls, to_filter_param: str, append_fix: str = "'"
) -> Optional[str]:
r"""
mysql防注入使用,用于过滤(替换)拼接字符串中的参数,当拼接`key`='value'时,对value中的特殊字符进行替换
Args:
to_filter_param:
append_fix: 默认为 '
Returns:
"""
if to_filter_param is None:
return to_filter_param
if not isinstance(to_filter_param, str):
raise ValueError('模糊参数to_filter_param 不是字符串')
elif not isinstance(append_fix, str):
raise ValueError('append_fix 不是字符串')
if MyStringUtils.is_empty(to_filter_param):
return '{0}{1}{0}'.format(append_fix, '%')
else:
to_filter_param = to_filter_param.replace("\\", "\\\\")
to_filter_param = to_filter_param.replace("%", "\\%")
to_filter_param = to_filter_param.replace("_", "\\_")
to_filter_param = to_filter_param.replace(append_fix, f"\\{append_fix}")
return '{0}{1}{2}{1}{0}'.format(append_fix, '%', to_filter_param)
@classmethod
def is_hasxss(cls, to_check_str: str) -> str:
r"""
检查 是否包含 script label strictscript encodestrictscript 标签
Args:
to_check_str:
Returns: 返回EMPTY 表示没有xss,其他内容为错误信息
"""
to_check_str = MyStringUtils.to_str(to_check_str)
if MyStringUtils.is_empty(to_check_str):
return MyStringUtils.EMPTY
# 定义要匹配的正则表达式
match_dict = {
'script': '.*<\\s*script\\s*>.*</\\s*script\\s*>.*',
'label': '.*<\\s*.*\\s*>.*</\\s*.*\\s*>.*',
'strictscript': '.*<\\s*.*=.*\\s*>.*',
'encodestrictscript': '.*%3C\\s*.*%3D.*\\s*%3B.*'
}
for tmp_k, tmp_v in match_dict.items():
tmp_pattern = re.compile(tmp_v, re.S | re.I)
if re.search(tmp_pattern, to_check_str):
return '存在违规数据:{}'.format(tmp_k)
return MyStringUtils.EMPTY
@classmethod
def list_join_to_str(cls, to_join_list: Union[list, tuple], separator_str: str = ',', wrapper_str: str = None,
ignore_none: bool = True) -> str:
r"""
连接 list,使用 separator_str ,当值为 None 时可以忽略,也可以当做 null字符串 添加,但是不追加 wrapper_str
Args:
to_join_list:
separator_str: 默认使用逗号
wrapper_str:
ignore_none:
Returns:
"""
if to_join_list is None:
return MyStringUtils.EMPTY
if not isinstance(to_join_list, (list, tuple)):
raise ValueError("要连接的对象不是list或tuple")
if not to_join_list:
return MyStringUtils.EMPTY
if wrapper_str is None:
wrapper_str = MyStringUtils.EMPTY
if separator_str is None:
separator_str = ","
separator_str = MyStringUtils.to_str(separator_str)
wrapper_str = MyStringUtils.to_str(wrapper_str)
def map_wrap_str(a_str):
if a_str is None:
return a_str
else:
return '{0}{1}{0}'.format(wrapper_str, a_str)
tmp_r = map(map_wrap_str, to_join_list)
def reduce_join_str(a_str, b_str) -> Optional[str]:
if ignore_none and (a_str is None or b_str is None):
return a_str or b_str
else:
if a_str is None:
a_str = 'null'
if b_str is None:
b_str = 'null'
return '{0}{2}{1}'.format(a_str, b_str, separator_str)
return reduce(reduce_join_str, tmp_r)
@classmethod
def join_str(cls, *to_join_list: str, separator_str: str = '', wrapper_str: str = None,
ignore_none: bool = True) -> str:
r"""
连接 list,使用 separator_str ,当值为 None 时可以忽略,也可以当做 null字符串 添加,但是不追加 wrapper_str
Args:
to_join_list:
separator_str: 默认使用空字符串
wrapper_str:
ignore_none:默认为True
Returns:
"""
return cls.list_join_to_str(to_join_list, separator_str=separator_str, wrapper_str=wrapper_str,
ignore_none=ignore_none)
@classmethod
def join_str_with_none(cls, *to_join_list: str, separator_str: str = '', wrapper_str: str = None,
ignore_none: bool = False) -> str:
r"""
连接 list,使用 separator_str ,当值为 None 时可以忽略,也可以当做 null字符串 添加,但是不追加 wrapper_str
Args:
to_join_list:
separator_str: 默认使用空字符串
wrapper_str:
ignore_none: 默认为False
Returns:
"""
return cls.list_join_to_str(to_join_list, separator_str=separator_str, wrapper_str=wrapper_str,
ignore_none=ignore_none)
@classmethod
def create_uuid(cls, with_dash: bool = False) -> str:
r"""
生成随机字符串,例如"bc520134-cffc-46f4-8e47-7313b3b2485b" ,
默认没有 - 字符
Args:
with_dash:
Returns:
"""
if with_dash:
return MyStringUtils.to_str(uuid.uuid1())
else:
return MyStringUtils.to_str(uuid.uuid1()).replace('-', MyStringUtils.EMPTY)
@classmethod
def check_url_illegal(cls, url_str: str) -> bool:
r"""
判断URL是否合法 判断依据是网址以http://开头,不能以/结尾,至少有一个小数点 <br/>
返回 true=成功 false=失败<br>
判断前会进行trim
Args:
url_str:
Returns:
"""
url_str = MyStringUtils.to_str(url_str, trim=True)
if MyStringUtils.is_empty(url_str):
return False
tmp_pattern = re.compile(RegexPatternConst.URL_PATTERN)
if re.match(tmp_pattern, url_str):
return True
else:
return False
@classmethod
def filter_utf8mb4(cls, to_filter_str: str) -> Optional[str]:
r"""
过滤字符串中的 4字节字符
Args:
to_filter_str:
Returns:
"""
if to_filter_str is None:
return to_filter_str
if MyStringUtils.is_empty(to_filter_str):
return MyStringUtils.EMPTY
def reduce_join_str(a_str: str, b_str: str) -> str:
a_bytestr = a_str.encode()
b_bytestr = b_str.encode()
if len(a_str) == 1 and len(a_bytestr) >= 4:
a_str = None
if len(b_bytestr) >= 4:
b_str = None
return Utility.join_str(a_str, b_str, separator_str=MyStringUtils.EMPTY)
return reduce(reduce_join_str, to_filter_str)
@classmethod
def find_utf8mb4(cls, a_str: str) -> str:
r"""
查找 字符串中第一个 4字节字符,如果返回空字符串,则说明字符串中不包含4字节字符
Args:
a_str:
Returns:
"""
if MyStringUtils.is_empty(a_str, trim=True):
return MyStringUtils.EMPTY
for tmp_char in MyStringUtils.to_str(a_str, trim=True):
tmp_charbytestr = tmp_char.encode()
if len(tmp_charbytestr) >= 4:
return tmp_char
return MyStringUtils.EMPTY
@classmethod
def do_check_and_put_param(cls, arg_dict: dict, to_check_param_dict: dict, param_type: int,
date_format_str: str = None) -> dict:
r"""
检查 to_check_param_dict 中的参数并put到 arg_dict 中,
0=int型参数 1=number型参数 2=date型参数
如果参数为None或空字符串则不进行检查和put,
否则 检查其值是否合法,合法则put到map中, 不合法则抛出异常
最后返回 arg_dict
Args:
arg_dict:
to_check_param_dict: key为参数名称 value为参数值
param_type: 0=int型参数 1=number型参数 2=date型参数
date_format_str: 参数类型为日期时使用的格式化字符串,默认为使用默认的格式化字符串,目前是 %Y-%m-%d %H:%M:%S
Returns:
"""
if not isinstance(arg_dict, dict):
raise ValueError('arg_dict 不是字典')
if to_check_param_dict is None:
return arg_dict
if not isinstance(to_check_param_dict, dict):
raise ValueError('to_check_param_dict 不是字典')
for tmp_key, tmp_value in to_check_param_dict.items():
param_name = MyStringUtils.to_str(tmp_key)
param_value = MyStringUtils.to_str(tmp_value)
if MyStringUtils.is_empty(param_value):
continue
tmp_error = create_base_exception(cls.join_str_with_none('参数', param_name, '不合法'),
submitted_webarg=cls.join_str_with_none('提供的', param_name, '的值为',
param_value))
if param_type == 0:
# 检查 int型参数并put
# 整型就是整型,防止是浮点或布尔
if isinstance(param_value, (float, bool)):
raise tmp_error
encountered_e = None
try:
test_val = int(param_value)
arg_dict[param_name] = str(test_val)
except Exception as e:
encountered_e = e
if encountered_e:
raise tmp_error.with_traceback(encountered_e.__traceback__)
elif param_type == 1:
# 检查 number型参数并put
encountered_e = None
try:
test_val = float(param_value)
arg_dict[param_name] = str(test_val)
except Exception as e:
encountered_e = e
if encountered_e:
raise tmp_error.with_traceback(encountered_e.__traceback__)
elif param_type == 2:
# 检查 date型参数并put
encountered_e = None
try:
test_val = cls.parse_datestr(param_value)
arg_dict[param_name] = cls.format_date(test_val, format_str=date_format_str)
except Exception as e:
encountered_e = e
if encountered_e:
raise tmp_error.with_traceback(encountered_e.__traceback__)
else:
raise ValueError(f"param_type的值不支持,提供的值为{param_type}")
return arg_dict
@classmethod
def do_check_and_put_param_for_not_none_or_empty(cls, arg_dict: dict, to_check_param_dict: dict,
ignore_none: bool = True, ignore_empty: bool = True) -> dict:
r"""
检查 to_check_param_dict 中的参数并put到 arg_dict 中,
如果参数为None时 ignore_none 为True 则不进行put,否则put null值, 默认不put
如果参数为EMPTY时 ignore_empty为True 则不进行put,否则put EMPTY值, 默认不put
否则 put到 arg_dict 中
最后返回 arg_dict
Args:
arg_dict:
to_check_param_dict: key为参数名称 value为参数值
ignore_none:
ignore_empty:
Returns:
"""
if not isinstance(arg_dict, dict):
raise ValueError('arg_dict 不是字典')
if to_check_param_dict is None:
return arg_dict
if not isinstance(to_check_param_dict, dict):
raise ValueError('to_check_param_dict 不是字典')
formatted_dict = MyUtils.format_dict_to_str_dict(to_check_param_dict, ignore_none=ignore_none,
ignore_empty=ignore_empty)
arg_dict.update(formatted_dict)
return arg_dict
@classmethod
def get_env(cls, env_name: str) -> str:
r"""
获取系统环境变量的内容
Args:
env_name:
Returns:
"""
return MyUtils.get_env(env_name)
@classmethod
def get_common_logger(cls, logger: logging.Logger = None) -> logging.Logger:
r"""
获取一个通用的logger或者明确的返回app.logger
Args:
logger:
Returns:
"""
if logger is None:
# 初始化一个通用的logger
logger = logging.getLogger('common_logout.logger')
logger.setLevel(logging.INFO)
logger.propagate = True
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
return logger
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Version: 1.0
@Python Version:3.6.6
@Author: ludq1
@Email: ludq1@chinaunicom.cn
@date: 2023/04/07 11:40:00
@Description:
"""
import json
import re
import requests
from .globalconst import HttpConst
from .my_baseexception import MyBaseException, create_base_exception
from .my_stringutils import MyStringUtils
from .my_utils import MyUtils
class HttpTrans:
"""
http传输处理
"""
# 定义要透传的header_key
_header_key = [
'Cookie'
, 'x-request-id'
, 'x-b3-traceid'
, 'x-b3-spanid'
, 'x-b3-parentspanid'
, 'x-b3-sampled'
, 'x-b3-flags'
, 'x-ot-span-context'
]
def __init__(self, http_header: dict = None):
r"""
Args:
http_header: dict http的请求头
"""
if http_header is not None:
try:
# 尝试将 http_header 转成 dict 并赋值
self._header = dict(http_header)
except:
raise ValueError('http_header 不能转换为字典')
else:
self._header = None
def generate_header(self, content_type: str = None,
dict_header: dict = None) -> dict:
"""
生成http头信息
Args:
content_type: string 传输类型
dict_header: dict 额外头信息
Returns: dict
"""
# 检查参数
if not (dict_header is None or isinstance(dict_header, dict)):
raise ValueError('dict_header 不是字典')
ret_header = {}
# 加入需要透传的 self._header
if self._header:
# 转换为标准的字符串kv字典
formatted_dict = MyUtils.format_dict_to_str_dict(self._header)
# 过滤出指定的key
filtered_keys = filter(lambda tmp_k: tmp_k in self._header_key, formatted_dict.keys())
# 生成过滤后的字典
filtered_dict = {tmp_k: formatted_dict.get(tmp_k) for tmp_k in filtered_keys}
# 更新 ret_dict
ret_header.update(filtered_dict)
# 设置参数默认值-- str_content_type
if not MyStringUtils.is_empty(content_type):
str_content_type = str(content_type)
else:
str_content_type = HttpConst.CONTENT_TYPE_URLENCODED
# 更新 ret_dict
ret_header.update({
HttpConst.HEADER_KEY_CONTENT_TYPE: str_content_type
})
# 加入额外的HEADER KEY
if dict_header:
formatted_dict = MyUtils.format_dict_to_str_dict(dict_header)
# 更新 ret_dict
ret_header.update(formatted_dict)
# 移除 Request Method 这个key,因为该key存在会造成requests请求失效
ret_header.pop(HttpConst.HEADER_KEY_REQUEST_METHOD, None)
return ret_header
def get_data(self, urlstr: str, trans_data: dict = None, dict_header: dict = None) -> requests.Response:
"""
post 传输数据
Args:
urlstr:
trans_data: 要附加到 urlstr 上的 key-value 字典 , kv 会自动编码
dict_header: 传输时使用的header
Returns:
"""
# 检查参数
if not (trans_data is None or isinstance(trans_data, dict)):
raise ValueError('trans_data 不是字典')
if trans_data:
trans_data = MyUtils.format_dict_to_str_dict(trans_data)
headers = self.generate_header(
content_type=HttpConst.CONTENT_TYPE_URLENCODED,
dict_header=dict_header
)
cookies = None
if HttpConst.HEADER_KEY_COOKIE in headers:
cookies = headers.get(HttpConst.HEADER_KEY_COOKIE)
return requests.get(url=urlstr, headers=headers, params=trans_data, cookies=cookies)
def post_encodeddata_standard(self, urlstr: str, trans_data: dict = None,
dict_header: dict = None) -> requests.Response:
"""
post 传输数据,返回 Response对象
Args:
urlstr: string httpurl
trans_data: 传输的内容 ,字典 , kv会自动编码
dict_header: 传输时使用的header
Returns:
"""
if not (trans_data is None or isinstance(trans_data, dict)):
raise ValueError('trans_data 不是字典')
trans_data_tmp = None
content_type = HttpConst.CONTENT_TYPE_URLENCODED
if dict_header is not None and HttpConst.HEADER_KEY_CONTENT_TYPE in dict_header.keys():
content_type = dict_header.get(HttpConst.HEADER_KEY_CONTENT_TYPE)
if HttpConst.CONTENT_TYPE_JSON == dict_header.get(HttpConst.HEADER_KEY_CONTENT_TYPE):
trans_data_tmp = json.dumps(trans_data)
if trans_data_tmp is None:
trans_data_tmp = MyUtils.format_dict_to_str_dict(trans_data)
headers = self.generate_header(
content_type=content_type,
dict_header=dict_header
)
regexp = (r'^https://')
match = re.search(regexp, urlstr.strip(), re.U)
if (match is not None):
return requests.post(url=urlstr, headers=headers, data=trans_data_tmp, verify=False)
else:
return requests.post(url=urlstr, headers=headers, data=trans_data_tmp)
def post_encodedata(self, urlstr: str,
trans_data: dict = None,
dict_header: dict = None,
**dict_arg) -> str:
"""
post 传输数据,返回rensponse内容字符串,传输异常时返回 标准错误的json字符串,所以该方法适用于标准的传输
Args:
urlstr: string httpurl
trans_data: 传输的内容 , 字典,kv会自动编码
dict_header: 传输时使用的header
**dict_arg: 额外参数
Returns: 标准格式的 json字符串
"""
# 以后额外扩展
# if dict_arg:
# pass
try:
m_response = self.post_encodeddata_standard(
urlstr=urlstr,
trans_data=trans_data,
dict_header=dict_header
)
if not m_response.ok:
raise create_base_exception(
'访问url出错,访问地址:{0},返回码{1}'.format(urlstr, m_response.status_code)
)
else:
str_ret = m_response.text
# 检查返回结果是不是有效的 jsonstr
dict_ret = MyUtils.jsonstr2dict(str_ret)
if dict_ret is None:
raise create_base_exception(
'返回的内容不是有效的json字符串:{}'.format(str_ret)
)
return str_ret
except requests.exceptions.RequestException as exception:
return MyUtils.dict2jsonstr(MyBaseException.format_exception_to_standard_dict(exception))
except MyBaseException as exception:
return MyUtils.dict2jsonstr(MyBaseException.format_exception_to_standard_dict(exception))
except Exception as exception:
return MyUtils.dict2jsonstr(MyBaseException.format_exception_to_standard_dict(exception))
def patch_encodeddata_standard(self, urlstr: str, trans_data: dict = None,
dict_header: dict = None) -> requests.Response:
"""
patch 传输数据,返回 Response对象
Args:
urlstr: string httpurl
trans_data: 传输的内容 ,字典 , kv会自动编码
dict_header: 传输时使用的header
Returns:
"""
if not (trans_data is None or isinstance(trans_data, dict)):
raise ValueError('trans_data 不是字典')
trans_data_tmp = None
content_type = HttpConst.CONTENT_TYPE_PATH_JSON
if dict_header is not None and HttpConst.HEADER_KEY_CONTENT_TYPE in dict_header.keys():
content_type = dict_header.get(HttpConst.HEADER_KEY_CONTENT_TYPE)
if HttpConst.CONTENT_TYPE_PATH_JSON == dict_header.get(HttpConst.HEADER_KEY_CONTENT_TYPE):
trans_data_tmp = json.dumps(trans_data)
if trans_data_tmp is None:
trans_data_tmp = MyUtils.format_dict_to_str_dict(trans_data)
headers = self.generate_header(
content_type=content_type,
dict_header=dict_header
)
return requests.patch(url=urlstr, headers=headers, data=trans_data_tmp)
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@Version: 1.0
@Python Version:3.6.6
@Author: ludq1
@Email: ludq1@chinaunicom.cn
@date: 2023/04/07 11:40:00
@Description:
"""
from flask import current_app
from .cfginfohandle import CfgInfoHandle
from .globalconst import FlaskConfigIDConst
from .redishanlde import RedisHandle
class InitFlaskHandle:
def __init__(self, flask_app=None):
r"""
登录处理初始化
Args:
flask_app: flask app
list_filter_url: url过滤,不需要被登录检查的 list[dict]
"""
# 初始化,处理是否接入flask
self.app = flask_app
if flask_app is not None:
self.init_app(flask_app)
def init_app(self, app):
r"""
初始化flask变量,走所有服务之前去验证登录
Args:
app: flask全局的app
Returns:
"""
with app.app_context():
# 初始化需要的环境信息
cfgh = CfgInfoHandle()
current_app.config[FlaskConfigIDConst.INIT_CONFIG_ID] = cfgh
# 初始化redis实例信息
rh = RedisHandle()
current_app.config[FlaskConfigIDConst.REDIS_CLASS_ID] = rh
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment