From 6254cc77f2a1372b13a61d47b321011ee79aa6e0 Mon Sep 17 00:00:00 2001 From: alex-smile <443677891@qq.com> Date: Fri, 8 Dec 2023 14:45:11 +0800 Subject: [PATCH 1/2] update nodeman/monitor_v3/bk_log/jobv3/cc confapis --- .../components/confapis/bk_log/bk_log.yaml | 291 ++++++++++- .../apidocs/en/batch_create_kube_namespace.md | 127 +++++ .../cc/apidocs/en/batch_create_kube_node.md | 139 +++++ .../cc/apidocs/en/batch_create_kube_pod.md | 194 +++++++ .../apidocs/en/batch_create_kube_workload.md | 161 ++++++ .../apidocs/en/batch_delete_kube_cluster.md | 63 +++ .../apidocs/en/batch_delete_kube_namespace.md | 56 ++ .../cc/apidocs/en/batch_delete_kube_node.md | 62 +++ .../cc/apidocs/en/batch_delete_kube_pod.md | 64 +++ .../apidocs/en/batch_delete_kube_workload.md | 58 +++ .../apidocs/en/batch_update_kube_cluster.md | 87 ++++ .../apidocs/en/batch_update_kube_namespace.md | 92 ++++ .../cc/apidocs/en/batch_update_kube_node.md | 87 ++++ .../apidocs/en/batch_update_kube_workload.md | 146 ++++++ .../cc/apidocs/en/create_kube_cluster.md | 85 +++ .../cc/apidocs/en/list_kube_cluster.md | 211 ++++++++ .../cc/apidocs/en/list_kube_container.md | 234 +++++++++ .../cc/apidocs/en/list_kube_namespace.md | 262 ++++++++++ .../confapis/cc/apidocs/en/list_kube_node.md | 233 +++++++++ .../confapis/cc/apidocs/en/list_kube_pod.md | 234 +++++++++ .../cc/apidocs/en/list_kube_workload.md | 261 ++++++++++ .../en/list_service_template_sync_status.md | 99 ++++ ...nc_service_template_to_service_instance.md | 57 +++ .../cc/apidocs/en/update_kube_cluster_type.md | 55 ++ .../zh_hans/batch_create_kube_namespace.md | 128 +++++ .../apidocs/zh_hans/batch_create_kube_node.md | 136 +++++ .../apidocs/zh_hans/batch_create_kube_pod.md | 191 +++++++ .../zh_hans/batch_create_kube_workload.md | 160 ++++++ .../zh_hans/batch_delete_kube_cluster.md | 59 +++ .../zh_hans/batch_delete_kube_namespace.md | 58 +++ .../apidocs/zh_hans/batch_delete_kube_node.md | 59 +++ .../apidocs/zh_hans/batch_delete_kube_pod.md | 64 +++ .../zh_hans/batch_delete_kube_workload.md | 58 +++ .../zh_hans/batch_update_kube_cluster.md | 86 ++++ .../zh_hans/batch_update_kube_namespace.md | 92 ++++ .../apidocs/zh_hans/batch_update_kube_node.md | 85 +++ .../zh_hans/batch_update_kube_workload.md | 148 ++++++ .../cc/apidocs/zh_hans/create_kube_cluster.md | 87 ++++ .../cc/apidocs/zh_hans/create_object.md | 11 +- .../cc/apidocs/zh_hans/list_kube_cluster.md | 210 ++++++++ .../cc/apidocs/zh_hans/list_kube_container.md | 229 +++++++++ .../cc/apidocs/zh_hans/list_kube_namespace.md | 219 ++++++++ .../cc/apidocs/zh_hans/list_kube_node.md | 222 ++++++++ .../cc/apidocs/zh_hans/list_kube_pod.md | 229 +++++++++ .../cc/apidocs/zh_hans/list_kube_workload.md | 256 ++++++++++ .../list_service_template_sync_status.md | 98 ++++ .../cc/apidocs/zh_hans/search_objects.md | 12 +- ...nc_service_template_to_service_instance.md | 57 +++ .../zh_hans/update_kube_cluster_type.md | 53 ++ .../cc/apidocs/zh_hans/update_object.md | 5 +- paas2/esb/components/confapis/cc/cc.yaml | 247 +++++++++ .../en/batch_get_job_instance_ip_log.md | 85 ++- .../confapis/jobv3/apidocs/en/check_script.md | 74 +++ .../jobv3/apidocs/en/create_credential.md | 4 +- .../jobv3/apidocs/en/create_dangerous_rule.md | 79 +++ .../jobv3/apidocs/en/create_file_source.md | 4 +- .../jobv3/apidocs/en/create_public_script.md | 87 ++++ .../en/create_public_script_version.md | 85 +++ .../jobv3/apidocs/en/create_script.md | 96 ++++ .../jobv3/apidocs/en/create_script_version.md | 93 ++++ .../jobv3/apidocs/en/delete_dangerous_rule.md | 50 ++ .../jobv3/apidocs/en/delete_public_script.md | 50 ++ .../en/delete_public_script_version.md | 52 ++ .../jobv3/apidocs/en/delete_script.md | 54 ++ .../jobv3/apidocs/en/delete_script_version.md | 56 ++ .../apidocs/en/disable_dangerous_rule.md | 57 +++ .../en/disable_public_script_version.md | 61 +++ .../apidocs/en/disable_script_version.md | 65 +++ .../jobv3/apidocs/en/enable_dangerous_rule.md | 57 +++ .../jobv3/apidocs/en/execute_job_plan.md | 19 +- .../jobv3/apidocs/en/fast_execute_script.md | 27 +- .../jobv3/apidocs/en/fast_execute_sql.md | 27 +- .../jobv3/apidocs/en/fast_transfer_file.md | 39 +- .../en/generate_local_file_upload_url.md | 4 +- .../jobv3/apidocs/en/get_account_list.md | 8 +- .../jobv3/apidocs/en/get_cron_detail.md | 10 +- .../jobv3/apidocs/en/get_cron_list.md | 8 +- .../apidocs/en/get_dangerous_rule_list.md | 79 +++ .../en/get_job_instance_global_var_value.md | 4 +- .../apidocs/en/get_job_instance_ip_log.md | 19 +- .../jobv3/apidocs/en/get_job_instance_list.md | 8 +- .../apidocs/en/get_job_instance_status.md | 10 +- .../jobv3/apidocs/en/get_job_plan_detail.md | 13 +- .../jobv3/apidocs/en/get_job_plan_list.md | 8 +- .../jobv3/apidocs/en/get_job_template_list.md | 8 +- .../jobv3/apidocs/en/get_proc_result.md | 97 ---- .../apidocs/en/get_public_script_list.md | 1 - .../en/get_public_script_version_detail.md | 6 +- .../en/get_public_script_version_list.md | 6 +- .../jobv3/apidocs/en/get_script_list.md | 8 +- .../apidocs/en/get_script_version_detail.md | 14 +- .../apidocs/en/get_script_version_list.md | 14 +- .../confapis/jobv3/apidocs/en/manage_proc.md | 128 ----- .../jobv3/apidocs/en/operate_job_instance.md | 4 +- .../confapis/jobv3/apidocs/en/operate_proc.md | 97 ---- .../jobv3/apidocs/en/operate_process.md | 113 ---- .../jobv3/apidocs/en/operate_step_instance.md | 4 +- .../en/publish_public_script_version.md | 61 +++ .../apidocs/en/publish_script_version.md | 65 +++ .../jobv3/apidocs/en/push_config_file.md | 30 +- .../confapis/jobv3/apidocs/en/save_cron.md | 45 +- .../jobv3/apidocs/en/set_base_report.md | 87 ---- .../jobv3/apidocs/en/update_credential.md | 4 +- .../jobv3/apidocs/en/update_cron_status.md | 4 +- .../jobv3/apidocs/en/update_dangerous_rule.md | 81 +++ .../jobv3/apidocs/en/update_file_source.md | 4 +- .../apidocs/en/update_public_script_basic.md | 73 +++ .../en/update_public_script_version.md | 85 +++ .../jobv3/apidocs/en/update_script_basic .md | 80 +++ .../jobv3/apidocs/en/update_script_version.md | 93 ++++ .../zh_hans/batch_get_job_instance_ip_log.md | 59 ++- .../jobv3/apidocs/zh_hans/check_script.md | 74 +++ .../jobv3/apidocs/zh_hans/create_account.md | 94 ++++ .../apidocs/zh_hans/create_dangerous_rule.md | 79 +++ .../apidocs/zh_hans/create_public_script.md | 87 ++++ .../zh_hans/create_public_script_version.md | 85 +++ .../jobv3/apidocs/zh_hans/create_script.md | 96 ++++ .../apidocs/zh_hans/create_script_version.md | 93 ++++ .../jobv3/apidocs/zh_hans/delete_account.md | 86 ++++ .../apidocs/zh_hans/delete_dangerous_rule.md | 50 ++ .../apidocs/zh_hans/delete_public_script.md | 50 ++ .../zh_hans/delete_public_script_version.md | 52 ++ .../jobv3/apidocs/zh_hans/delete_script.md | 54 ++ .../apidocs/zh_hans/delete_script_version.md | 56 ++ .../apidocs/zh_hans/disable_dangerous_rule.md | 57 +++ .../zh_hans/disable_public_script_version.md | 61 +++ .../apidocs/zh_hans/disable_script_version.md | 65 +++ .../apidocs/zh_hans/enable_dangerous_rule.md | 57 +++ .../jobv3/apidocs/zh_hans/get_account_list.md | 4 + .../zh_hans/get_dangerous_rule_list.md | 79 +++ .../zh_hans/get_job_instance_ip_log.md | 2 +- .../apidocs/zh_hans/get_public_script_list.md | 1 - .../get_public_script_version_detail.md | 6 +- .../zh_hans/get_public_script_version_list.md | 6 +- .../zh_hans/get_script_version_detail.md | 6 +- .../zh_hans/get_script_version_list.md | 6 +- .../zh_hans/publish_public_script_version.md | 61 +++ .../apidocs/zh_hans/publish_script_version.md | 65 +++ .../apidocs/zh_hans/update_dangerous_rule.md | 81 +++ .../apidocs/zh_hans/update_file_source.md | 3 +- .../zh_hans/update_public_script_basic.md | 73 +++ .../zh_hans/update_public_script_version.md | 85 +++ .../apidocs/zh_hans/update_script_basic .md | 80 +++ .../apidocs/zh_hans/update_script_version.md | 93 ++++ paas2/esb/components/confapis/jobv3/job.yaml | 315 ++++++++++-- .../monitor_v3/apidocs/en/add_shield.md | 172 ------- .../apidocs/en/delete_alarm_strategy.md | 46 -- .../apidocs/en/delete_alarm_strategy_v2.md | 49 -- .../apidocs/en/delete_notice_group.md | 44 -- .../monitor_v3/apidocs/en/disable_shield.md | 44 -- .../monitor_v3/apidocs/en/edit_shield.md | 95 ---- .../apidocs/en/export_uptime_check_task.md | 343 ------------- .../monitor_v3/apidocs/en/get_event_log.md | 121 ----- .../monitor_v3/apidocs/en/get_shield.md | 192 ------- .../monitor_v3/apidocs/en/get_ts_data.md | 103 ---- .../apidocs/en/import_uptime_check_node.md | 172 ------- .../apidocs/en/import_uptime_check_task.md | 402 --------------- .../monitor_v3/apidocs/en/list_shield.md | 167 ------ .../apidocs/en/list_storage_list.md | 53 -- ...etadata_clean_result_table_metric_split.md | 52 -- .../en/metadata_create_cluster_info.md | 76 --- .../apidocs/en/metadata_create_data_id.md | 83 --- .../apidocs/en/metadata_create_event_group.md | 119 ----- .../en/metadata_create_result_table.md | 172 ------- ...tadata_create_result_table_metric_split.md | 65 --- .../en/metadata_create_time_series_group.md | 145 ------ .../apidocs/en/metadata_delete_event_group.md | 51 -- .../en/metadata_delete_time_series_group.md | 51 -- .../apidocs/en/metadata_get_data_id.md | 103 ---- .../apidocs/en/metadata_get_event_group.md | 103 ---- .../apidocs/en/metadata_get_result_table.md | 99 ---- .../en/metadata_get_result_table_storage.md | 94 ---- .../en/metadata_get_time_series_group.md | 133 ----- .../apidocs/en/metadata_list_label.md | 98 ---- .../apidocs/en/metadata_list_result_table.md | 105 ---- .../en/metadata_list_transfer_cluster.md | 56 -- .../en/metadata_modify_cluster_info.md | 105 ---- .../apidocs/en/metadata_modify_data_id.md | 101 ---- .../apidocs/en/metadata_modify_event_group.md | 116 ----- .../en/metadata_modify_result_table.md | 164 ------ .../en/metadata_modify_time_series_group.md | 156 ------ .../apidocs/en/metadata_query_event_group.md | 108 ---- .../apidocs/en/metadata_query_tag_values.md | 59 --- .../en/metadata_query_time_series_group.md | 129 ----- .../en/metadata_upgrade_result_table.md | 48 -- .../apidocs/en/save_alarm_strategy.md | 303 ----------- .../apidocs/en/save_alarm_strategy_v2.md | 483 ------------------ .../apidocs/en/save_notice_group.md | 103 ---- .../apidocs/en/search_alarm_strategy.md | 270 ---------- .../apidocs/en/search_alarm_strategy_v2.md | 346 ------------- .../monitor_v3/apidocs/en/search_event.md | 264 ---------- .../apidocs/en/search_notice_group.md | 97 ---- .../apidocs/en/switch_alarm_strategy.md | 59 --- .../apidocs/en/update_partial_strategy_v2.md | 71 --- .../monitor_v3/apidocs/zh_hans/add_shield.md | 2 +- .../apidocs/zh_hans/as_code_export_config.md | 54 ++ .../apidocs/zh_hans/as_code_import_config.md | 47 ++ .../zh_hans/collector_plugin_delete.MD | 46 ++ .../zh_hans/collector_plugin_detail.MD | 171 +++++++ .../apidocs/zh_hans/collector_plugin_list.MD | 141 +++++ .../apidocs/zh_hans/delete_rule_group.md | 48 ++ .../apidocs/zh_hans/delete_user_group.md | 50 ++ .../apidocs/zh_hans/export_plugin.md | 54 ++ .../zh_hans/import_uptime_check_node.md | 9 +- .../zh_hans/metadata_create_result_table.md | 10 +- .../metadata_create_time_series_group.md | 2 +- .../zh_hans/plugin_import_without_frontend.MD | 47 ++ .../apidocs/zh_hans/save_rule_group.md | 204 ++++++++ .../apidocs/zh_hans/save_user_group.md | 246 +++++++++ .../search_alarm_strategy_without_biz.md | 2 +- .../apidocs/zh_hans/search_alert.md | 2 +- .../apidocs/zh_hans/search_rule_groups.md | 203 ++++++++ .../zh_hans/search_user_group_detail.md | 276 ++++++++++ .../apidocs/zh_hans/search_user_groups.md | 113 ++++ .../confapis/monitor_v3/monitor_v3.yaml | 182 ++++++- .../components/confapis/nodeman/nodeman.yaml | 77 +++ 216 files changed, 12603 insertions(+), 7415 deletions(-) create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_namespace.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_node.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_pod.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_workload.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_cluster.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_namespace.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_node.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_pod.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_workload.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_cluster.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_namespace.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_node.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_workload.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/create_kube_cluster.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/list_kube_cluster.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/list_kube_container.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/list_kube_namespace.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/list_kube_node.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/list_kube_pod.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/list_kube_workload.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/list_service_template_sync_status.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/sync_service_template_to_service_instance.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/update_kube_cluster_type.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_namespace.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_node.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_pod.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_workload.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_cluster.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_namespace.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_node.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_pod.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_workload.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_cluster.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_namespace.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_node.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_workload.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/create_kube_cluster.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_cluster.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_container.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_namespace.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_node.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_pod.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_workload.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/list_service_template_sync_status.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/sync_service_template_to_service_instance.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/update_kube_cluster_type.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/check_script.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/create_dangerous_rule.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/create_public_script.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/create_public_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/create_script.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/create_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/delete_dangerous_rule.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/delete_public_script.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/delete_public_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/delete_script.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/delete_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/disable_dangerous_rule.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/disable_public_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/disable_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/enable_dangerous_rule.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_dangerous_rule_list.md delete mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/get_proc_result.md delete mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/manage_proc.md delete mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/operate_proc.md delete mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/operate_process.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/publish_public_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/publish_script_version.md delete mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/set_base_report.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/update_dangerous_rule.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/update_public_script_basic.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/update_public_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/update_script_basic .md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/en/update_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/check_script.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_account.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_dangerous_rule.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_public_script.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_public_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_script.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_account.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_dangerous_rule.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_public_script.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_public_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_script.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_dangerous_rule.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_public_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/enable_dangerous_rule.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_dangerous_rule_list.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/publish_public_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/publish_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_dangerous_rule.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_public_script_basic.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_public_script_version.md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_script_basic .md create mode 100644 paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_script_version.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/add_shield.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_alarm_strategy.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_alarm_strategy_v2.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_notice_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/disable_shield.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/edit_shield.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/export_uptime_check_task.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/get_event_log.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/get_shield.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/get_ts_data.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/import_uptime_check_node.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/import_uptime_check_task.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/list_shield.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/list_storage_list.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_clean_result_table_metric_split.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_cluster_info.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_data_id.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_event_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_result_table.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_result_table_metric_split.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_time_series_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_delete_event_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_delete_time_series_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_data_id.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_event_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_result_table.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_result_table_storage.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_time_series_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_label.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_result_table.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_transfer_cluster.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_cluster_info.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_data_id.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_event_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_result_table.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_time_series_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_event_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_tag_values.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_time_series_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_upgrade_result_table.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/save_alarm_strategy.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/save_alarm_strategy_v2.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/save_notice_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/search_alarm_strategy.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/search_alarm_strategy_v2.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/search_event.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/search_notice_group.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/switch_alarm_strategy.md delete mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/en/update_partial_strategy_v2.md create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/as_code_export_config.md create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/as_code_import_config.md create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_delete.MD create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_detail.MD create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_list.MD create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/delete_rule_group.md create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/delete_user_group.md create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/export_plugin.md create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/plugin_import_without_frontend.MD create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/save_rule_group.md create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/save_user_group.md create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_rule_groups.md create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_user_group_detail.md create mode 100644 paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_user_groups.md diff --git a/paas2/esb/components/confapis/bk_log/bk_log.yaml b/paas2/esb/components/confapis/bk_log/bk_log.yaml index b3625980e..0abedbf32 100644 --- a/paas2/esb/components/confapis/bk_log/bk_log.yaml +++ b/paas2/esb/components/confapis/bk_log/bk_log.yaml @@ -133,14 +133,14 @@ dest_http_method: POST is_hidden: True -- path: /v2/bk_log/search_index_set/{index_set_id}/tailf/ +- path: /v2/bk_log/search_index_set/{index_set_id}/tail_f/ name: search_tailf label: 日志平台-检索-实时日志 label_en: bk_log search tail method: POST api_type: query comp_codename: generic.v2.bk_log.bk_log_component - dest_path: /api/v1/search/index_set/{index_set_id}/tailf/ + dest_path: /api/v1/search/index_set/{index_set_id}/tail_f/ dest_http_method: POST is_hidden: True @@ -343,6 +343,17 @@ dest_http_method: GET is_hidden: True +- path: /v2/bk_log/databus_list_collectors/ + name: list_databus_collectors_all + label: 日志平台-采集项列表(全量) + label_en: bk_log list collector all + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/collectors/list_collectors/ + dest_http_method: GET + is_hidden: True + - path: /v2/bk_log/databus_collectors/{collector_config_id}/ name: retrieve_databus_collector label: 日志平台-获取采集项详情 @@ -773,6 +784,17 @@ dest_http_method: GET is_hidden: True +- path: /v2/bk_log/switch_bcs_collector_storage/ + name: switch_bcs_collector_storage + label: 日志平台-切换存储集群 + label_en: bk_log switch bcs collector storage + method: POST + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/collectors/switch_bcs_collector_storage/ + dest_http_method: POST + is_hidden: True + - path: /v2/bk_log/list_bcs_collector/ name: list_bcs_collector label: 日志平台-查询bcs采集项 @@ -1124,3 +1146,268 @@ dest_path: /api/v1/search/index_set/aggs/union_search/date_histogram/ dest_http_method: POST is_hidden: True + +- path: /v2/bk_log/databus_collectors/list_namespace/ + name: databus_collector_list_bcs_namespace + label: 日志平台-获取集群namespace列表 + label_en: bk_log list bcs cluster namespace + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/collectors/list_namespace/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus_collectors/list_workload_type/ + name: databus_collector_list_bcs_workload_type + label: 日志平台-获取集群工作负载类型列表 + label_en: bk_log list bcs cluster workload type + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/collectors/list_workload_type/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus_collectors/get_workload/ + name: databus_collector_list_bcs_workload + label: 日志平台-获取集群工作负载列表 + label_en: bk_log list bcs cluster workload + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/collectors/get_workload/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus_collectors/get_labels/ + name: databus_collector_list_bcs_labels + label: 日志平台-获取集群标签列表 + label_en: bk_log list bcs cluster labels + method: POST + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/collectors/get_labels/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus_collectors/list_topo/ + name: databus_collector_list_bcs_topo + label: 日志平台-获取集群标签TOPO + label_en: bk_log list bcs cluster topo + method: POST + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/collectors/list_topo/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus_collectors/preview_containers/ + name: databus_collector_list_bcs_container_preview + label: 日志平台-获取集群container预览 + label_en: bk_log list bcs cluster container preview + method: POST + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/collectors/preview_containers/ + dest_http_method: POST + is_hidden: True + +- path: /v2/bk_log/databus/create_es_snapshot_repository/ + name: create_es_snapshot_repository + label: 日志平台-日志归档-新建归档仓库 + label_en: bk_log create es snapshot repository + method: POST + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/meta/esb/create_es_snapshot_repository/ + dest_http_method: POST + is_hidden: True + +- path: /v2/bk_log/databus/delete_es_snapshot_repository/ + name: delete_es_snapshot_repository + label: 日志平台-日志归档-删除归档仓库 + label_en: bk_log delete es snapshot repository + method: POST + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/meta/esb/delete_es_snapshot_repository/ + dest_http_method: POST + is_hidden: True + +- path: /v2/bk_log/databus/storage/list_repository/ + name: list_repository + label: 日志平台-日志归档-归档仓库列表 + label_en: bk_log create es snapshot repository + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/storage/list_repository/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus/storage/{cluster_id}/repository/ + name: list_repository + label: 日志平台-日志归档-集群快照仓库列表 + label_en: bk_log repository list + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/storage/{cluster_id}/repository/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus/archive/ + name: create_archive + label: 日志平台-日志归档-创建归档 + label_en: bk_log create archive + method: POST + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/archive/ + dest_http_method: POST + is_hidden: True + +- path: /v2/bk_log/databus/archive/{archive_config_id}/ + name: update_archive + label: 日志平台-日志归档-更新归档 + label_en: bk_log update archive + method: PUT + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/archive/{archive_config_id}/ + dest_http_method: PUT + is_hidden: True + +- path: /v2/bk_log/databus/archive/ + name: list_archive + label: 日志平台-日志归档-归档列表 + label_en: bk_log archive list + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/archive/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus/archive/{archive_config_id}/ + name: retrieve_archive + label: 日志平台-日志归档-归档配置详情 + label_en: bk_log archive retrieve + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/archive/{archive_config_id}/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus/archive/{archive_config_id}/ + name: delete_archive + label: 日志平台-日志归档-归档删除 + label_en: bk_log archive delete + method: DELETE + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/archive/{archive_config_id}/ + dest_http_method: DELETE + is_hidden: True + +- path: /v2/bk_log/databus/archive/list_archive/ + name: list_archive_switch + label: 日志平台-日志归档-归档下拉列表 + label_en: bk_log archive switch list + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/archive/list_archive/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus/archive/{archive_config_id}/state/ + name: archive_state + label: 日志平台-日志归档-归档状态查询 + label_en: bk_log archive state + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/archive/{archive_config_id}/state/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus/restore/ + name: create_archive_restore + label: 日志平台-日志归档-创建归档回溯 + label_en: bk_log create archive restore + method: POST + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/restore/ + dest_http_method: POST + is_hidden: True + +- path: /v2/bk_log/databus/restore/{restore_config_id}/ + name: update_archive_restore + label: 日志平台-日志归档-更新归档回溯 + label_en: bk_log update archive restore + method: PUT + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/restore/{restore_config_id}/ + dest_http_method: PUT + is_hidden: True + +- path: /v2/bk_log/databus/restore/ + name: list_archive_restore + label: 日志平台-日志归档-归档回溯列表 + label_en: bk_log archive restore list + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/restore/ + dest_http_method: GET + is_hidden: True + +- path: /v2/bk_log/databus/restore/{restore_config_id}/ + name: delete_archive_restore + label: 日志平台-日志归档-删除归档回溯 + label_en: bk_log delete archive restore + method: DELETE + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/restore/{restore_config_id}/ + dest_http_method: DELETE + is_hidden: True + +- path: /v2/bk_log/databus/restore/batch_get_state/ + name: restore_batch_get_state + label: 日志平台-日志归档-回溯状态查询 + label_en: bk_log archive restore batch_get_state + method: POST + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/databus/restore/batch_get_state/ + dest_http_method: POST + is_hidden: True + +- path: /v2/bk_log/pattern/{index_set_id}/search/ + name: search_pattern + label: 日志平台-日志聚类-聚类检索 + label_en: bk_log search pattern + method: POST + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/pattern/{index_set_id}/search/ + dest_http_method: POST + is_hidden: True + +- path: /v2/bk_log/clustering_config/{index_set_id}/config/ + name: get_clustering_config + label: 日志平台-日志聚类-获取聚类配置 + label_en: bk_log get clustering config + method: GET + api_type: query + comp_codename: generic.v2.bk_log.bk_log_component + dest_path: /api/v1/clustering_config/{index_set_id}/config/ + dest_http_method: GET + is_hidden: True + diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_namespace.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_namespace.md new file mode 100644 index 000000000..1f31a8475 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_namespace.md @@ -0,0 +1,127 @@ +### Function Description + +Batch create namespace (version: v3.12.1+, auth: create container namespace) + +### Request parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| field | type | required | description | +|-----------|-------|----------|-------------------------------------------| +| bk_biz_id | int | yes | business_id | +| data | array | Yes | namespace array, limited to 200 at a time | + +#### data[x] + +| field | type | required | description | +|-----------------|--------|----------|------------------------------------------------------------------------------| +| bk_cluster_id | int | yes | The unique id of the cluster identified in cmdb, passed in with cluster_uid. | +| name | string | yes | namespace name | +| labels | map | no | labels | +| resource_quotas | array | no | namespace CPU and memory requests and limits | + +#### resource_quotas[x] + +| field | type | required | description | +|----------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------| +| hard | object | no | hard limits required per named resource | +| scopes | array | no | Quota scopes,optional values are: "Terminating", "NotTerminating", "BestEffort", "NotBestEffort", "PriorityClass", "CrossNamespacePodAffinity" |scope_selector +| scope_selector | no | object | scope selector | + +#### scope_selector + +| field | type | required | description | +|-------------------|------|----------|-------------------| +| match_expressions | no | array | match_expressions | + +#### match_expressions[x] + +| field | type | required | description | +|------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------| +| scope_name | array | is | quota scope,optional values are: "Terminating", "NotTerminating", "BestEffort", "NotBestEffort", "PriorityClass", " CrossNamespacePodAffinity" | +| operator | string | Yes | selector operator, with optional values "In", "NotIn", "Exists", "DoesNotExist" | +| values | array | no | Array of strings, cannot be empty if the operator is "In" or "NotIn", must be empty if it is "Exists" or "DoesNotExist" | + +### Request parameter examples + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "data": [ + { + "bk_cluster_id": 1, + "name": "test", + "labels": { + "test": "test", + "test2": "test2" + }, + "resource_quotas": [ + { + "hard": { + "memory": "20000Gi", + "pods": "100", + "cpu": "10k" + }, + "scope_selector": { + "match_expressions": [ + { + "values": [ + "high" + ], + "operator": "In", + "scope_name": "PriorityClass" + } + ] + } + } + ] + } + ] +} +``` + +### Return Result Example + +```json + +{ + "result": true, + "code": 0, + "data": { + "ids": [1] + }, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +**Note:** + +- The order of the namespace ID array in the returned data is consistent with the order of the array data in the + parameter. + +### Return result parameter description + +#### response + +| name | type | description | +|------------|--------|-------------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. true:request successful; false request failed. | +| code | int | The error code. 0 means success, >0 means failure error. | +| message | string | The error message returned by the failed request. | +| permission | object | Permission information | +| request_id | string | request_chain_id | +| data | object | data returned by the request | + +#### data + +| field | type | description | +|-------|-------|-------------------------------------------------| +| ids | array | array of unique identifiers for namespace in cc | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_node.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_node.md new file mode 100644 index 000000000..ff9bbf948 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_node.md @@ -0,0 +1,139 @@ +### Functional description + +create a new container node (v3.12.1+, permission: kube Node Creation Permission) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-----------|-------|----------|---------------------------------------------------------------| +| bk_biz_id | int | yes | business ID | +| data | array | yes | the specific information of the node that needs to be created | + +#### data[x] + +| Field | Type | Required | Description | +|-------------------|--------|----------|--------------------------------------------------------------------------------------| +| bk_cluster_id | int | yes | ID of the container cluster in cmdb | +| bk_host_id | int | yes | associated host ID | +| uid | string | yes | the own ID of the container cluster | +| name | string | yes | node name | +| roles | string | no | node roles | +| labels | object | no | label | +| taints | object | no | taints | +| unschedulable | bool | no | Whether to turn off schedulable, true means not schedulable, false means schedulable | +| internal_ip | array | no | internal ip | +| external_ip | array | no | external ip | +| hostname | string | no | hostname | +| runtime_component | string | no | runtime components | +| kube_proxy_mode | string | no | kube-proxy proxy mode | +| pod_cidr | string | no | The allocation range of the Pod address of this node | + +### Request Parameters Example + +```json + { + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "data": [ + { + "bk_host_id": 1, + "bk_cluster_id": 1, + "name": "k8s", + "roles": "master", + "labels": { + "env": "test" + }, + "taints": { + "type": "gpu" + }, + "unschedulable": false, + "internal_ip": [ + "127.0.0.1" + ], + "external_ip": [ + "127.0.0.2" + ], + "hostname": "xxx", + "runtime_component": "runtime_component", + "kube_proxy_mode": "ipvs", + "pod_cidr": "127.0.0.1/26" + }, + { + "bk_host_id": 2, + "bk_cluster_id": 1, + "name": "k8s-node", + "roles": "master", + "labels": { + "env": "test" + }, + "taints": { + "type": "gpu" + }, + "unschedulable": false, + "internal_ip": [ + "127.0.0.1" + ], + "external_ip": [ + "127.0.0.2" + ], + "hostname": "xxx", + "runtime_component": "runtime_component", + "kube_proxy_mode": "ipvs", + "pod_cidr": "127.0.0.1/26" + } + ] +} +``` + +**Note:** + +- internal_ip and external_ip cannot be empty at the same time. +- no more than 100 nodes can be created at one time. + +### Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "ids": [ + 1, + 2 + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +**Note:** + +- The order of the node ID array in the returned data is consistent with the order of the array data in the parameter. + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|------------------------------------------------------------------------------------| +| result | bool | Whether the request succeeded or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| data | object | Data returned by request | +| request_id | string | Request chain id | + +### data + +| Name | Type | Description | +|------|-------|-------------------------------| +| ids | array | list of kube node IDs created | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_pod.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_pod.md new file mode 100644 index 000000000..e0ed41b8d --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_pod.md @@ -0,0 +1,194 @@ +### Functional description + +create new container pods and containers(v3.12.1+,permission: kube pod creation permission) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-------|-------|----------|----------------------------------| +| data | array | yes | Details of the pod to be created | + +#### data[x] + +| Field | Type | Required | Description | +|-----------|-------|----------|------------------------------------------------------| +| bk_biz_id | int | yes | business ID | +| pods | array | yes | Details of the pod to be created under this business | + +#### pods[x] + +| Field | Type | Required | Description | +|----------------|--------------|----------|-----------------------------| +| spec | object | yes | pod association information | +| bk_host_id | int | yes | pod associated host id | +| name | string | yes | pod name | +| operator | string array | yes | pod operator | +| priority | object | no | priority | +| labels | object | no | labels | +| ip | string | no | Container network IP | +| ips | array | no | Container network IP array | +| volumes | object | no | Volume information | +| qos_class | string | no | service quality | +| node_selectors | object | no | Node label selector | +| tolerations | object | no | tolerance | +| containers | array | no | container information | + +#### spec + +| Field | Type | Required | Description | +|-----------------|--------|----------|---------------------------------------------------------| +| bk_cluster_id | int | yes | ID of the cluster where the pod is located | +| bk_namespace_id | int | yes | The ID of the namespace to which the pod belongs | +| bk_node_id | int | yes | ID of the node where the pod is located | +| ref | object | yes | Information about the workload corresponding to the pod | + +#### ref + +| Field | Type | Required | Description | +|-------|------|----------|----------------------------------------------------------------------------------| +| kind | int | yes | the workload category associated with the pod. For specific categories, see Note | +| id | int | yes | the ID of the workload associated with the pod | + +#### containers[x] + +| Field | Type | Required | Description | +|---------------|--------|----------|---------------------------| +| name | string | yes | container name | +| container_uid | string | yes | container ID | +| image | string | no | mirror information | +| ports | array | no | container port | +| host_ports | array | no | host port mapping | +| args | array | no | startup parameters | +| started | int | no | start time | +| limits | object | no | resource constraints | +| requests | object | no | application resource size | +| liveness | object | no | survival probe | +| environment | array | no | environment variable | +| mounts | array | no | mount volume | + +#### ports[x] + +| Field | Type | Required | Description | +|---------------|--------|----------|----------------| +| name | string | yes | port name | +| hostPort | int | no | host port | +| containerPort | int | no | container port | +| protocol | string | no | protocol name | +| hostIP | string | no | host IP | + +#### liveness + +| Field | Type | Required | Description | +|-----------|--------|----------|-----------------| +| exec | object | yes | perform action | +| httpGet | object | no | Http Get action | +| tcpSocket | object | no | tcp socket | +| grpc | object | no | grpc protocol | + +**注意:** + +- create no more than 200 pods at one time . +- specific workload category: deployment、statefulSet、daemonSet、gameStatefulSet、gameDeployment、cronJob、job、pods. +- this interface will create pods and corresponding containers synchronously. + +### Request Parameters Example + +```json + { + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "data": [ + { + "bk_biz_id": 1, + "pods": [ + { + "spec": { + "bk_cluster_id": 1, + "bk_namespace_id": 1, + "ref": { + "kind": "deployment", + "id": 1 + }, + "bk_node_id": 1 + }, + "name": "name", + "operator": [ + "user1", + "user2" + ], + "bk_host_id": 1, + "priority": 1, + "labels": { + "env": "test" + }, + "ip": "127.0.0.1", + "ips": [ + { + "ip": "127.0.0.1" + }, + { + "ip": "127.0.0.2" + } + ], + "containers": [ + { + "name": "name", + "container_uid": "uid", + "image": "xxx", + "started": 1 + } + ] + } + ] + } + ] +} +``` + +### Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "ids": [ + 1, + 2 + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +**注意:** + +- the order of the pod ID array in the returned data is consistent with the order of the array data in the parameter. + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|------------------------------------------------------------------------------------| +| result | bool | Whether the request succeeded or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| data | object | Data returned by request | +| request_id | string | Request chain id | + +### data + +| Name | Type | Description | +|------|-------|------------------------------| +| ids | array | list of kube pod IDs created | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_workload.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_workload.md new file mode 100644 index 000000000..e5f79ecd3 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_workload.md @@ -0,0 +1,161 @@ +### Function description + +Batch create workload (version: v3.12.1+, auth: create container workload) + +### Request parameters + +{{ common_args_desc }} + +#### Interface parameters + +| field | type | required | description | +|-----------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| bk_biz_id | int | yes | business id | +| kind | string | yes | workload type, the current built-in workload types are deployment, daemonSet, statefulSet, gameStatefulSet, gameDeployment, cronJob, job, pods (put those that do not pass the workload but directly create Pod) | +| data | array | Yes | array, limit to 200 at a time | + +#### data[x] + +| field | type | required | description | +|-------------------------|--------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| +| bk_namespace_id | int | yes | namespace's unique identifier in cc | +| name | string | yes | workload name | +| labels | map | no | labels | +| selector | object | no | workload selector | +| replicas | int | no | number of workload instances | +| strategy_type | string | no | workload update mechanism | +| min_ready_seconds | int | No | Specifies the minimum time that a newly created Pod will be ready without any container crashes, and only after that time will the Pod be considered available | +| rolling_update_strategy | object | No | Rolling update strategy | + +#### selector + +| field | type | required | description | +|-------------------|-------|----------|-------------------| +| match_labels | map | no | match by label | +| match_expressions | array | no | match_expressions | + +#### match_expressions[x] + +| field | type | required | description | +|----------|--------|------------|-------------------------------------------------------------------------------------------------------------------------| +| key | string | is the key | of the |tag +| operator | string | is the | operator, with optional values: "In", "NotIn", "Exists", "DoesNotExist" | +| values | array | no | Array of strings, cannot be empty if the operator is "In" or "NotIn", must be empty if it is "Exists" or "DoesNotExist" | + +#### rolling_update_strategy + +When strategy_type is RollingUpdate, it is not empty, otherwise it is empty. + +| field | type | mandatory | description | +|-----------------|--------|-----------|-----------------| +| max_unavailable | object | no | max_unavailable | +| max_surge | object | no | max_overflow | + +#### max_unavailable + +| field | type | mandatory | description | +|---------|--------|-----------|-----------------------------------------------------------------------------------| +| type | int | Yes | Optional value of 0 (for int type) or 1 (for string type) | +| int_val | int | No | When type is 0 (for int type), it cannot be null, and the corresponding int value | +| str_val | string | no | when type is 1(for string type),cannot be null,corresponding string value | + +#### max_surge + +| field | type | mandatory | description | +|---------|--------|-----------|------------------------------------------------------------------------------------------| +| type | int | yes | optional value of 0 (for int type) or 1 (for string type) | +| int_val | int | No | When type is 0 (for int type), it cannot be null, and the corresponding int value | +| str_val | string | no | When type is 1 (for string type), it cannot be empty, and the corresponding string value | + +### Example request parameters + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "kind": "deployment", + "data": [ + { + "bk_namespace_id": 1, + "name": "test", + "labels": { + "test": "test", + "test2": "test2" + }, + "selector": { + "match_labels": { + "test": "test", + "test2": "test2" + }, + "match_expressions": [ + { + "key": "tier", + "operator": "In", + "values": [ + "cache" + ] + } + ] + }, + "replicas": 1, + "strategy_type": "RollingUpdate", + "min_ready_seconds": 1, + "rolling_update_strategy": { + "max_unavailable": { + "type": 0, + "int_val": 1 + }, + "max_surge": { + "type": 0, + "int_val": 1 + } + } + } + ] +} +``` + +### Return Result Example + +```json + +{ + "result": true, + "code": 0, + "data": { + "ids": [ + 1 + ] + }, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +**Note:** + +- The order of the workload ID array in the returned data is consistent with the order of the array data in the + parameter. + +### Return result parameter description + +#### response + +| name | type | description | +|------------|--------|-------------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. true:request successful; false request failed. | +| code | int | The error code. 0 means success, >0 means failure error. | +| message | string | The error message returned by the failed request. | +| permission | object | Permission information | +| request_id | string | request_chain_id | +| data | object | The data returned by the request. | + +#### data + +| field | type | description | +|-------|-------|-----------------------------------| +| ids | array | Array of unique identifiers in cc | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_cluster.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_cluster.md new file mode 100644 index 000000000..a96b7c12c --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_cluster.md @@ -0,0 +1,63 @@ +### Functional description + +delete container clusters in batches (v3.12.1+, permission: kube cluster deletion permission) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-----------|-------|----------|----------------------------------------------------| +| bk_biz_id | int | yes | business id to which the container cluster belongs | +| ids | array | yes | ids of the container cluster in cmdb | + +**Note:** + +- user needs to ensure that there are no associated resources (such as namespace, pod, node workload, etc.) under the + cluster to be deleted, otherwise the deletion will fail.- uid and id cannot be empty at the same time, nor can they be + filled in at the same time. +- the number of clusters to be deleted at one time cannot exceed 10. + +### Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "ids": [ + 1, + 2 + ] +} +``` + +### Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "", + "permission": null, + "data": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|------------------------------------------------------------------------------------| +| result | bool | Whether the request succeeded or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| data | object | Data returned by request | +| request_id | string | Request chain id | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_namespace.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_namespace.md new file mode 100644 index 000000000..b6ed3f2ce --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_namespace.md @@ -0,0 +1,56 @@ +### Function Description + +Batch delete namespace (version: v3.12.1+, auth: delete container namespace) + +### Request parameters + +{{ common_args_desc }} + +#### Interface parameters + +| field | type | required | description | +|-----------|-------|----------|-----------------------------------------------------------------| +| bk_biz_id | int | Yes | business id | +| ids | array | Yes | the namespace ids array to be deleted, limited to 200 at a time | + +### Example request parameters + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "ids": [ + 1 + ] +} +``` + +### Return Result Example + +```json + +{ + "result": true, + "code": 0, + "data": null, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### Return result parameter description + +#### response + +| name | type | description | +|------------|--------|-------------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. true:request successful; false request failed. | +| code | int | The error code. 0 means success, >0 means failure error. | +| message | string | The error message returned by the failed request. | +| permission | object | Permission information | +| request_id | string | request_chain_id | +| data | object | The data returned by the request. | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_node.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_node.md new file mode 100644 index 000000000..9ba623e6c --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_node.md @@ -0,0 +1,62 @@ +### Functional description + +delete container node (v3.12.1+, permission: kube node deletion permission) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-----------|-------|----------|-----------------------------------| +| bk_biz_id | int | yes | ID of the container node in cmdb | +| ids | array | yes | IDs of the container node in cmdb | + +**Note:** + +- user needs to ensure that there are no associated resources (such as pods) under the node, otherwise the deletion will + fail. +- delete no more than 100 Nodes at one time. + +### Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "ids": [ + 1, + 2 + ] +} +``` + +### Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "", + "permission": null, + "data": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|------------------------------------------------------------------------------------| +| result | bool | Whether the request succeeded or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| data | object | Data returned by request | +| request_id | string | Request chain id | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_pod.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_pod.md new file mode 100644 index 000000000..222463be4 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_pod.md @@ -0,0 +1,64 @@ +### Functional description + +batch delete kube pod (version: v3.12.1+, auth: Delete Kube Pod) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-------|--------------|----------|---------------------------------------------------------------------------------| +| data | object array | yes | The array of pod info to be deleted, the sum of all pods in data is at most 200 | + +#### data[x] + +| Field | Type | Required | Description | +|-----------|-----------|----------|-----------------------------------------------------------------------------------| +| bk_biz_id | int | yes | biz id | +| ids | int array | yes | The array of pod cc IDs to be deleted, the sum of all pods in data is at most 200 | + +### Request Parameters Example + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "data": [ + { + "bk_biz_id": 123, + "ids": [ + 5, + 6 + ] + } + ] +} +``` + +### Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| request_id | string | Request chain id | \ No newline at end of file diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_workload.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_workload.md new file mode 100644 index 000000000..e12633731 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_kube_workload.md @@ -0,0 +1,58 @@ +### Function Description + +Batch delete workload (version: v3.12.1+, auth: delete container workload) + +### Request parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| field | type | required | description | +|-----------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| bk_biz_id | int | Yes | business id | +| kind | string | Yes | workload type, the current built-in workload types are deployment, daemonSet, statefulSet, gameStatefulSet, gameDeployment, cronJob, job, pods (put those that do not pass the workload but directly create Pod) | +| ids | array | Yes | the workload id array to be deleted, limited to 200 at a time | + +### Example request parameters + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "kind": "deployment", + "ids": [ + 1 + ] +} +``` + +### Return Result Example + +```json + +{ + "result": true, + "code": 0, + "data": null, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### Return result parameter description + +#### response + +| name | type | description | +|------------|--------|-------------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. true:request successful; false request failed. | +| code | int | The error code. 0 means success, >0 means failure error. | +| message | string | The error message returned by the failed request. | +| permission | object | Permission information | +| request_id | string | request_chain_id | +| data | object | The data returned by the request. | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_cluster.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_cluster.md new file mode 100644 index 000000000..7f25a75ec --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_cluster.md @@ -0,0 +1,87 @@ +### Functional description + +batch update container cluster attribute fields (v3.12.1+, permission: kube cluster editing permissions) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-----------|--------|----------|-----------------------------------| +| bk_biz_id | int | yes | business ID | +| ids | array | yes | unique IDs of the cluster in cmdb | +| data | object | yes | data that needs to be updated | + +#### data + +| Field | Type | Required | Description | +|-----------------|--------|----------|-----------------------------------------| +| name | string | no | cluster name | +| version | string | no | cluster version | +| network_type | string | no | network type | +| region | string | no | the region where the cluster is located | +| vpc | string | no | vpc network | +| network | array | no | cluster network | +| bk_project_id | string | no | project_id | +| bk_project_name | string | no | project name | +| bk_project_code | string | no | project english name | + +**Note:** + +- the number of clusters to be updated at one time does not exceed 100 +- this api does not support updating cluster type, please use the `update_kube_cluster_type` api to update it. + +### Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "ids": [ + 1 + ], + "data": { + "name": "cluster", + "version": "1.20.6", + "network_type": "underlay", + "region": "xxx", + "network": [ + "127.0.0.0/21" + ], + "bk_project_id": "21bf9ef9be7c4d38a1d1f2uc0b44a8f2", + "bk_project_name": "test", + "bk_project_code": "test" + } +} +``` + +### Return Result Example + +```json + { + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": null +} +``` + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| request_id | string | Request chain id | +| data | object | Data returned by request | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_namespace.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_namespace.md new file mode 100644 index 000000000..c345a6f92 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_namespace.md @@ -0,0 +1,92 @@ +### Function Description + +Batch update namespace (version: v3.12.1+, auth: edit container namespace) + +### Request parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| field | type | required | description | +|-----------|--------|----------|-----------------------------------------| +| bk_biz_id | int | yes | business id | +| data | object | yes | contains the fields to be updated | +| ids | array | yes | an array of id unique identifiers in cc | + +#### data + +| field | type | required | description | +|-----------------|-------|----------|----------------------------------------------| +| labels | map | no | labels | +| resource_quotas | array | no | namespace CPU and memory requests and limits | + +### Example request parameters + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 1, + "ids": [ + 1, + 2, + 3 + ], + "data": { + "labels": { + "test": "test", + "test2": "test2" + }, + "resource_quotas": [ + { + "hard": { + "memory": "20000Gi", + "pods": "100", + "cpu": "10k" + }, + "scope_selector": { + "match_expressions": [ + { + "values": [ + "high" + ], + "operator": "In", + "scope_name": "PriorityClass" + } + ] + } + } + ] + } +} +``` + +### Return Result Example + +```json + +{ + "result": true, + "code": 0, + "data": null, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### Return result parameter description + +#### response + +| name | type | description | +|------------|--------|-------------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. true:request successful; false request failed. | +| code | int | The error code. 0 means success, >0 means failure error. | +| message | string | The error message returned by the failed request. | +| permission | object | Permission information | +| request_id | string | request_chain_id | +| data | object | The data returned by the request. | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_node.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_node.md new file mode 100644 index 000000000..12c3d29e2 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_node.md @@ -0,0 +1,87 @@ +### Functional description + +batch update container node attribute field (v3.12.1+, permission: kube Node Edit Permission) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-----------|--------|----------|-----------------------------------------------| +| bk_biz_id | int | yes | business ID | +| ids | array | yes | IDs of the node in cmdb | +| data | object | yes | Node attribute fields that need to be updated | + +#### data + +| Field | Type | Required | Description | +|-------------------|-------------|----------|------------------------------------------------------------------------------------| +| labels | json object | no | label | +| taints | string | no | cluster name | +| unschedulable | bool | no | set whether to schedule | +| hostname | string | no | host name | +| runtime_component | string | no | runtime components | +| kube_proxy_mode | string | no | Kube-proxy proxy mode | +| pod_cidr | string | no | The allocation range of the Pod address of this node, for example: 172.17.0.128/26 | + +**注意:** + +- Among them, labels and taints need to be updated as a whole. +- data field cannot be empty. +- The number of clusters to be updated at one time does not exceed 100. + +### Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "ids": [ + 1, + 2 + ], + "data": { + "labels": { + "env": "test" + }, + "taints": { + "type": "gpu" + }, + "unschedulable": false, + "hostname": "xxx", + "runtime_component": "runtime_component", + "kube_proxy_mode": "ipvs", + "pod_cidr": "127.0.0.1/26" + } +} + +``` + +### Return Result Example + +```json + { + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": null +} +``` + +### Return Result Parameters Description + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| request_id | string | Request chain id | +| data | object | Data returned by request | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_workload.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_workload.md new file mode 100644 index 000000000..250d28a22 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_update_kube_workload.md @@ -0,0 +1,146 @@ +### Function Description + +Batch update workload (version: v3.12.1+, auth: edit container workload) + +### Request parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| field | type | required | description | +|-----------|--------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| bk_biz_id | int | yes | business id | +| kind | string | yes | workload type, the current built-in workload types are deployment, daemonSet, statefulSet, gameStatefulSet, gameDeployment, cronJob, job, pods (put those that do not pass workload but directly create Pod) | +| data | object | yes | contains the fields to be updated | +| ids | array | yes | an array of id unique identifiers in cc | + +#### data + +| field | type | required | description | +|-------------------------|--------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| +| labels | map | no | labels | +| selector | object | no | workload selector | +| replicas | int | no | number of workload instances | +| strategy_type | string | no | workload update mechanism | +| min_ready_seconds | int | No | Specifies the minimum time that a newly created Pod will be ready without any container crashes, and only after that time will the Pod be considered available | +| rolling_update_strategy | object | No | Rolling update strategy | + +#### selector + +| field | type | required | description | +|-------------------|-------|----------|-------------------| +| match_labels | map | no | match by label | +| match_expressions | array | no | match_expressions | + +#### match_expressions[x] + +| field | type | required | description | +|----------|--------|------------|-------------------------------------------------------------------------------------------------------------------------| +| key | string | is the key | of the tag | +| operator | string | is the | operator, with optional values: "In", "NotIn", "Exists", "DoesNotExist" | +| values | array | no | Array of strings, cannot be empty if the operator is "In" or "NotIn", must be empty if it is "Exists" or "DoesNotExist" | + +#### rolling_update_strategy + +When strategy_type is RollingUpdate, it is not empty, otherwise it is empty. + +| field | type | mandatory | description | +|-----------------|--------|-----------|-----------------| +| max_unavailable | object | no | max_unavailable | +| max_surge | object | no | max_overflow | + +#### max_unavailable + +| field | type | mandatory | description | +|---------|--------|-----------|-----------------------------------------------------------------------------------| +| type | int | Yes | Optional value of 0 (for int type) or 1 (for string type) | +| int_val | int | No | When type is 0 (for int type), it cannot be null, and the corresponding int value | +| str_val | string | no | when type is 1(for string type),cannot be null,corresponding string value | + +#### max_surge + +| field | type | mandatory | description | +|---------|--------|-----------|------------------------------------------------------------------------------------------| +| type | int | yes | optional value of 0 (for int type) or 1 (for string type) | +| int_val | int | No | When type is 0 (for int type), it cannot be null, and the corresponding int value | +| str_val | string | no | When type is 1 (for string type), it cannot be empty, and the corresponding string value | + +### Example request parameters + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "kind": "deployment", + "ids": [ + 1, + 2, + 3 + ], + "data": { + "labels": { + "test": "test", + "test2": "test2" + }, + "selector": { + "match_labels": { + "test": "test", + "test2": "test2" + }, + "match_expressions": [ + { + "key": "tier", + "operator": "In", + "values": [ + "cache" + ] + } + ] + }, + "replicas": 1, + "strategy_type": "RollingUpdate", + "min_ready_seconds": 1, + "rolling_update_strategy": { + "max_unavailable": { + "type": 0, + "int_val": 1 + }, + "max_surge": { + "type": 0, + "int_val": 1 + } + } + } +} +``` + +### Return Result Example + +```json + +{ + "result": true, + "code": 0, + "data": null, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### Return result parameter description + +#### response + +| name | type | description | +|------------|--------|-------------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. true:request successful; false request failed. | +| code | int | The error code. 0 means success, >0 means failure error. | +| message | string | The error message returned by the failed request. | +| permission | object | Permission information | +| request_id | string | request_chain_id | +| data | object | The data returned by the request. | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/create_kube_cluster.md b/paas2/esb/components/confapis/cc/apidocs/en/create_kube_cluster.md new file mode 100644 index 000000000..ee4446028 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/create_kube_cluster.md @@ -0,0 +1,85 @@ +### Functional description + +create a new container cluster (v3.12.1+, permission: kube cluster editing permissions) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-------------------|--------|----------|--------------------------------------------------------| +| bk_biz_id | int | yes | business ID | +| name | string | yes | cluster name | +| scheduling_engine | string | no | scheduling engine | +| uid | string | yes | cluster own ID | +| xid | string | no | associated cluster ID | +| version | string | no | cluster version | +| network_type | string | no | network type | +| region | string | no | the region where the cluster is located | +| vpc | string | no | vpc network | +| network | array | no | cluster network | +| type | string | yes | cluster type. enum: INDEPENDENT_CLUSTER, SHARE_CLUSTER | +| bk_project_id | string | no | project_id | +| bk_project_name | string | no | project name | +| bk_project_code | string | no | project english name | + +### Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "name": "cluster", + "scheduling_engine": "k8s", + "uid": "xxx", + "xid": "xxx", + "version": "1.1.0", + "network_type": "underlay", + "region": "xxx", + "vpc": "xxx", + "network": [ + "127.0.0.0/21" + ], + "type": "INDEPENDENT_CLUSTER", + "bk_project_id": "21bf9ef9be7c4d38a1d1f2uc0b44a8f2", + "bk_project_name": "test", + "bk_project_code": "test" +} +``` + +### Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "id": 1 + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### Return result parameter + +| Name | Type | Description | +|------------|--------|------------------------------------------------------------------------------------| +| result | bool | Whether the request succeeded or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| data | object | Data returned by request | +| request_id | string | Request chain id | + +### data + +| Name | Type | Description | +|------|------|-------------------------| +| id | int | created kube cluster ID | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/list_kube_cluster.md b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_cluster.md new file mode 100644 index 000000000..503a322f8 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_cluster.md @@ -0,0 +1,211 @@ +### Functional description + +list container clusters (v3.12.1+, permissions: biz access) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-----------|--------|----------|--------------------------------------------------------------------------------------------| +| bk_biz_id | int | yes | business ID | +| filter | object | no | container cluster query scope | +| fields | array | no | the container cluster attribute to be queried, if not written, it means to search all data | +| page | object | yes | paging condition | + +#### filter + +This parameter is the filter rule to search for container based on its attribute fields. This parameter supports the +following two filter rules types. The combined filter rules can be nested with the maximum nesting level of 2. The +specific supported filter rule types are as follows: + +##### combined filter rule + +This filter rule type defines filter rules composed of other rules, the combined rules support logic and/or +relationships + +| Field | Type | Required | Description | +|-----------|--------|----------|----------------------------------------------------------------------------| +| condition | string | yes | query criteria, support `AND` and `OR` | +| rules | array | yes | query rules, can be of `combined filter rule` or `atomic filter rule` type | + +##### atomic filter rule + +This filter rule type defines basic filter rules, which represent rules for filtering a field. Any filter rule is either +directly an atomic filter rule, or a combination of multiple atomic filter rules + +| Field | Type | Required | Description | +|----------|----------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------| +| field | string | yes | cluster's field | +| operator | string | yes | operator, optional values: equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | different fields and operators correspond to different value formats | yes | operand | + +Assembly rules can refer to: + +#### page + +| Field | Type | Required | Description | +|--------------|--------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| start | int | yes | Record start position | +| limit | int | yes | Limit per page, maximum 500 | +| sort | string | no | Sort the field | +| enable_count | bool | yes | The flag defining Whether to get the the number of query objects. If this flag is true, then the request is to get the quantity. The remaining fields must be initialized, start is 0, and limit is: 0, sort is "" | + +**Note:** + +- `enable_count`If this flag is true, this request is a get quantity. The remaining fields must be initialized, start is + 0, and limit is: 0, sort is "." +- `sort`If the caller does not specify it, the background specifies it as the container cluster ID by default. +- Paging parameters must be set, and the maximum query data at one time does not exceed 500. + +### Request Parameters Example + +### Request Details Request Parameters + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "scheduling_engine", + "operator": "equal", + "value": "k8s" + }, + { + "field": "version", + "operator": "equal", + "value": "1.1.0" + } + ] + }, + "page": { + "start": 0, + "limit": 500, + "enable_count": false + } +} +``` + +### get quantity request parameters + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "filter": { + "condition": "AND", + "rules": [ + { + "field": "scheduling_engine", + "operator": "equal", + "value": "k8s" + }, + { + "field": "version", + "operator": "equal", + "value": "1.1.0" + } + ] + }, + "page": { + "start": 0, + "limit": 0, + "enable_count": true + } +} +``` + +### Return Result Example + +### Details interface response + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "count": 0, + "info": [ + { + "name": "cluster", + "scheduling_engine": "k8s", + "uid": "xxx", + "xid": "xxx", + "version": "1.1.0", + "network_type": "underlay", + "region": "xxx", + "vpc": "xxx", + "network": "127.0.0.0/21", + "type": "INDEPENDENT_CLUSTER" + } + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### kube cluster quantity interface response + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "count": 1, + "info": [ + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### Return Result Parameters Description + +| Name | Type | Description | +|------------|--------|------------------------------------------------------------------------------------| +| result | bool | Whether the request succeeded or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| data | object | Data returned by request | +| request_id | string | Request chain id | + +#### data + +| Field | Type | Description | +|-------|-------|---------------------| +| count | int | Number of records | +| info | array | Actual cluster data | + +#### info[x] + +| Field | Type | Required | Description | +|-------------------|--------|----------|-----------------------------------------| +| name | string | no | cluster | +| scheduling_engine | string | no | scheduling engine | +| uid | string | no | cluster own ID | +| xid | string | no | associated cluster ID | +| version | string | no | cluster version | +| network_type | string | no | network type | +| region | string | no | the region where the cluster is located | +| vpc | string | no | vpc network | +| network | array | no | cluster network | +| type | string | no | cluster type | + +**Note:** + +- If this request is to query details, count is 0. If the query is quantity, info is empty. diff --git a/paas2/esb/components/confapis/cc/apidocs/en/list_kube_container.md b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_container.md new file mode 100644 index 000000000..14fc86e4a --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_container.md @@ -0,0 +1,234 @@ +### Functional description + +list kube container (version: v3.12.1+, auth: biz access) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-----------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------| +| bk_biz_id | int | yes | biz id | +| bk_pod_id | int | yes | pod id | +| filter | object | no | container query filter | +| fields | array | yes | container attribute list, controls which fields in the container will be returned, can speed up the request and reduce network traffic transmission | +| page | object | yes | paging info | + +#### filter + +This parameter is the filter rule to search for container based on its attribute fields. This parameter supports the +following two filter rules types. The combined filter rules can be nested with the maximum nesting level of 2. The +specific supported filter rule types are as follows: + +##### combined filter rule + +This filter rule type defines filter rules composed of other rules, the combined rules support logic and/or +relationships + +| Field | Type | Required | Description | +|-----------|--------|----------|----------------------------------------------------------------------------| +| condition | string | yes | query criteria, support `AND` and `OR` | +| rules | array | yes | query rules, can be of `combined filter rule` or `atomic filter rule` type | + +##### atomic filter rule + +This filter rule type defines basic filter rules, which represent rules for filtering a field. Any filter rule is either +directly an atomic filter rule, or a combination of multiple atomic filter rules + +| Field | Type | Required | Description | +|----------|----------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------| +| field | string | yes | container's field | +| operator | string | yes | operator, optional values: equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | different fields and operators correspond to different value formats | yes | operand | + +Assembly rules can refer to: + +#### page + +| Field | Type | Required | Description | +|--------------|--------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| start | int | yes | Record start position | +| limit | int | yes | Limit per page, maximum 500 | +| sort | string | no | Sort the field | +| enable_count | bool | yes | The flag defining Whether to get the the number of query objects. If this flag is true, then the request is to get the quantity. The remaining fields must be initialized, start is 0, and limit is: 0, sort is "" | + +**Note:** + +- `enable_count`If this flag is true, this request is a get quantity. The remaining fields must be initialized, start is + 0, and limit is: 0, sort is "." +- Paging parameters must be set, and the maximum query data at one time does not exceed 500. + +### Request Parameters Example + +#### Query Detail Request Parameters Example + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_biz_id": 4, + "bk_pod_id": 4, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "name", + "operator": "not_equal", + "value": "container1" + }, + { + "condition": "OR", + "rules": [ + { + "field": "container_uid", + "operator": "not_in", + "value": [ + "xxxxxx" + ] + }, + { + "field": "image", + "operator": "equal", + "value": "ccr.ccs.tencentyun.com/library/coredns:1.6.2" + } + ] + } + ] + }, + "fields": [ + "name", + "uid" + ], + "page": { + "start": 0, + "limit": 10, + "sort": "name", + "enable_count": false + } +} +``` + +#### Query Quantity Request Parameters Example + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_biz_id": 4, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "name", + "operator": "not_equal", + "value": "container1" + }, + { + "condition": "OR", + "rules": [ + { + "field": "container_uid", + "operator": "not_in", + "value": [ + "xxxxxx" + ] + }, + { + "field": "image", + "operator": "equal", + "value": "xxx" + } + ] + } + ] + }, + "page": { + "enable_count": true + } +} +``` + +### Return Result Example + +#### Query Detail Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 0, + "info": [ + { + "name": "container2", + "container_uid": "xxx" + }, + { + "name": "container3", + "container_uid": "xxx" + } + ] + } +} +``` + +#### Query Quantity Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 10, + "info": [] + } +} +``` + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| request_id | string | Request chain id | +| data | object | Data returned by request | + +#### data + +| Field | Type | Description | +|-------|-------|-----------------------------------------------------------------| +| count | int | Number of containers | +| info | array | Container list, only returns the fields that is set in `fields` | + +#### info[x] + +| Field | Type | Description | +|---------------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| name | string | container name | +| container_uid | string | container uid | +| image | string | container image | +| ports | object array | container port information list, format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#containerport-v1-core | +| args | string array | start arguments | +| started | timestamp | start time | +| limits | object | resource limits, official documentation: https://kubernetes.io/zh/docs/concepts/policy/resource-quotas/ | +| requests | object | resource requests, official documentation: https://kubernetes.io/zh/docs/concepts/policy/resource-quotas/ | +| liveness | object | liveness probe, official documentation: https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ , format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#probe-v1-core | +| environment | object array | environment variables, official documentation: https://kubernetes.io/zh/docs/tasks/inject-data-application/define-environment-variable-container/ , format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#envvar-v1-core | +| mounts | object array | volume mounts, official documentation: https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-volume-storage/ , format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#volumemount-v1-core | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/list_kube_namespace.md b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_namespace.md new file mode 100644 index 000000000..fddd66f7d --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_namespace.md @@ -0,0 +1,262 @@ +### Functional description + +Query namespace(version: v3.12.1+, auth: biz access) + +### Request parameters + +{{ common_args_desc }} + +#### Interface parameters + +- common fields. + +| field | type | required | description | +|-----------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------| +| bk_biz_id | int | Yes | business id | +| filter | object | no | query criteria | +| fields | array | No | A list of attributes that control which fields are returned in the result, to speed up interface requests and reduce network traffic transfer | +| page | object | yes | paging information | + +#### filter + +This parameter is the filter rule to search for container based on its attribute fields. This parameter supports the +following two filter rules types. The combined filter rules can be nested with the maximum nesting level of 2. The +specific supported filter rule types are as follows: + +##### combined filter rule + +This filter rule type defines filter rules composed of other rules, the combined rules support logic and/or +relationships + +| Field | Type | Required | Description | +|-----------|--------|----------|----------------------------------------------------------------------------| +| condition | string | yes | query criteria, support `AND` and `OR` | +| rules | array | yes | query rules, can be of `combined filter rule` or `atomic filter rule` type | + +##### atomic filter rule + +This filter rule type defines basic filter rules, which represent rules for filtering a field. Any filter rule is either +directly an atomic filter rule, or a combination of multiple atomic filter rules + +| Field | Type | Required | Description | +|----------|----------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------| +| field | string | yes | namespace's field | +| operator | string | yes | operator, optional values: equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | different fields and operators correspond to different value formats | yes | operand | + +Assembly rules can refer to: + +#### page + +| field | type | required | description | +|--------------|--------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| start | int | Yes | Record start position | +| limit | int | Yes | Limit the number of entries per page, up to 500 | +| sort | string | No | Sort field | +| enable_count | bool | Yes | A flag for whether to get the number of query objects. If this flag is true then the request is to get the number, the rest of the fields must be initialized, start is 0, limit is :0, sort is "" | + +**Note:** + +- `enable_count`If this flag is true, this request is a get quantity. The remaining fields must be initialized, start is + 0, and limit is: 0, sort is "." +- Paging parameters must be set, and the maximum query data at one time does not exceed 500. + +### Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "bk_cluster_id", + "operator": "equal", + "value": 1 + }, + { + "field": "name", + "operator": "equal", + "value": "test" + } + ] + }, + "fields": [ + "name" + ], + "page": { + "start": 0, + "limit": 10, + "sort": "name", + "enable_count": false + } +} +``` + +- The second, using a unique identifier in cc. + +| field | type | required | description | +|---------------|------|----------|---------------------------| +| bk_cluster_id | int | No | cluster's unique id in cc | + +### Request Parameters Example + +#### Query Detail Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "bk_cluster_id": 1, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "name", + "operator": "equal", + "value": "test" + } + ] + }, + "fields": [ + "name" + ], + "page": { + "start": 0, + "limit": 10, + "sort": "name", + "enable_count": false + } +} +``` + +#### Query Quantity Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "bk_cluster_id", + "operator": "equal", + "value": 1 + }, + { + "field": "name", + "operator": "equal", + "value": "test" + } + ] + }, + "page": { + "enable_count": true + } +} +``` + +### Return Result Example + +#### Query Detail Return Result Example + +```json + +{ + "result": true, + "code": 0, + "data": { + "count": 0, + "info": [ + { + "name": "test" + } + ] + }, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +#### Query Quantity Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "count": 100, + "info": [ + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### Return Result Parameters Description + +#### response + +| name | type | description | +|------------|--------|-------------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. true:request successful; false request failed. | +| code | int | The error code. 0 means success, >0 means failure error. | +| message | string | The error message returned by the failed request. | +| permission | object | Permission information | +| request_id | string | request_chain_id | +| data | object | data returned by the request | + +#### data + +| field | type | description | +|-------|-------|----------------------------------------------------------| +| count | int | Number of records | +| info | array | The actual data, returning only the fields set in fields | + +#### info[x] + +| field | type | description | +|-----------------|--------|----------------------------------------------| +| name | string | namespace name | +| labels | map | labels | +| resource_quotas | array | namespace CPU and memory requests and limits | + +#### info[x].resource_quotas[x] + +| field | type | description | +|----------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------| +| hard | object | hard limits required per named resource | +| scopes | array | Quota scopes, with optional values of "Terminating", "NotTerminating", "BestEffort", "NotBestEffort", "PriorityClass", "CrossNamespacePodAffinity" |. +| scope_selector | object | scope selector | + +#### info[x].resource_quotas[x].scope_selector + +| field | type | description | +|-------------------|-------|-------------------| +| match_expressions | array | match_expressions | + +#### info[x].resource_quotas[x].scope_selector.match_expressions[x] + +| field | type | description | +|------------|--------|------------------------------------------------------------------------------------------------------------------------------| +| scope_name | array | Quota scope, optional values are: "Terminating", "NotTerminating", "BestEffort", "NotBe | +| operator | string | selector operator,optional values are:"In"、"NotIn"、"Exists"、"DoesNotExist" | +| values | array | string array,if the operator is "In"or "NotIn",can not be null,if the operator is "Exists" or "DoesNotExist",it must be null | + +**Note:** + +- If this request is to query details, count is 0. If the query is quantity, info is empty. diff --git a/paas2/esb/components/confapis/cc/apidocs/en/list_kube_node.md b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_node.md new file mode 100644 index 000000000..027fd8ea4 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_node.md @@ -0,0 +1,233 @@ +### Functional description + +list container nodes (v3.12.1+, permission: biz access) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-----------|--------|----------|------------------------------------------------------------------------------------------------| +| bk_biz_id | int | yes | business ID | +| filter | object | no | Container node query scope | +| fields | array | no | The attribute of the container node to be queried, if not written, it means to search all data | +| page | object | yes | Paging condition | + +#### filter + +This parameter is the filter rule to search for container based on its attribute fields. This parameter supports the +following two filter rules types. The combined filter rules can be nested with the maximum nesting level of 2. The +specific supported filter rule types are as follows: + +##### combined filter rule + +This filter rule type defines filter rules composed of other rules, the combined rules support logic and/or +relationships + +| Field | Type | Required | Description | +|-----------|--------|----------|----------------------------------------------------------------------------| +| condition | string | yes | query criteria, support `AND` and `OR` | +| rules | array | yes | query rules, can be of `combined filter rule` or `atomic filter rule` type | + +##### atomic filter rule + +This filter rule type defines basic filter rules, which represent rules for filtering a field. Any filter rule is either +directly an atomic filter rule, or a combination of multiple atomic filter rules + +| Field | Type | Required | Description | +|----------|----------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------| +| field | string | yes | node's field | +| operator | string | yes | operator, optional values: equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | different fields and operators correspond to different value formats | yes | operand | + +Assembly rules can refer to: + +#### page + +| Field | Type | Required | Description | +|--------------|--------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| start | int | yes | Record start position | +| limit | int | yes | Limit per page, maximum 500 | +| sort | string | no | Sort the field | +| enable_count | bool | yes | The flag defining Whether to get the the number of query objects. If this flag is true, then the request is to get the quantity. The remaining fields must be initialized, start is 0, and limit is: 0, sort is "" | + +**Note:** + +- `enable_count`If this flag is true, this request is a get quantity. The remaining fields must be initialized, start is + 0, and limit is: 0, sort is "." +- `sort`If the caller does not specify it, the background specifies it as the container node ID by default. +- Paging parameters must be set, and the maximum query data at one time does not exceed 500. +- bk_cluster_id and cluster_uid cannot be empty or filled at the same time. + +### Request Parameters Example + +### Request Details Request Parameters + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "filter": { + "condition": "OR", + "rules": [ + { + "field": "id", + "operator": "equal", + "value": 10 + }, + { + "field": "bk_cluster_id", + "operator": "equal", + "value": 10 + }, + { + "field": "hostname", + "operator": "equal", + "value": "name" + } + ] + }, + "page": { + "enable_count": false, + "start": 0, + "limit": 500 + } +} +``` + +### get quantity request parameters + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "filter": { + "condition": "OR", + "rules": [ + { + "field": "id", + "operator": "equal", + "value": 10 + }, + { + "field": "bk_cluster_id", + "operator": "equal", + "value": 10 + }, + { + "field": "hostname", + "operator": "equal", + "value": "name" + } + ] + }, + "page": { + "enable_count": true, + "start": 0, + "limit": 0 + } +} +``` + +### Return Result Example + +### Details interface response + +```json +{ + "result": true, + "bk_error_code": 0, + "bk_error_msg": "success", + "permission": null, + "data": { + "count": 0, + "info": [ + { + "name": "k8s", + "roles": "master", + "labels": { + "env": "test" + }, + "taints": { + "type": "gpu" + }, + "unschedulable": false, + "internal_ip": [ + "127.0.0.1" + ], + "external_ip": [ + "127.0.0.1" + ], + "hostname": "name", + "runtime_component": "runtime_component", + "kube_proxy_mode": "ipvs", + "pod_cidr": "127.0.0.128/26" + } + ] + } +} +``` + +### kube node quantity interface response + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "count": 1, + "info": [ + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### Return Result Parameters Description + +| Name | Type | Description | +|------------|--------|------------------------------------------------------------------------------------| +| result | bool | Whether the request succeeded or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| data | object | Data returned by request | +| request_id | string | Request chain id | + +#### data + +| Field | Type | Description | +|-------|-------|-------------------| +| count | int | Number of records | +| info | array | Actual node data | + +#### info[x] + +| Field | Type | Required | Description | +|-------------------|--------|----------|--------------------------------------------------------------------------------------| +| name | string | yes | node name | +| roles | string | no | node roles | +| labels | object | no | label | +| taints | object | no | taints | +| unschedulable | bool | no | Whether to turn off schedulable, true means not schedulable, false means schedulable | +| internal_ip | array | no | internal ip | +| external_ip | array | no | external ip | +| hostname | string | no | hostname | +| runtime_component | string | no | runtime components | +| kube_proxy_mode | string | no | kube-proxy proxy mode | +| pod_cidr | string | no | The allocation range of the Pod address of this node | + +**Note:** + +- If this request is to query details, count is 0. If the query is quantity, info is empty. + diff --git a/paas2/esb/components/confapis/cc/apidocs/en/list_kube_pod.md b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_pod.md new file mode 100644 index 000000000..20eda01d6 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_pod.md @@ -0,0 +1,234 @@ +### Functional description + +list kube pod (version: v3.12.1+, auth: biz access) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-----------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------------| +| bk_biz_id | int | yes | biz id | +| filter | object | no | pod query filter | +| fields | array | yes | pod attribute list, controls which fields in the pod will be returned, can speed up the request and reduce network traffic transmission | +| page | object | yes | paging info | + +#### Filter + +This parameter is the filter rule to search for pod based on its attribute fields. This parameter supports the following +two filter rules types. The combined filter rules can be nested with the maximum nesting level of 2. The specific +supported filter rule types are as follows: + +##### Combined Filter Rule + +This filter rule type defines filter rules composed of other rules, the combined rules support logic and/or +relationships + +| Field | Type | Required | Description | +|-----------|--------|----------|----------------------------------------------------------------------------| +| condition | string | yes | query criteria, support `AND` and `OR` | +| rules | array | yes | query rules, can be of `Combined Filter Rule` or `Atomic Filter Rule` type | + +##### Atomic Filter Rule + +This filter rule type defines basic filter rules, which represent rules for filtering a field. Any filter rule is either +directly an atomic filter rule, or a combination of multiple atomic filter rules + +| Field | Type | Required | Description | +|----------|----------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------| +| field | string | yes | pod's field | +| operator | string | yes | operator, optional values: equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | different fields and operators correspond to different value formats | yes | operand | + +Assembly rules can refer to: + +#### Page + +| Field | Type | Required | Description | +|--------------|--------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| start | int | yes | Record start position | +| limit | int | yes | Limit per page, maximum 500 | +| sort | string | no | Sort the field | +| enable_count | bool | yes | The flag defining Whether to get the the number of query objects. If this flag is true, then the request is to get the quantity. The remaining fields must be initialized, start is 0, and limit is: 0, sort is "" | + +**Note:** + +- `enable_count`If this flag is true, this request is a get quantity. The remaining fields must be initialized, start is + 0, and limit is: 0, sort is "." +- Paging parameters must be set, and the maximum query data at one time does not exceed 500. + +### Request Parameters Example + +#### Query Detail Request Parameters Example + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_biz_id": 4, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "name", + "operator": "not_equal", + "value": "pod1" + }, + { + "condition": "OR", + "rules": [ + { + "field": "priority", + "operator": "not_in", + "value": [ + 2, + 6 + ] + }, + { + "field": "qos_class", + "operator": "equal", + "value": "Burstable" + } + ] + } + ] + }, + "fields": [ + "name", + "priority" + ], + "page": { + "start": 0, + "limit": 10, + "sort": "name", + "enable_count": false + } +} +``` + +#### Query Quantity Request Parameters Example + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_biz_id": 4, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "name", + "operator": "not_equal", + "value": "pod1" + }, + { + "condition": "OR", + "rules": [ + { + "field": "priority", + "operator": "not_in", + "value": [ + 2, + 6 + ] + }, + { + "field": "qos_class", + "operator": "equal", + "value": "Burstable" + } + ] + } + ] + }, + "page": { + "enable_count": true + } +} +``` + +### Return Result Example + +#### Query Detail Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 0, + "info": [ + { + "name": "pod2", + "priority": 1 + }, + { + "name": "pod3", + "priority": 5 + } + ] + } +} +``` + +#### Query Quantity Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 10, + "info": [] + } +} +``` + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| request_id | string | Request chain id | +| data | object | Data returned by request | + +#### data + +| Field | Type | Description | +|-------|-------|-----------------------------------------------------------| +| count | int | Number of pods | +| info | array | Pod list, only returns the fields that is set in `fields` | + +#### info[x] + +| Field | Type | Description | +|----------------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| name | string | pod name | +| priority | int | pod priority | +| labels | string map | pod labels, key and value are all string, official documentation: http://kubernetes.io/docs/user-guide/labels | +| ip | string | pod ip | +| ips | object array | pod ip list, format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#podip-v1-core | +| volumes | object array | pod volume info list, official documentation: https://kubernetes.io/zh/docs/concepts/storage/volumes/ , format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#volume-v1-core | +| qos_class | enum | quality of service class, official documentation: https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/quality-service-pod/ | +| node_selectors | string map | node label selectors, key and value are all string, official documentation: https://kubernetes.io/zh/docs/concepts/scheduling-eviction/assign-pod-node/ | +| tolerations | object array | pod toleration list, format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#toleration-v1-core | +| operator | string array | pod operator | +| containers | object array | container information list | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/list_kube_workload.md b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_workload.md new file mode 100644 index 000000000..331dd2655 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/list_kube_workload.md @@ -0,0 +1,261 @@ +### Function Description + +Query workload (version: v3.12.1+, auth: biz access) + +### Request parameters + +{{ common_args_desc }} + +#### Interface parameters + +- Common fields. + +| field | type | mandatory | description | +|-----------|--------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| bk_biz_id | int | yes | business id | +| kind | string | yes | workload type, the current built-in workload types are deployment, daemonSet, statefulSet, gameStatefulSet, gameDeployment, cronJob, job, pods (put those who do not pass workload but directly create Pod) | +| filter | object | no | query condition | +| fields | array | No | A list of attributes that control which fields are returned in the result, to speed up interface requests and reduce network traffic transfer | +| page | object | yes | paging information | + +#### filter + +This parameter is the filter rule to search for container based on its attribute fields. This parameter supports the +following two filter rules types. The combined filter rules can be nested with the maximum nesting level of 2. The +specific supported filter rule types are as follows: + +##### combined filter rule + +This filter rule type defines filter rules composed of other rules, the combined rules support logic and/or +relationships + +| Field | Type | Required | Description | +|-----------|--------|----------|----------------------------------------------------------------------------| +| condition | string | yes | query criteria, support `AND` and `OR` | +| rules | array | yes | query rules, can be of `combined filter rule` or `atomic filter rule` type | + +##### atomic filter rule + +This filter rule type defines basic filter rules, which represent rules for filtering a field. Any filter rule is either +directly an atomic filter rule, or a combination of multiple atomic filter rules + +| Field | Type | Required | Description | +|----------|----------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------| +| field | string | yes | workload's field | +| operator | string | yes | operator, optional values: equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | different fields and operators correspond to different value formats | yes | operand | + +Assembly rules can refer to: + +#### page + +| field | type | required | description | +|--------------|--------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| start | int | Yes | Record start position | +| limit | int | Yes | Limit the number of entries per page, up to 500 | +| sort | string | No | Sort field | +| enable_count | bool | Yes | A flag for whether to get the number of query objects. If this flag is true then the request is to get the number, the rest of the fields must be initialized, start is 0, limit is :0, sort is "" | + +**Note:** + +- `enable_count`If this flag is true, this request is a get quantity. The remaining fields must be initialized, start is + 0, and limit is: 0, sort is "." +- Paging parameters must be set, and the maximum query data at one time does not exceed 500. + +### Example request parameters + +#### Query Detail Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "kind": "deployment", + "filter": { + "condition": "AND", + "rules": [ + { + "field": "cluster_uid", + "operator": "equal", + "value": "1" + }, + { + "field": "namespace", + "operator": "equal", + "value": "namespace1" + }, + { + "field": "name", + "operator": "equal", + "value": "test" + } + ] + }, + "fields": [ + "name" + ], + "page": { + "start": 0, + "limit": 10, + "sort": "name", + "enable_count": false + } +} +``` + +#### Query Quantity Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "kind": "deployment", + "filter": { + "condition": "AND", + "rules": [ + { + "field": "cluster_uid", + "operator": "equal", + "value": "1" + }, + { + "field": "namespace", + "operator": "equal", + "value": "namespace1" + }, + { + "field": "name", + "operator": "equal", + "value": "test" + } + ] + }, + "fields": [ + "name" + ], + "page": { + "enable_count": true + } +} +``` + +### Return Result Example + +#### Query Detail Return Result Example + +```json + +{ + "result": true, + "code": 0, + "data": { + "count": 0, + "info": [ + { + "name": "test" + } + ] + }, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +#### Query Quantity Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 10, + "info": [] + } +} +``` + +### Return result parameter description + +#### response + +| name | type | description | +|------------|--------|-------------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. true:request successful; false request failed. | +| code | int | The error code. 0 means success, >0 means failure error. | +| message | string | The error message returned by the failed request. | +| permission | object | Permission information | +| request_id | string | request_chain_id | +| data | object | data returned by the request | + +#### data + +| field | type | description | +|-------|-------|----------------------------------------------------------| +| count | int | Number of records | +| info | array | The actual data, returning only the fields set in fields | + +#### info[x] + +| Field | Type | Description | +|-------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------| +| name | string | workload name | +| labels | map | label | +| selector | object | workload selector | +| replicas | int | number of workload instances | +| strategy_type | string | workload update mechanism | +| min_ready_seconds | int | Specifies the minimum time a newly created Pod will be ready without any container crashes, and only after that time will the Pod be considered available | +| rolling_update_strategy | object | rolling update strategy | + +#### selector + +| field | type | description | +|-------------------|-------|-------------------| +| match_labels | map | match_by_label | +| match_expressions | array | match expressions | + +#### match_expressions[x] + +| field | type | description | +|----------|--------|-------------------------------------------------------------------------------------------------------------------------| +| key | string | key of tag | +| operator | string | operator, optional values: "In", "NotIn", "Exists", "DoesNotExist" | +| values | array | array of strings, cannot be empty if the operator is "In" or "NotIn", must be empty if it is "Exists" or "DoesNotExist" | + +#### rolling_update_strategy + +When strategy_type is RollingUpdate, it is not empty, otherwise it is empty. + +| field | type | description | +|-----------------|--------|-----------------| +| max_unavailable | object | max_unavailable | object +| max_surge | object | max_overflow | + +#### max_unavailable + +| field | type | description | +|---------|--------|--------------------------------------------------------------| +| type | int | Optional values of 0 (for int types) or 1 (for string types) | +| int_val | int | When type is 0 (for int type), the corresponding int value | +| str_val | string | when type is 1(string type),the corresponding string value | + +#### max_surge + +| field | type | description | +|---------|--------|------------------------------------------------------------| +| type | int | optional value of 0 (for int type) or 1 (for string type) | +| int_val | int | When type is 0 (for int type), the corresponding int value | +| str_val | string | when type is 1(string type),the corresponding string value | + +**Note:** + +- If this request is to query details, count is 0. If the query is quantity, info is empty. diff --git a/paas2/esb/components/confapis/cc/apidocs/en/list_service_template_sync_status.md b/paas2/esb/components/confapis/cc/apidocs/en/list_service_template_sync_status.md new file mode 100644 index 000000000..ce21cca11 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/list_service_template_sync_status.md @@ -0,0 +1,99 @@ +Functional description + +Example Query the synchronization status of a service template(v3.12.3+, permission: biz access) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|---------------------|-------|----------|-------------------------------------------------------------------| +| bk_biz_id | int | yes | Business ID | +| service_template_id | int | yes | Service template ID | +| bk_module_ids | array | yes | List of module ids whose synchronization status you want to query | + +### Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "service_template_id": 1, + "bk_module_ids": [ + 28, + 29, + 30 + ] +} +``` + +### Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "e43da4ef221746868dc4c837d36f3807", + "data": [ + { + "bk_inst_id": 30, + "status": "finished", + "creator": "admin", + "create_time": "2023-10-07T12:43:22.795Z", + "last_time": "2023-11-10T03:37:31.009Z" + }, + { + "bk_inst_id": 29, + "status": "finished", + "creator": "admin", + "create_time": "2023-10-07T07:22:43.167Z", + "last_time": "2023-11-10T03:37:31.005Z" + }, + { + "bk_inst_id": 28, + "status": "new", + "creator": "admin", + "create_time": "2023-11-30T09:52:13.706Z", + "last_time": "2023-11-30T09:52:13.706Z" + } + ] +} +``` + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| request_id | string | Request chain id | +| data | array | Data returned by request | + +#### data + +| Name | Type | Description | +|-------------|--------|--------------------------------------------------| +| bk_inst_id | int | Instance id, where is the module ID | +| status | string | Synchronous status | +| creator | string | The creator of a synchronization task | +| create_time | string | The create time of the synchronization task | +| last_time | string | The last update time of the synchronization task | + +**Synchronization status declaration**: An instance has six states: need_sync, new, waiting, executing, finished, and +failure,among: + +- **need_sync** Indicates to be synchronized +- **new/waiting/executing** Indicates synchronization +- **finished** Indicates synchronization complete +- **failure** Indicates synchronization failure diff --git a/paas2/esb/components/confapis/cc/apidocs/en/sync_service_template_to_service_instance.md b/paas2/esb/components/confapis/cc/apidocs/en/sync_service_template_to_service_instance.md new file mode 100644 index 000000000..82cb57917 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/sync_service_template_to_service_instance.md @@ -0,0 +1,57 @@ +### Functional description + +Synchronize the service template information to the corresponding service instance(v3.12.3+, permission: service instance create, edit, and delete permission) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|---------------------|-------|----------|------------------------------------------| +| bk_biz_id | int | yes | Business ID | +| service_template_id | int | yes | Service template ID | +| bk_module_ids | array | yes | ID list of the module to be synchronized | + +### Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "service_template_id": 1, + "bk_module_ids": [ + 28 + ] +} +``` + +### Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "e43da4ef221746868dc4c837d36f3807", + "data": null +} +``` + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| request_id | string | Request chain id | +| data | object | Data returned by request | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/update_kube_cluster_type.md b/paas2/esb/components/confapis/cc/apidocs/en/update_kube_cluster_type.md new file mode 100644 index 000000000..787e126ea --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/update_kube_cluster_type.md @@ -0,0 +1,55 @@ +### Functional description + +update container cluster type (v3.12.1+, permission: kube cluster editing permissions) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|-----------|--------|----------|--------------------------------------------------------| +| bk_biz_id | int | yes | business ID | +| id | int | yes | unique ID of the cluster in cmdb | +| type | string | yes | cluster type. enum: INDEPENDENT_CLUSTER, SHARE_CLUSTER | + +### Request Parameters Example + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "id": 1, + "type": "INDEPENDENT_CLUSTER" +} +``` + +### Return Result Example + +```json + { + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": null +} +``` + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| request_id | string | Request chain id | +| data | object | Data returned by request | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_namespace.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_namespace.md new file mode 100644 index 000000000..3933a7e72 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_namespace.md @@ -0,0 +1,128 @@ +### 功能描述 + +批量创建namespace (版本:v3.12.1+,权限:容器命名空间新建) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|-------|-----|------------------------| +| bk_biz_id | int | 是 | 业务id | +| data | array | 是 | namespace数组, 一次限制创建200 | + +#### data[x] + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|--------|-----|----------------------------| +| bk_cluster_id | int | 是 | cmdb里标识cluster的唯一id | +| name | string | 是 | 命名空间名称 | +| labels | map | 否 | 标签 | +| resource_quotas | array | 否 | 命名空间CPU与内存的requests与limits | + +#### resource_quotas[x] + +| 字段 | 类型 | 必选 | 描述 | +|----------------|--------|-----|--------------------------------------------------------------------------------------------------------------------| +| hard | object | 否 | 每个命名资源所需的硬限制 | +| scopes | array | 否 | 配额作用域,可选值为:"Terminating"、"NotTerminating"、"BestEffort"、"NotBestEffort"、"PriorityClass"、"CrossNamespacePodAffinity" | +| scope_selector | object | 否 | 作用域选择器 | + +#### scope_selector + +| 字段 | 类型 | 必选 | 描述 | +|-------------------|-----|-------|-------| +| match_expressions | 否 | array | 匹配表达式 | + +#### match_expressions[x] + +| 字段 | 类型 | 必选 | 描述 | +|------------|--------|-----|--------------------------------------------------------------------------------------------------------------------| +| scope_name | array | 是 | 配额作用域,可选值为:"Terminating"、"NotTerminating"、"BestEffort"、"NotBestEffort"、"PriorityClass"、"CrossNamespacePodAffinity" | +| operator | string | 是 | 选择器操作符,可选值为:"In"、"NotIn"、"Exists"、"DoesNotExist" | +| values | array | 否 | 字符串数组,如果操作符为"In"或"NotIn",不能为空,如果为"Exists"或"DoesNotExist",必须为空 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "data": [ + { + "bk_cluster_id": 1, + "name": "test", + "labels": { + "test": "test", + "test2": "test2" + }, + "resource_quotas": [ + { + "hard": { + "memory": "20000Gi", + "pods": "100", + "cpu": "10k" + }, + "scope_selector": { + "match_expressions": [ + { + "values": [ + "high" + ], + "operator": "In", + "scope_name": "PriorityClass" + } + ] + } + } + ] + } + ] +} +``` + +### 返回结果示例 + +```json + +{ + "result": true, + "code": 0, + "data": { + "ids": [ + 1 + ] + }, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +**注意:** + +- 返回的data中的namespaceID数组顺序与参数中的数组数据顺序保持一致。 + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | + +#### data + +| 字段 | 类型 | 描述 | +|-----|-------|----------------------| +| ids | array | namespace在cc中的唯一标识数组 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_node.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_node.md new file mode 100644 index 000000000..8f85d8ede --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_node.md @@ -0,0 +1,136 @@ +### 功能描述 + +新建容器节点(v3.12.1+,权限:容器节点的创建权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|-------|-----|---------------| +| bk_biz_id | int | 是 | 业务ID | +| data | array | 是 | 需要创建的node具体信息 | + +#### data[x] + +| 字段 | 类型 | 必选 | 描述 | +|-------------------|--------|-----|------------------------------| +| bk_cluster_id | int | 是 | 容器集群在cmdb中的ID | +| bk_host_id | int | 是 | 关联的主机ID | +| name | string | 是 | 节点名称 | +| roles | string | 否 | 节点类型 | +| labels | object | 否 | 标签 | +| taints | object | 否 | 污点 | +| unschedulable | bool | 否 | 是否关闭可调度,true为不可调度,false代表可调度 | +| internal_ip | array | 否 | 内网IP | +| external_ip | array | 否 | 外网IP | +| hostname | string | 否 | 主机名 | +| runtime_component | string | 否 | 运行时组件 | +| kube_proxy_mode | string | 否 | kube-proxy 代理模式 | +| pod_cidr | string | 否 | 此节点Pod地址的分配范围 | + +### 请求参数示例 + +```json + { + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "data": [ + { + "bk_host_id": 1, + "bk_cluster_id": 1, + "name": "k8s", + "roles": "master", + "labels": { + "env": "test" + }, + "taints": { + "type": "gpu" + }, + "unschedulable": false, + "internal_ip": [ + "127.0.0.1" + ], + "external_ip": [ + "127.0.0.1" + ], + "hostname": "xxx", + "runtime_component": "runtime_component", + "kube_proxy_mode": "ipvs", + "pod_cidr": "127.0.0.1/26" + }, + { + "bk_host_id": 2, + "bk_cluster_id": 1, + "name": "k8s-node", + "roles": "master", + "labels": { + "env": "test" + }, + "taints": { + "type": "gpu" + }, + "unschedulable": false, + "internal_ip": [ + "127.0.0.1" + ], + "external_ip": [ + "127.0.0.2" + ], + "hostname": "xxx", + "runtime_component": "runtime_component", + "kube_proxy_mode": "ipvs", + "pod_cidr": "127.0.0.1/26" + } + ] +} +``` + +**注意:** + +- internal_ip 和external_ip不能同时为空。 +- 一次性创建节点数量不超过100个。 + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "ids": [ + 1, + 2 + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +**注意:** + +- 返回的data中的节点ID数组顺序与参数中的数组数据顺序保持一致。 + +### 返回结果参数说明 + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| data | object | 请求返回的数据 | +| request_id | string | 请求链ID | + +### data + +| 名称 | 类型 | 描述 | +|-----|-------|-------------| +| ids | array | 创建的容器节点ID列表 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_pod.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_pod.md new file mode 100644 index 000000000..8293322df --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_pod.md @@ -0,0 +1,191 @@ +### 功能描述 + +新建容器Pod及container(v3.12.1+,权限:容器pod的创建权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|------|-------|-----|--------------| +| data | array | 是 | 所要创建pod的详细信息 | + +#### data[x] + +| 字段 | 类型 | 必选 | 描述 | +|-----------|-------|-----|-----------------| +| bk_biz_id | int | 是 | 业务ID | +| pods | array | 是 | 此业务下要创建pod的详细信息 | + +#### pods[x] + +| 字段 | 类型 | 必选 | 描述 | +|----------------|--------------|----|--------------| +| spec | object | 是 | pod关联信息 | +| bk_host_id | int | 是 | pod关联host id | +| name | string | 是 | pod名称 | +| operator | string array | 是 | pod负责人 | +| priority | object | 否 | 优先级 | +| labels | object | 否 | 标签 | +| ip | string | 否 | 容器网络IP | +| ips | array | 否 | 容器网络IP数组 | +| volumes | object | 否 | 卷信息 | +| qos_class | string | 否 | 服务质量 | +| node_selectors | object | 否 | 节点标签选择器 | +| tolerations | object | 否 | 容忍度 | +| containers | array | 否 | 容器信息 | + +#### spec + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|--------|-----|--------------------| +| bk_cluster_id | int | 是 | pod所在集群的ID | +| bk_namespace_id | int | 是 | pod所属于namespace的ID | +| bk_node_id | int | 是 | pod所在node的ID | +| ref | object | 是 | pod对应workload的相关信息 | + +#### ref + +| 字段 | 类型 | 必选 | 描述 | +|------|-----|-----|---------------------------| +| kind | int | 是 | pod相关联的workload类别,具体类别见注意 | +| id | int | 是 | pod相关联的workload的ID | + +#### containers[x] + +| 字段 | 类型 | 必选 | 描述 | +|---------------|--------|-----|--------| +| name | string | 是 | 容器名称 | +| container_uid | string | 是 | 容器ID | +| image | string | 否 | 镜像信息 | +| ports | array | 否 | 容器端口 | +| host_ports | array | 否 | 主机端口映射 | +| args | array | 否 | 启动参数 | +| started | int | 否 | 启动时间 | +| limits | object | 否 | 资源限制 | +| requests | object | 否 | 申请资源大小 | +| liveness | object | 否 | 存活探针 | +| environment | array | 否 | 环境变量 | +| mounts | array | 否 | 挂载卷 | + +#### ports[x] + +| 字段 | 类型 | 必选 | 描述 | +|---------------|--------|-----|------| +| name | string | 是 | 端口名称 | +| hostPort | int | 否 | 主机端口 | +| containerPort | int | 否 | 容器端口 | +| protocol | string | 否 | 协议名称 | +| hostIP | string | 否 | 主机IP | + +#### liveness + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|------------| +| exec | object | 是 | 执行动作 | +| httpGet | object | 否 | Http Get动作 | +| tcpSocket | object | 否 | tcp socket | +| grpc | object | 否 | grpc 协议 | + +**注意:** + +- 一次性创建pod数量不超过200个。 +- 具体的workload类别:deployment、statefulSet、daemonSet、gameStatefulSet、gameDeployment、cronJob、job、pods。 +- 此接口会同步创建pod和对应的container。 + +### 请求参数示例 + +```json + { + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "data": [ + { + "bk_biz_id": 1, + "pods": [ + { + "spec": { + "bk_cluster_id": 1, + "bk_namespace_id": 1, + "ref": { + "kind": "deployment", + "id": 1 + }, + "bk_node_id": 1 + }, + "name": "name", + "operator": [ + "user1", + "user2" + ], + "bk_host_id": 1, + "priority": 1, + "labels": { + "env": "test" + }, + "ip": "127.0.0.1", + "ips": [ + { + "ip": "127.0.0.1" + }, + { + "ip": "127.0.0.2" + } + ], + "containers": [ + { + "name": "name", + "container_uid": "uid", + "image": "xxx", + "started": 1 + } + ] + } + ] + } + ] +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "ids": [ + 1, + 2 + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +**注意:** + +- 返回的data中的podID数组顺序与参数中的数组数据顺序保持一致。 + +### 返回结果参数说明 + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| data | object | 请求返回的数据 | +| request_id | string | 请求链ID | + +### data + +| 名称 | 类型 | 描述 | +|-----|-------|--------------| +| ids | array | 创建的容器podID列表 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_workload.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_workload.md new file mode 100644 index 000000000..5aa41daa6 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_kube_workload.md @@ -0,0 +1,160 @@ +### 功能描述 + +批量创建workload (版本:v3.12.1+,权限:容器工作负载新建) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|-----------------------------------------------------------------------------------------------------------------------------------| +| bk_biz_id | int | 是 | 业务id | +| kind | string | 是 | workload类型,目前支持的workload类型有deployment、daemonSet、statefulSet、gameStatefulSet、gameDeployment、cronJob、job、pods(放不通过workload而直接创建Pod) | +| data | array | 是 | 数组, 一次限制创建200 | + +#### data[x] + +| 字段 | 类型 | 必选 | 描述 | +|-------------------------|--------|-----|-----------------------------------------------------| +| bk_namespace_id | int | 是 | namespace在cc中的唯一标识 | +| name | string | 是 | workload名称 | +| labels | map | 否 | 标签 | +| selector | object | 否 | 工作负载选择器 | +| replicas | int | 否 | 工作负载实例个数 | +| strategy_type | string | 否 | 工作负载更新机制 | +| min_ready_seconds | int | 否 | 指定新创建的 Pod 在没有任意容器崩溃情况下的最小就绪时间, 只有超出这个时间 Pod 才被视为可用 | +| rolling_update_strategy | object | 否 | 滚动更新策略 | + +#### selector + +| 字段 | 类型 | 必选 | 描述 | +|-------------------|-------|-----|-----------| +| match_labels | map | 否 | 根据label匹配 | +| match_expressions | array | 否 | 匹配表达式 | + +#### match_expressions[x] + +| 字段 | 类型 | 必选 | 描述 | +|----------|--------|-----|---------------------------------------------------------------| +| key | string | 是 | 标签的key | +| operator | string | 是 | 操作符,可选值:"In"、"NotIn"、"Exists"、"DoesNotExist" | +| values | array | 否 | 字符串数组,如果操作符为"In"或"NotIn",不能为空,如果为"Exists"或"DoesNotExist",必须为空 | + +#### rolling_update_strategy + +当strategy_type为RollingUpdate,不为空,其他情况为空 + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|--------|-----|-------| +| max_unavailable | object | 否 | 最大不可用 | +| max_surge | object | 否 | 最大溢出 | + +#### max_unavailable + +| 字段 | 类型 | 必选 | 描述 | +|---------|--------|-----|-------------------------------------| +| type | int | 是 | 可选值为0(表示int类型)或1(表示string类型) | +| int_val | int | 否 | 当type为0(表示int类型),不能为空,对应的的int值 | +| str_val | string | 否 | 当type为1(表示string类型),不能为空,对应的string值 | + +#### max_surge + +| 字段 | 类型 | 必选 | 描述 | +|---------|--------|-----|-------------------------------------| +| type | int | 是 | 可选值为0(表示int类型)或1(表示string类型) | +| int_val | int | 否 | 当type为0(表示int类型),不能为空,对应的的int值 | +| str_val | string | 否 | 当type为1(表示string类型),不能为空,对应的string值 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "kind": "deployment", + "data": [ + { + "bk_namespace_id": 1, + "name": "test", + "labels": { + "test": "test", + "test2": "test2" + }, + "selector": { + "match_labels": { + "test": "test", + "test2": "test2" + }, + "match_expressions": [ + { + "key": "tier", + "operator": "In", + "values": [ + "cache" + ] + } + ] + }, + "replicas": 1, + "strategy_type": "RollingUpdate", + "min_ready_seconds": 1, + "rolling_update_strategy": { + "max_unavailable": { + "type": 0, + "int_val": 1 + }, + "max_surge": { + "type": 0, + "int_val": 1 + } + } + } + ] +} +``` + +### 返回结果示例 + +```json + +{ + "result": true, + "code": 0, + "data": { + "ids": [ + 1 + ] + }, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +**注意:** + +- 返回的data中的workloadID数组顺序与参数中的数组数据顺序保持一致。 + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | + +#### data + +| 字段 | 类型 | 描述 | +|-----|-------|-------------| +| ids | array | 在cc中的唯一标识数组 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_cluster.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_cluster.md new file mode 100644 index 000000000..9d7bb80c4 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_cluster.md @@ -0,0 +1,59 @@ +### 功能描述 + +删除容器集群(v3.12.1+, 权限:容器集群的删除权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|-------|-----|-----------------| +| bk_biz_id | int | 是 | 容器集群所属业务ID | +| ids | array | 是 | 容器集群在cmdb中的ID列表 | + +**注意:** + +- 用户需要保证所要删除集群下没有关联资源(如namespace、pod、node workload等),否则会删除失败。 +- 一次性删除集群的数量不能超过10个。 + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "ids": [ + 1, + 2 + ] +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "", + "permission": null, + "data": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 返回结果参数说明 + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| data | object | 无数据返回 | +| request_id | string | 请求链id | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_namespace.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_namespace.md new file mode 100644 index 000000000..8a61f38c9 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_namespace.md @@ -0,0 +1,58 @@ +### 功能描述 + +批量删除namespace (版本:v3.12.1+,权限:容器命名空间删除) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +- 通用字段: + +| 字段 | 类型 | 必选 | 描述 | +|-----------|-------|-----|----------------------------------------| +| bk_biz_id | int | 是 | 业务id | +| ids | array | 是 | 要删除的namespace在cc中的id唯一标识数组, 一次限制大小为200 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "ids": [ + 1 + ] +} +``` + +### 返回结果示例 + +```json + +{ + "result": true, + "code": 0, + "data": null, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_node.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_node.md new file mode 100644 index 000000000..1f1b26e5b --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_node.md @@ -0,0 +1,59 @@ +### 功能描述 + +删除容器节点(v3.12.1+,权限:容器节点的删除权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|-------|-----|-------------| +| bk_biz_id | int | 是 | 容器节点所属业务ID | +| ids | array | 是 | 需要删除节点的ID列表 | + +**注意:** + +- 用户需要保证节点下没有关联资源(如:pod),否则删除失败。 +- 一次性删除节点数量不超过100个。 + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "ids": [ + 1, + 2 + ] +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "", + "permission": null, + "data": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 返回结果参数说明 + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| data | object | 无数据返回 | +| request_id | string | 请求链id | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_pod.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_pod.md new file mode 100644 index 000000000..1960cd8d6 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_pod.md @@ -0,0 +1,64 @@ +### 功能描述 + +批量删除Pod (版本:v3.12.1+,权限:容器Pod删除) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|------|--------------|-----|--------------------------------| +| data | object array | 是 | 要删除的pod信息数组,data里所有pod总和最多200条 | + +#### data + +| 字段 | 类型 | 必选 | 描述 | +|-----------|-----------|-----|---------------------------------------| +| bk_biz_id | int | 是 | 业务ID | +| ids | int array | 是 | 要删除的pod的cc ID数组,data里所有pod的ID总和最多200条 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "data": [ + { + "bk_biz_id": 123, + "ids": [ + 5, + 6 + ] + } + ] +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 返回结果参数 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_workload.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_workload.md new file mode 100644 index 000000000..0fe1a901a --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_kube_workload.md @@ -0,0 +1,58 @@ +### 功能描述 + +批量删除workload (版本:v3.12.1+,权限:容器工作负载删除) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|-----------------------------------------------------------------------------------------------------------------------------------| +| bk_biz_id | int | 是 | 业务id | +| kind | string | 是 | workload类型,目前支持的workload类型有deployment、daemonSet、statefulSet、gameStatefulSet、gameDeployment、cronJob、job、pods(放不通过workload而直接创建Pod) | +| ids | array | 是 | 要删除的workload在cc中的id唯一标识数组, 一次限制大小为200 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "kind": "deployment", + "ids": [ + 1 + ] +} +``` + +### 返回结果示例 + +```json + +{ + "result": true, + "code": 0, + "data": null, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_cluster.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_cluster.md new file mode 100644 index 000000000..fc9535d64 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_cluster.md @@ -0,0 +1,86 @@ +### 功能描述 + +更新容器集群属性字段(v3.12.1+,权限:容器集群的编辑权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|----------------------| +| bk_biz_id | int | 是 | 业务ID | +| ids | array | 是 | cluster在cmdb中的唯一ID列表 | +| data | object | 是 | 需要更新的数据 | + +#### data + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|--------|-----|-------| +| name | string | 否 | 集群名称 | +| version | string | 否 | 集群版本 | +| network_type | string | 否 | 网络类型 | +| region | string | 否 | 地域 | +| network | array | 否 | 集群网络 | +| environment | string | 否 | 环境 | +| bk_project_id | string | 否 | 项目ID | +| bk_project_name | string | 否 | 项目名称 | +| bk_project_code | string | 否 | 项目英文名 | + +**注意:** + +- 一次性更新集群数量不超过100个。 +- 本接口不支持更新集群类型,如需更新集群类型请使用`update_kube_cluster_type`接口 + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "ids": [ + 1 + ], + "data": { + "name": "cluster", + "version": "1.20.6", + "network_type": "underlay", + "region": "xxx", + "network": [ + "127.0.0.0/21" + ], + "environment": "xxx", + "bk_project_id": "21bf9ef9be7c4d38a1d1f2uc0b44a8f2", + "bk_project_name": "test", + "bk_project_code": "test" + } +} +``` + +### 返回结果示例 + +```json + { + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": null +} +``` + +### 返回结果参数说明 + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 无数据返回 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_namespace.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_namespace.md new file mode 100644 index 000000000..efd684171 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_namespace.md @@ -0,0 +1,92 @@ +### 功能描述 + +批量更新namespace (版本:v3.12.1+,权限:容器命名空间编辑) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|---------------| +| bk_biz_id | int | 是 | 业务id | +| data | object | 是 | 包含需要更新的字段 | +| ids | array | 是 | 在cc中的id唯一标识数组 | + +#### data + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|-------|-----|----------------------------| +| labels | map | 否 | 标签 | +| resource_quotas | array | 否 | 命名空间CPU与内存的requests与limits | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 1, + "ids": [ + 1, + 2, + 3 + ], + "data": { + "labels": { + "test": "test", + "test2": "test2" + }, + "resource_quotas": [ + { + "hard": { + "memory": "20000Gi", + "pods": "100", + "cpu": "10k" + }, + "scope_selector": { + "match_expressions": [ + { + "values": [ + "high" + ], + "operator": "In", + "scope_name": "PriorityClass" + } + ] + } + } + ] + } +} +``` + +### 返回结果示例 + +```json + +{ + "result": true, + "code": 0, + "data": null, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_node.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_node.md new file mode 100644 index 000000000..32533f9fc --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_node.md @@ -0,0 +1,85 @@ +### 功能描述 + +更新容器节点属性字段(v3.12.1+,权限: 容器节点编辑权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|----------------| +| bk_biz_id | int | 是 | 所属业务ID | +| ids | array | 是 | 需要更新的node id列表 | +| data | object | 是 | 需要更新的节点属性字段 | + +#### data + +| 字段 | 类型 | 必选 | 描述 | +|-------------------|-------------|-----|----------------------------------| +| labels | json object | 否 | 标签 | +| taints | string | 否 | cluster 名称 | +| unschedulable | bool | 否 | 设置是否可调度 | +| hostname | string | 否 | 主机名 | +| runtime_component | string | 否 | 运行时组件 | +| kube_proxy_mode | string | 否 | Kube-proxy 代理模式 | +| pod_cidr | string | 否 | 此节点Pod地址的分配范围,例如:172.17.0.128/26 | + +**注意:** + +- 其中labels、taints是需要整体更新的。 +- 一次性更新集群数量不超过100个。 + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "ids": [ + 1, + 2 + ], + "data": { + "labels": { + "env": "test" + }, + "taints": { + "type": "gpu" + }, + "unschedulable": false, + "hostname": "xxx", + "runtime_component": "runtime_component", + "kube_proxy_mode": "ipvs", + "pod_cidr": "127.0.0.1/26" + } +} +``` + +### 返回结果示例 + +```json + { + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": null +} +``` + +### 返回结果参数说明 + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 无数据返回 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_workload.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_workload.md new file mode 100644 index 000000000..dfdbbf404 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_kube_workload.md @@ -0,0 +1,148 @@ +### 功能描述 + +批量更新workload (版本:v3.12.1+,权限:容器工作负载编辑) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|-----------------------------------------------------------------------------------------------------------------------------------| +| bk_biz_id | int | 是 | 业务id | +| kind | string | 是 | workload类型,目前支持的workload类型有deployment、daemonSet、statefulSet、gameStatefulSet、gameDeployment、cronJob、job、pods(放不通过workload而直接创建Pod) | +| data | object | 是 | 包含需要更新的字段 | +| ids | array | 是 | 在cc中的id唯一标识数组 | + +#### data + +| 字段 | 类型 | 必选 | 描述 | +|-------------------------|--------|-----|-----------------------------------------------------| +| labels | map | 否 | 标签 | +| selector | object | 否 | 工作负载选择器 | +| replicas | int | 否 | 工作负载实例个数 | +| strategy_type | string | 否 | 工作负载更新机制 | +| min_ready_seconds | int | 否 | 指定新创建的 Pod 在没有任意容器崩溃情况下的最小就绪时间, 只有超出这个时间 Pod 才被视为可用 | +| rolling_update_strategy | object | 否 | 滚动更新策略 | + +#### selector + +| 字段 | 类型 | 必选 | 描述 | +|-------------------|-------|-----|-----------| +| match_labels | map | 否 | 根据label匹配 | +| match_expressions | array | 否 | 匹配表达式 | + +#### match_expressions[x] + +| 字段 | 类型 | 必选 | 描述 | +|----------|--------|-----|---------------------------------------------------------------| +| key | string | 是 | 标签的key | +| operator | string | 是 | 操作符,可选值:"In"、"NotIn"、"Exists"、"DoesNotExist" | +| values | array | 否 | 字符串数组,如果操作符为"In"或"NotIn",不能为空,如果为"Exists"或"DoesNotExist",必须为空 | + +#### rolling_update_strategy + +当strategy_type为RollingUpdate,不为空,其他情况为空 + +| 字段 | 类型 | 必选 | 描述 | +|-----------------|--------|-----|-------| +| max_unavailable | object | 否 | 最大不可用 | +| max_surge | object | 否 | 最大溢出 | + +#### max_unavailable + +| 字段 | 类型 | 必选 | 描述 | +|---------|--------|-----|-------------------------------------| +| type | int | 是 | 可选值为0(表示int类型)或1(表示string类型) | +| int_val | int | 否 | 当type为0(表示int类型),不能为空,对应的的int值 | +| str_val | string | 否 | 当type为1(表示string类型),不能为空,对应的string值 | + +#### max_surge + +| 字段 | 类型 | 必选 | 描述 | +|---------|--------|-----|-------------------------------------| +| type | int | 是 | 可选值为0(表示int类型)或1(表示string类型) | +| int_val | int | 否 | 当type为0(表示int类型),不能为空,对应的的int值 | +| str_val | string | 否 | 当type为1(表示string类型),不能为空,对应的string值 | + +注:使用k8s的唯一标识和cc的唯一标识传入关联信息,这两种方式只能使用其中一种,不能混用 + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "kind": "deployment", + "ids": [ + 1, + 2, + 3 + ], + "data": { + "labels": { + "test": "test", + "test2": "test2" + }, + "selector": { + "match_labels": { + "test": "test", + "test2": "test2" + }, + "match_expressions": [ + { + "key": "tier", + "operator": "In", + "values": [ + "cache" + ] + } + ] + }, + "replicas": 1, + "strategy_type": "RollingUpdate", + "min_ready_seconds": 1, + "rolling_update_strategy": { + "max_unavailable": { + "type": 0, + "int_val": 1 + }, + "max_surge": { + "type": 0, + "int_val": 1 + } + } + } +} +``` + +### 返回结果示例 + +```json + +{ + "result": true, + "code": 0, + "data": null, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/create_kube_cluster.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/create_kube_cluster.md new file mode 100644 index 000000000..6965afa7c --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/create_kube_cluster.md @@ -0,0 +1,87 @@ +### 功能描述 + +新建容器集群(v3.12.1+,权限:容器集群的创建权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-------------------|--------|-----|--------------------------------------------------------| +| bk_biz_id | int | 是 | 业务ID | +| name | string | 是 | 集群名称 | +| scheduling_engine | string | 否 | 调度引擎 | +| uid | string | 是 | 集群自有ID | +| xid | string | 否 | 关联集群ID | +| version | string | 否 | 集群版本 | +| network_type | string | 否 | 网络类型 | +| region | string | 否 | 地域 | +| vpc | string | 否 | vpc网络 | +| network | array | 否 | 集群网络 | +| type | string | 是 | 集群类型。枚举值:INDEPENDENT_CLUSTER(独立集群)、SHARE_CLUSTER(共享集群) | +| environment | string | 否 | 环境 | +| bk_project_id | string | 否 | 项目ID | +| bk_project_name | string | 否 | 项目名称 | +| bk_project_code | string | 否 | 项目英文名 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "name": "cluster", + "scheduling_engine": "k8s", + "uid": "xxx", + "xid": "xxx", + "version": "1.1.0", + "network_type": "underlay", + "region": "xxx", + "vpc": "xxx", + "network": [ + "127.0.0.0/21" + ], + "type": "INDEPENDENT_CLUSTER", + "environment": "xxx", + "bk_project_id": "21bf9ef9be7c4d38a1d1f2uc0b44a8f2", + "bk_project_name": "test", + "bk_project_code": "test" +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "id": 1 + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 返回结果参数说明 + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| data | object | 请求返回的数据 | +| request_id | string | 请求链ID | + +### data + +| 名称 | 类型 | 描述 | +|-----|-----|-----------| +| id | int | 创建的容器集群ID | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/create_object.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/create_object.md index 190605d98..1200b8838 100644 --- a/paas2/esb/components/confapis/cc/apidocs/zh_hans/create_object.md +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/create_object.md @@ -15,7 +15,7 @@ | bk_obj_id | string | 是 | 对象模型的ID,只能用英文字母序列命名 | | bk_obj_name | string | 是 | 对象模型的名字,用于展示,可以使用人类可以阅读的任何语言 | | | bk_obj_icon | string | 否 | 对象模型的ICON信息,用于前端显示| - +| obj_sort_number | int | 否 | 对象模型在所属模型分组下的排序序号 | ### 请求参数示例 @@ -29,7 +29,8 @@ "bk_classification_id": "test", "bk_obj_name": "test", "bk_obj_icon": "icon-cc-business", - "bk_obj_id": "test" + "bk_obj_id": "test", + "obj_sort_number": 1 } ``` @@ -59,7 +60,8 @@ "bk_obj_icon": "icon-cc-business", "modifier": "", "id": 2000002118, - "ispre": false + "ispre": false, + "obj_sort_number": 1 } } @@ -92,4 +94,5 @@ | bk_obj_name | string | 模型名称 | | bk_obj_icon | string | 对象模型的ICON信息,用于前端显示| | position | json object string | 用于前端展示的坐标 / -| ispre | bool | 是否预定义, true or false | \ No newline at end of file +| ispre | bool | 是否预定义, true or false | +| obj_sort_number | int | 否 | 对象模型在所属模型分组下的排序序号 | \ No newline at end of file diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_cluster.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_cluster.md new file mode 100644 index 000000000..48cf5d511 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_cluster.md @@ -0,0 +1,210 @@ +### 功能描述 + +查询容器集群(v3.12.1+, 权限: 业务访问) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|--------------------------| +| bk_biz_id | int | 是 | 业务ID | +| filter | object | 否 | 容器集群查询范围 | +| fields | array | 否 | 所要查询的容器集群属性,如果不写代表搜索全部数据 | +| page | object | 是 | 分页条件 | + +#### filter + +该参数为容器集群属性字段过滤规则的组合,用于根据容器集群属性字段搜索容器集群。组合支持AND 和 OR 两种方式,允许嵌套,最多嵌套2层。 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|-----------| +| condition | string | 是 | 规则操作符 | +| rules | array | 是 | 过滤集群的范围规则 | + +#### rules + +过滤规则为三元组 `field`, `operator`, `value` + +| 名称 | 类型 | 必填 | 默认值 | 说明 | Description | +|----------|--------|-----|-----|-----|-----------------------------------------------------------------------------------------------| +| field | string | 是 | 无 | 字段名 | | +| operator | string | 是 | 无 | 操作符 | 可选值 equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | - | 否 | 无 | 操作数 | 不同的operator对应不同的value格式 | + +组装规则可参考: + +#### page + +| 字段 | 类型 | 必选 | 描述 | +|--------------|--------|-----|-----------------------------------------------------------| +| start | int | 是 | 记录开始位置 | +| limit | int | 是 | 每页限制条数,最大500 | +| enable_count | bool | 是 | 本次请求是否为获取数量还是详情的标记 | +| sort | string | 否 | 排序字段,通过在字段前面增加 -,如 sort:"-field" 可以表示按照字段 field降序 | + +**注意:** + +- `enable_count` 如果此标记为true,表示此次请求是获取数量。此时其余字段必须为初始化值,start为0,limit为:0, sort为""。 +- `sort`如果调用方没有指定,后台默认指定为容器集群ID。 +- 必须设置分页参数,一次最大查询数据不超过500个。 + +### 请求参数示例 + +### 获取详细信息请求参数 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "scheduling_engine", + "operator": "equal", + "value": "k8s" + }, + { + "field": "version", + "operator": "equal", + "value": "1.1.0" + } + ] + }, + "page": { + "start": 0, + "limit": 500, + "enable_count": false + } +} +``` + +### 获取数量请求示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "filter": { + "condition": "AND", + "rules": [ + { + "field": "scheduling_engine", + "operator": "equal", + "value": "k8s" + }, + { + "field": "version", + "operator": "equal", + "value": "1.1.0" + } + ] + }, + "page": { + "start": 0, + "limit": 0, + "enable_count": true + } +} +``` + +### 返回结果示例 + +### 详细信息接口响应 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "count": 0, + "info": [ + { + "name": "cluster", + "scheduling_engine": "k8s", + "uid": "xxx", + "xid": "xxx", + "version": "1.1.0", + "network_type": "underlay", + "region": "xxx", + "vpc": "xxx", + "network": "127.0.0.0/21", + "type": "INDEPENDENT_CLUSTER", + "environment": "xxx", + "bk_project_id": "21bf9ef9be7c4d38a1d1f2uc0b44a8f2", + "bk_project_name": "test", + "bk_project_code": "test" + } + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 获取容器集群数量接口响应 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "count": 1, + "info": [ + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 返回结果参数说明 + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| data | object | 请求返回的数据 | +| request_id | string | 请求链id | + +#### data + +| 字段 | 类型 | 描述 | +|-------|-------|--------| +| count | int | 记录条数 | +| info | array | 集群实际数据 | + +#### info[x] + +| 字段 | 类型 | 描述 | +|-------------------|--------|--------| +| name | string | 集群名称 | +| scheduling_engine | string | 调度引擎 | +| uid | string | 集群自有ID | +| xid | string | 关联集群ID | +| version | string | 集群版本 | +| network_type | string | 网络类型 | +| region | string | 地域 | +| vpc | string | vpc网络 | +| network | array | 集群网络 | +| type | string | 集群类型 | +| environment | string | 环境 | +| bk_project_id | string | 项目ID | +| bk_project_name | string | 项目名称 | +| bk_project_code | string | 项目英文名 | + +**注意:** + +- 如果本次请求是查询详细信息那么count为0,如果查询的是数量,那么info为空。 diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_container.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_container.md new file mode 100644 index 000000000..0698058a2 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_container.md @@ -0,0 +1,229 @@ +### 功能描述 + +查询Container列表 (版本:v3.12.1+,权限:业务访问) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------------|-----|--------------------------------------------------------| +| bk_biz_id | int | 是 | 业务ID | +| bk_pod_id | int | 是 | 所属pod的ID | +| filter | object | 否 | container的查询条件 | +| fields | string array | 是 | container属性列表,控制返回结果的container里有哪些字段,能够加速接口请求和减少网络流量传输 | +| page | object | 是 | 分页信息 | + +#### filter 字段说明 + +container的属性字段过滤规则,用于根据container的属性字段搜索数据。该参数支持以下两种过滤规则类型,其中组合过滤规则可以嵌套,且最多嵌套2层。具体支持的过滤规则类型如下: + +##### 组合过滤规则 + +由其它规则组合而成的过滤规则,组合的规则间支持逻辑与/或关系 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|---------------------------------| +| condition | string | 是 | 组合查询条件,支持 `AND` 和 `OR` 两种方式 | +| rules | array | 是 | 查询规则,可以是 `组合过滤规则` 或 `原子过滤规则` 类型 | + +##### 原子过滤规则 + +基础的过滤规则,表示对某一个字段进行过滤的规则。任何过滤规则都直接是原子过滤规则, 或由多个原子过滤规则组合而成 + +| 名称 | 类型 | 必选 | 说明 | +|----------|-------------------------------|-----|---------------------------------------------------------------------------------------------------| +| field | string | 是 | container的字段 | +| operator | string | 是 | 操作符,可选值 equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | 不同的field和operator对应不同的value格式 | 否 | 操作值 | + +组装规则可参考: + +#### page 字段说明 + +| 字段 | 类型 | 必选 | 描述 | +|--------------|--------|-----|------------------------------------------------------------------------------| +| start | int | 是 | 记录开始位置 | +| limit | int | 是 | 每页限制条数,最大500 | +| sort | string | 否 | 排序字段 | +| enable_count | bool | 是 | 是否获取查询对象数量的标记。如果此标记为true那么表示此次请求是获取数量,此时其余字段必须为初始化值,start为0,limit为:0,sort为"" | + +**注意:** + +- `enable_count` 如果此标记为true,表示此次请求是获取数量。此时其余字段必须为初始化值,start为0,limit为:0, sort为""。 +- 必须设置分页参数,一次最大查询数据不超过500个。 + +### 请求参数示例 + +#### 获取详细信息请求参数示例 + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_biz_id": 4, + "bk_pod_id": 4, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "name", + "operator": "not_equal", + "value": "container1" + }, + { + "condition": "OR", + "rules": [ + { + "field": "container_uid", + "operator": "not_in", + "value": [ + "xxxxxx" + ] + }, + { + "field": "image", + "operator": "equal", + "value": "xxx" + } + ] + } + ] + }, + "fields": [ + "name", + "container_uid" + ], + "page": { + "start": 0, + "limit": 10, + "sort": "name", + "enable_count": false + } +} +``` + +#### 获取数量请求参数示例 + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_biz_id": 4, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "name", + "operator": "not_equal", + "value": "container1" + }, + { + "condition": "OR", + "rules": [ + { + "field": "container_uid", + "operator": "not_in", + "value": [ + "xxxxxx" + ] + }, + { + "field": "image", + "operator": "equal", + "value": "xxx" + } + ] + } + ] + }, + "page": { + "enable_count": true + } +} +``` + +### 返回结果示例 + +#### 获取详细信息返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 0, + "info": [ + { + "name": "container2", + "container_uid": "xxx" + }, + { + "name": "container3", + "container_uid": "xxx" + } + ] + } +} +``` + +#### 获取数量返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 100, + "info": [] + } +} +``` + +### 返回结果参数 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | + +#### data + +| 字段 | 类型 | 描述 | +|-------|-------|--------------------------------| +| count | int | 记录条数 | +| info | array | container实际数据,仅返回fields里设置了的字段 | + +#### info[x] + +| 字段 | 类型 | 描述 | +|---------------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| name | string | 名称 | +| container_uid | string | 容器uid | +| image | string | 镜像信息 | +| ports | object array | 容器端口,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#containerport-v1-core | +| args | string array | 启动参数 | +| started | timestamp | 启动时间 | +| limits | object | 资源限制,官方文档:https://kubernetes.io/zh/docs/concepts/policy/resource-quotas/ | +| requests | object | 申请资源大小,官方文档:https://kubernetes.io/zh/docs/concepts/policy/resource-quotas/ | +| liveness | object | 存活探针,官方文档:https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ ,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#probe-v1-core | +| environment | object array | 环境变量,官方文档:https://kubernetes.io/zh/docs/tasks/inject-data-application/define-environment-variable-container/ ,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#envvar-v1-core | +| mounts | object array | 挂载卷,官方文档:https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-volume-storage/ ,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#volumemount-v1-core | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_namespace.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_namespace.md new file mode 100644 index 000000000..d6143d9e5 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_namespace.md @@ -0,0 +1,219 @@ +### 功能描述 + +查询namespace (版本:v3.12.1+,权限:业务访问) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +- 通用字段: + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|-------------------------------------| +| bk_biz_id | int | 是 | 业务id | +| filter | object | 否 | namespace查询条件 | +| fields | array | 否 | 属性列表,控制返回结果里有哪些字段,能够加速接口请求和减少网络流量传输 | +| page | object | 是 | 分页信息 | + +#### filter 字段说明 + +namespace的属性字段过滤规则,用于根据namespace的属性字段搜索数据。该参数支持以下两种过滤规则类型,其中组合过滤规则可以嵌套,且最多嵌套2层。具体支持的过滤规则类型如下: + +##### 组合过滤规则 + +由其它规则组合而成的过滤规则,组合的规则间支持逻辑与/或关系 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|---------------------------------| +| condition | string | 是 | 组合查询条件,支持 `AND` 和 `OR` 两种方式 | +| rules | array | 是 | 查询规则,可以是 `组合过滤规则` 或 `原子过滤规则` 类型 | + +##### 原子过滤规则 + +基础的过滤规则,表示对某一个字段进行过滤的规则。任何过滤规则都直接是原子过滤规则, 或由多个原子过滤规则组合而成 + +| 名称 | 类型 | 必选 | 说明 | +|----------|-------------------------------|-----|---------------------------------------------------------------------------------------------------| +| field | string | 是 | container的字段 | +| operator | string | 是 | 操作符,可选值 equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | 不同的field和operator对应不同的value格式 | 否 | 操作值 | + +组装规则可参考: + +#### page + +| 字段 | 类型 | 必选 | 描述 | +|--------------|--------|-----|------------------------------------------------------------------------------| +| start | int | 是 | 记录开始位置 | +| limit | int | 是 | 每页限制条数,最大500 | +| sort | string | 否 | 排序字段 | +| enable_count | bool | 是 | 是否获取查询对象数量的标记。如果此标记为true那么表示此次请求是获取数量,此时其余字段必须为初始化值,start为0,limit为:0,sort为"" | + +**注意:** + +- `enable_count` 如果此标记为true,表示此次请求是获取数量。此时其余字段必须为初始化值,start为0,limit为:0, sort为""。 +- 必须设置分页参数,一次最大查询数据不超过500个。 + +### 请求参数示例 + +### 获取详细信息请求参数 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "bk_cluster_id", + "operator": "equal", + "value": 1 + }, + { + "field": "name", + "operator": "equal", + "value": "test" + } + ] + }, + "fields": [ + "name" + ], + "page": { + "start": 0, + "limit": 10, + "sort": "name", + "enable_count": false + } +} +``` + +### 获取数量请求示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "bk_cluster_id", + "operator": "equal", + "value": 1 + }, + { + "field": "name", + "operator": "equal", + "value": "test" + } + ] + }, + "page": { + "enable_count": true + } +} +``` + +### 返回结果示例 + +### 详细信息接口响应 + +```json + +{ + "result": true, + "code": 0, + "data": { + "count": 0, + "info": [ + { + "name": "test" + } + ] + }, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 获取数量返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "count": 100, + "info": [ + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | + +#### data + +| 字段 | 类型 | 描述 | +|-------|-------|-----------------------| +| count | int | 记录条数 | +| info | array | 实际数据,仅返回fields里设置了的字段 | + +#### info[x] + +| 字段 | 类型 | 描述 | +|-----------------|--------|----------------------------| +| name | string | 命名空间名称 | +| labels | map | 标签 | +| resource_quotas | array | 命名空间CPU与内存的requests与limits | + +#### resource_quotas[x] + +| 字段 | 类型 | 描述 | +|----------------|--------|--------------------------------------------------------------------------------------------------------------------| +| hard | object | 每个命名资源所需的硬限制 | +| scopes | array | 配额作用域,可选值为:"Terminating"、"NotTerminating"、"BestEffort"、"NotBestEffort"、"PriorityClass"、"CrossNamespacePodAffinity" | +| scope_selector | object | 作用域选择器 | + +#### scope_selector + +| 字段 | 类型 | 描述 | +|-------------------|-------|-------| +| match_expressions | array | 匹配表达式 | + +#### match_expressions[x] + +| 字段 | 类型 | 描述 | +|------------|--------|--------------------------------------------------------------------------------------------------------------------| +| scope_name | array | 配额作用域,可选值为:"Terminating"、"NotTerminating"、"BestEffort"、"NotBestEffort"、"PriorityClass"、"CrossNamespacePodAffinity" | +| operator | string | 选择器操作符,可选值为:"In"、"NotIn"、"Exists"、"DoesNotExist" | +| values | array | 字符串数组,如果操作符为"In"或"NotIn",不能为空,如果为"Exists"或"DoesNotExist",必须为空 | + +**注意:** + +- 如果本次请求是查询详细信息那么count为0,如果查询的是数量,那么info为空 diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_node.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_node.md new file mode 100644 index 000000000..af5b7559c --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_node.md @@ -0,0 +1,222 @@ +### 功能描述 + +查询容器节点(v3.12.1+,权限:业务访问) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|--------------------------| +| bk_biz_id | int | 是 | 业务ID | +| filter | object | 否 | 容器节点查询范围 | +| fields | array | 否 | 所要查询的容器节点属性,如果不写代表搜索全部数据 | +| page | object | 是 | 分页条件 | + +#### filter + +该参数为容器节点属性字段过滤规则的组合,用于根据容器节点属性字段搜索容器集群。组合支持AND 和 OR 两种方式,允许嵌套,最多嵌套2层。 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|-----------| +| condition | string | 是 | 规则操作符 | +| rules | array | 是 | 过滤节点的范围规则 | + +#### rules + +过滤规则为三元组 `field`, `operator`, `value` + +| 名称 | 类型 | 必填 | 默认值 | 说明 | Description | +|----------|--------|-----|-----|-----|-----------------------------------------------------------------------------------------------| +| field | string | 是 | 无 | 字段名 | | +| operator | string | 是 | 无 | 操作符 | 可选值 equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | - | 否 | 无 | 操作数 | 不同的operator对应不同的value格式 | + +组装规则可参考: + +#### page + +| 字段 | 类型 | 必选 | 描述 | +|--------------|--------|-----|-----------------------------------------------------------| +| start | int | 是 | 记录开始位置 | +| limit | int | 是 | 每页限制条数,最大500 | +| enable_count | bool | 是 | 本次请求是否为获取数量还是详情的标记 | +| sort | string | 否 | 排序字段,通过在字段前面增加 -,如 sort:"-field" 可以表示按照字段 field降序 | + +**注意:** + +- `enable_count` 如果此标记为true,表示此次请求是获取数量。此时其余字段必须为初始化值,start为0,limit为:0, sort为""。 +- `sort`如果调用方没有指定,后台默认指定为节点ID。 +- 必须设置分页参数,一次最大查询数据不超过500个。 + +### 请求参数示例 + +### 详细信息请求参数 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "filter": { + "condition": "OR", + "rules": [ + { + "field": "id", + "operator": "equal", + "value": 10 + }, + { + "field": "bk_cluster_id", + "operator": "equal", + "value": 10 + }, + { + "field": "hostname", + "operator": "equal", + "value": "name" + } + ] + }, + "page": { + "enable_count": false, + "start": 0, + "limit": 500 + } +} +``` + +### 获取节点数量请求参数 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "filter": { + "condition": "OR", + "rules": [ + { + "field": "id", + "operator": "equal", + "value": 10 + }, + { + "field": "bk_cluster_id", + "operator": "equal", + "value": 10 + }, + { + "field": "hostname", + "operator": "equal", + "value": "name" + } + ] + }, + "page": { + "enable_count": true, + "start": 0, + "limit": 0 + } +} +``` + +### 返回结果示例 + +### 详细信息接口响应 + +```json +{ + "result": true, + "bk_error_code": 0, + "bk_error_msg": "success", + "permission": null, + "data": { + "count": 0, + "info": [ + { + "name": "k8s", + "roles": "master", + "labels": { + "env": "test" + }, + "taints": { + "type": "gpu" + }, + "unschedulable": false, + "internal_ip": [ + "127.0.0.1" + ], + "external_ip": [ + "127.0.0.1" + ], + "hostname": "name", + "runtime_component": "runtime_component", + "kube_proxy_mode": "ipvs", + "pod_cidr": "127.0.0.128/26" + } + ] + } +} +``` + +### 获取容器节点数量接口响应 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "count": 1, + "info": [ + ] + }, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +### 返回结果参数说明 + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| data | object | 请求返回的数据 | +| request_id | string | 请求链id | + +#### data + +| 字段 | 类型 | 描述 | +|-------|-------|---------| +| count | int | 记录条数 | +| info | array | 节点的实际数据 | + +#### info[x] + +| 字段 | 类型 | 必选 | 描述 | +|-------------------|--------|-----|------------------------------| +| name | string | 否 | 节点名称 | +| roles | string | 否 | 节点类型 | +| labels | object | 否 | 标签 | +| taints | object | 否 | 污点 | +| unschedulable | bool | 否 | 是否关闭可调度,true为不可调度,false代表可调度 | +| internal_ip | array | 否 | 内网IP | +| external_ip | array | 否 | 外网IP | +| hostname | string | 否 | 主机名 | +| runtime_component | string | 否 | 运行时组件 | +| kube_proxy_mode | string | 否 | kube-proxy 代理模式 | +| pod_cidr | string | 否 | 此节点Pod地址的分配范围 | + +**注意:** + +- 如果本次请求是查询详细信息那么count为0,如果查询的是数量,那么info为空。 diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_pod.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_pod.md new file mode 100644 index 000000000..57ddd8c76 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_pod.md @@ -0,0 +1,229 @@ +### 功能描述 + +查询Pod列表 (版本:v3.12.1+,权限:业务访问) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|--------------------------------------------| +| bk_biz_id | int | 是 | 业务ID | +| filter | object | 否 | pod的查询条件 | +| fields | array | 是 | pod属性列表,控制返回结果的pod里有哪些字段,能够加速接口请求和减少网络流量传输 | +| page | object | 是 | 分页信息 | + +#### filter 字段说明 + +pod的属性字段过滤规则,用于根据pod的属性字段搜索数据。该参数支持以下两种过滤规则类型,其中组合过滤规则可以嵌套,且最多嵌套2层。具体支持的过滤规则类型如下: + +##### 组合过滤规则 + +由其它规则组合而成的过滤规则,组合的规则间支持逻辑与/或关系 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|---------------------------------| +| condition | string | 是 | 组合查询条件,支持 `AND` 和 `OR` 两种方式 | +| rules | array | 是 | 查询规则,可以是 `组合查询参数` 或 `原子查询参数` 类型 | + +##### 原子过滤规则 + +基础的过滤规则,表示对某一个字段进行过滤的规则。任何过滤规则都直接是原子过滤规则, 或由多个原子过滤规则组合而成 + +| 名称 | 类型 | 必选 | 说明 | +|----------|-------------------------------|-----|---------------------------------------------------------------------------------------------------| +| field | string | 是 | pod的字段 | +| operator | string | 是 | 操作符,可选值 equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | 不同的field和operator对应不同的value格式 | 否 | 操作值 | + +组装规则可参考: + +#### page 字段说明 + +| 字段 | 类型 | 必选 | 描述 | +|--------------|--------|-----|------------------------------------------------------------------------------| +| start | int | 是 | 记录开始位置 | +| limit | int | 是 | 每页限制条数,最大500 | +| sort | string | 否 | 排序字段 | +| enable_count | bool | 是 | 是否获取查询对象数量的标记。如果此标记为true那么表示此次请求是获取数量,此时其余字段必须为初始化值,start为0,limit为:0,sort为"" | + +**注意:** + +- `enable_count` 如果此标记为true,表示此次请求是获取数量。此时其余字段必须为初始化值,start为0,limit为:0, sort为""。 +- 必须设置分页参数,一次最大查询数据不超过500个。 + +### 请求参数示例 + +#### 获取详细信息请求参数示例 + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_biz_id": 4, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "name", + "operator": "not_equal", + "value": "pod1" + }, + { + "condition": "OR", + "rules": [ + { + "field": "priority", + "operator": "not_in", + "value": [ + 2, + 6 + ] + }, + { + "field": "qos_class", + "operator": "equal", + "value": "Burstable" + } + ] + } + ] + }, + "fields": [ + "name", + "priority" + ], + "page": { + "start": 0, + "limit": 10, + "sort": "name", + "enable_count": false + } +} +``` + +#### 获取数量请求参数示例 + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_biz_id": 4, + "filter": { + "condition": "AND", + "rules": [ + { + "field": "name", + "operator": "not_equal", + "value": "pod1" + }, + { + "condition": "OR", + "rules": [ + { + "field": "priority", + "operator": "not_in", + "value": [ + 2, + 6 + ] + }, + { + "field": "qos_class", + "operator": "equal", + "value": "Burstable" + } + ] + } + ] + }, + "page": { + "enable_count": true + } +} +``` + +### 返回结果示例 + +#### 获取详细信息返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 0, + "info": [ + { + "name": "pod2", + "priority": 1 + }, + { + "name": "pod3", + "priority": 5 + } + ] + } +} +``` + +#### 获取数量返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 10, + "info": [] + } +} +``` + +### 返回结果参数 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | + +#### data + +| 字段 | 类型 | 描述 | +|-------|-------|--------------------------| +| count | int | 记录条数 | +| info | array | pod实际数据,仅返回fields里设置了的字段 | + +#### info[x] + +| 字段 | 类型 | 描述 | +|----------------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------| +| name | string | 名称 | +| priority | int | 优先级 | +| labels | string map | 标签,key和value均是string,官方文档:http://kubernetes.io/docs/user-guide/labels | +| ip | string | 容器网络IP | +| ips | object array | 容器网络IP数组,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#podip-v1-core | +| volumes | object array | 使用的卷信息,官方文档:https://kubernetes.io/zh/docs/concepts/storage/volumes/ ,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#volume-v1-core | +| qos_class | enum | 服务质量,官方文档:https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/quality-service-pod/ | +| node_selectors | string map | 节点标签选择器,key和value均是string,官方文档:https://kubernetes.io/zh/docs/concepts/scheduling-eviction/assign-pod-node/ | +| tolerations | object array | 容忍度,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#toleration-v1-core | +| operator | string array | pod负责人 | +| containers | object array | 容器数据 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_workload.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_workload.md new file mode 100644 index 000000000..cf07cd1bc --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_kube_workload.md @@ -0,0 +1,256 @@ +### 功能描述 + +查询workload (版本:v3.12.1+,权限:业务访问) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +- 通用字段: + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|-----------------------------------------------------------------------------------------------------------------------------------| +| bk_biz_id | int | 是 | 业务id | +| kind | string | 是 | workload类型,目前支持的workload类型有deployment、daemonSet、statefulSet、gameStatefulSet、gameDeployment、cronJob、job、pods(放不通过workload而直接创建Pod) | +| filter | object | 否 | workload查询条件 | +| fields | array | 否 | 属性列表,控制返回结果里有哪些字段,能够加速接口请求和减少网络流量传输 | +| page | object | 是 | 分页信息 | + +#### filter 字段说明 + +container的属性字段过滤规则,用于根据container的属性字段搜索数据。该参数支持以下两种过滤规则类型,其中组合过滤规则可以嵌套,且最多嵌套2层。具体支持的过滤规则类型如下: + +##### 组合过滤规则 + +由其它规则组合而成的过滤规则,组合的规则间支持逻辑与/或关系 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|---------------------------------| +| condition | string | 是 | 组合查询条件,支持 `AND` 和 `OR` 两种方式 | +| rules | array | 是 | 查询规则,可以是 `组合过滤规则` 或 `原子过滤规则` 类型 | + +##### 原子过滤规则 + +基础的过滤规则,表示对某一个字段进行过滤的规则。任何过滤规则都直接是原子过滤规则, 或由多个原子过滤规则组合而成 + +| 名称 | 类型 | 必选 | 说明 | +|----------|-------------------------------|-----|---------------------------------------------------------------------------------------------------| +| field | string | 是 | container的字段 | +| operator | string | 是 | 操作符,可选值 equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | 不同的field和operator对应不同的value格式 | 否 | 操作值 | + +组装规则可参考: + +#### page + +| 字段 | 类型 | 必选 | 描述 | +|--------------|--------|-----|------------------------------------------------------------------------------| +| start | int | 是 | 记录开始位置 | +| limit | int | 是 | 每页限制条数,最大500 | +| sort | string | 否 | 排序字段 | +| enable_count | bool | 是 | 是否获取查询对象数量的标记。如果此标记为true那么表示此次请求是获取数量,此时其余字段必须为初始化值,start为0,limit为:0,sort为"" | + +**注意:** + +- `enable_count` 如果此标记为true,表示此次请求是获取数量。此时其余字段必须为初始化值,start为0,limit为:0, sort为""。 +- 必须设置分页参数,一次最大查询数据不超过500个。 + +### 请求参数示例 + +#### 获取详细信息请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "kind": "deployment", + "filter": { + "condition": "AND", + "rules": [ + { + "field": "cluster_uid", + "operator": "equal", + "value": "1" + }, + { + "field": "namespace", + "operator": "equal", + "value": "namespace1" + }, + { + "field": "name", + "operator": "equal", + "value": "test" + } + ] + }, + "fields": [ + "name" + ], + "page": { + "start": 0, + "limit": 10, + "sort": "name", + "enable_count": false + } +} +``` + +#### 获取数量请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "kind": "deployment", + "filter": { + "condition": "AND", + "rules": [ + { + "field": "cluster_uid", + "operator": "equal", + "value": "1" + }, + { + "field": "namespace", + "operator": "equal", + "value": "namespace1" + }, + { + "field": "name", + "operator": "equal", + "value": "test" + } + ] + }, + "fields": [ + "name" + ], + "page": { + "enable_count": true + } +} +``` + +### 返回结果示例 + +#### 获取详细信息返回结果示例 + +```json + +{ + "result": true, + "code": 0, + "data": { + "count": 0, + "info": [ + { + "name": "test" + } + ] + }, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7" +} +``` + +#### 获取数量返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 100, + "info": [] + } +} +``` + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | + +#### data + +| 字段 | 类型 | 描述 | +|-------|-------|-----------------------| +| count | int | 记录条数 | +| info | array | 实际数据,仅返回fields里设置了的字段 | + +#### info[x] + +| 字段 | 类型 | 描述 | +|-------------------------|--------|-----------------------------------------------------| +| name | string | workload名称 | +| labels | map | 标签 | +| selector | object | 工作负载选择器 | +| replicas | int | 工作负载实例个数 | +| strategy_type | string | 工作负载更新机制 | +| min_ready_seconds | int | 指定新创建的 Pod 在没有任意容器崩溃情况下的最小就绪时间, 只有超出这个时间 Pod 才被视为可用 | +| rolling_update_strategy | object | 滚动更新策略 | + +#### selector + +| 字段 | 类型 | 描述 | +|-------------------|-------|-----------| +| match_labels | map | 根据label匹配 | +| match_expressions | array | 匹配表达式 | + +#### match_expressions[x] + +| 字段 | 类型 | 描述 | +|----------|--------|---------------------------------------------------------------| +| key | string | 标签的key | +| operator | string | 操作符,可选值:"In"、"NotIn"、"Exists"、"DoesNotExist" | +| values | array | 字符串数组,如果操作符为"In"或"NotIn",不能为空,如果为"Exists"或"DoesNotExist",必须为空 | + +#### rolling_update_strategy + +当strategy_type为RollingUpdate,不为空,其他情况为空 + +| 字段 | 类型 | 描述 | +|-----------------|--------|-------| +| max_unavailable | object | 最大不可用 | +| max_surge | object | 最大溢出 | + +#### max_unavailable + +| 字段 | 类型 | 描述 | +|---------|--------|--------------------------------| +| type | int | 可选值为0(表示int类型)或1(表示string类型) | +| int_val | int | 当type为0(表示int类型),对应的的int值 | +| str_val | string | 当type为1(表示string类型),对应的string值 | + +#### max_surge + +| 字段 | 类型 | 描述 | +|---------|--------|--------------------------------| +| type | int | 可选值为0(表示int类型)或1(表示string类型) | +| int_val | int | 当type为0(表示int类型),对应的的int值 | +| str_val | string | 当type为1(表示string类型),对应的string值 | + +**注意:** + +- 如果本次请求是查询详细信息那么count为0,如果查询的是数量,那么info为空 diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_service_template_sync_status.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_service_template_sync_status.md new file mode 100644 index 000000000..c7237fbf6 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_service_template_sync_status.md @@ -0,0 +1,98 @@ +### 功能描述 + +查询服务模板的同步状态(版本:v3.12.3+,权限:业务访问) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|---------------------|-------|----|----------------| +| bk_biz_id | int | 是 | 业务ID | +| service_template_id | int | 是 | 服务模板ID | +| bk_module_ids | array | 是 | 要查询同步状态的模块ID列表 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "service_template_id": 1, + "bk_module_ids": [ + 28, + 29, + 30 + ] +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "e43da4ef221746868dc4c837d36f3807", + "data": [ + { + "bk_inst_id": 30, + "status": "finished", + "creator": "admin", + "create_time": "2023-10-07T12:43:22.795Z", + "last_time": "2023-11-10T03:37:31.009Z" + }, + { + "bk_inst_id": 29, + "status": "finished", + "creator": "admin", + "create_time": "2023-10-07T07:22:43.167Z", + "last_time": "2023-11-10T03:37:31.005Z" + }, + { + "bk_inst_id": 28, + "status": "new", + "creator": "admin", + "create_time": "2023-11-30T09:52:13.706Z", + "last_time": "2023-11-30T09:52:13.706Z" + } + ] +} +``` + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | array | 请求返回的数据 | + +#### data + +| 字段 | 类型 | 描述 | +|-------------|--------|---------------| +| bk_inst_id | int | 实例id,此处为模块ID | +| status | string | 同步状态 | +| creator | string | 同步任务的创建者 | +| create_time | string | 同步任务的创建时间 | +| last_time | string | 同步任务的最后一次更新时间 | + +**同步状态说明**: 实例状态共有need_sync、new、waiting、executing、finished、failure 6种状态,其中: + +- **need_sync** 为待同步 +- **new(新建)/waiting(等待中)/executing(执行中)** 为同步中 +- **finished** 为已同步 +- **failure** 为同步失败 diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/search_objects.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/search_objects.md index d0640eef1..30dd63077 100644 --- a/paas2/esb/components/confapis/cc/apidocs/zh_hans/search_objects.md +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/search_objects.md @@ -14,7 +14,8 @@ | modifier | string | 否 | 本条数据的最后修改人员 | | bk_classification_id | string | 否 | 对象模型的分类ID,只能用英文字母序列命名 | | bk_obj_id | string | 否 | 对象模型的ID,只能用英文字母序列命名 | -| bk_obj_name | string | 否 | 对象模型的名字,用于展示,可以使用人类可以阅读的任何语言 | | +| bk_obj_name | string | 否 | 对象模型的名字,用于展示,可以使用人类可以阅读的任何语言 | +| obj_sort_number | int | 否 | 对象模型在所属模型分组下的排序序号 | ### 请求参数示例 @@ -27,8 +28,9 @@ "creator": "user", "modifier": "user", "bk_classification_id": "test", - "bk_obj_id": "biz" - "bk_obj_name": "aaa" + "bk_obj_id": "biz", + "bk_obj_name": "aaa", + "obj_sort_number": 1 } ``` @@ -57,7 +59,8 @@ "bk_obj_id": "XX", "bk_obj_name": "XXX", "position": "{\"test_obj\":{\"x\":-253,\"y\":137}}", - "bk_supplier_account": "0" + "bk_supplier_account": "0", + "obj_sort_number": 1 } ] } @@ -91,3 +94,4 @@ | bk_obj_icon | string | 对象模型的ICON信息,用于前端显示,取值可参考[(modleIcon.json)](/static/esb/api_docs/res/cc/modleIcon.json)| | position | json object string | 用于前端展示的坐标 | | description | string | 数据的描述信息 | +| obj_sort_number | int | 否 | 对象模型在所属模型分组下的排序序号 | \ No newline at end of file diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/sync_service_template_to_service_instance.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/sync_service_template_to_service_instance.md new file mode 100644 index 000000000..97d44a69a --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/sync_service_template_to_service_instance.md @@ -0,0 +1,57 @@ +### 功能描述 + +同步服务模板信息到相应的服务实例上(版本:v3.12.3+,权限:服务实例的的创建、编辑、删除权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|---------------------|-------|----|-----------| +| bk_biz_id | int | 是 | 业务ID | +| service_template_id | int | 是 | 服务模板ID | +| bk_module_ids | array | 是 | 待同步模块ID列表 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 3, + "service_template_id": 1, + "bk_module_ids": [ + 28 + ] +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "e43da4ef221746868dc4c837d36f3807", + "data": null +} +``` + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/update_kube_cluster_type.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/update_kube_cluster_type.md new file mode 100644 index 000000000..23ad69b00 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/update_kube_cluster_type.md @@ -0,0 +1,53 @@ +### 功能描述 + +更新容器集群类型(v3.12.1+,权限:容器集群的编辑权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|--------------------------------------------------------| +| bk_biz_id | int | 是 | 业务ID | +| id | int | 是 | cluster在cmdb中的唯一ID列表 | +| type | string | 是 | 集群类型。枚举值:INDEPENDENT_CLUSTER(独立集群)、SHARE_CLUSTER(共享集群) | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_biz_id": 2, + "id": 1, + "type": "INDEPENDENT_CLUSTER" +} +``` + +### 返回结果示例 + +```json + { + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": null +} +``` + +### 返回结果参数说明 + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 无数据返回 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/update_object.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/update_object.md index 48322c840..ef4130afb 100644 --- a/paas2/esb/components/confapis/cc/apidocs/zh_hans/update_object.md +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/update_object.md @@ -16,7 +16,7 @@ | bk_obj_name | string | 否 | 对象模型的名字 | | bk_obj_icon | string | 否 | 对象模型的ICON信息,用于前端显示,取值可参考[(modleIcon.json)](/static/esb/api_docs/res/cc/modleIcon.json)| | position | json object string | 否 | 用于前端展示的坐标 | - +| obj_sort_number | int | 否 | 对象模型在所属模型分组下的排序序号;更新该值时当设置的值超过分组模型中该值的最大值,则更新的值为最大值加一,如当设置的值为999,而当前分组模型中该值的最大值为6,则更新值设置为7 | ### 请求参数示例 @@ -32,7 +32,8 @@ "bk_classification_id": "cc_test", "bk_obj_name": "cc2_test_inst", "bk_obj_icon": "icon-cc-business", - "position":"{\"ff\":{\"x\":-863,\"y\":1}}" + "position":"{\"ff\":{\"x\":-863,\"y\":1}}", + "obj_sort_number": 1 } ``` diff --git a/paas2/esb/components/confapis/cc/cc.yaml b/paas2/esb/components/confapis/cc/cc.yaml index bf3bf69c3..cfa9fc6cb 100644 --- a/paas2/esb/components/confapis/cc/cc.yaml +++ b/paas2/esb/components/confapis/cc/cc.yaml @@ -1460,3 +1460,250 @@ comp_codename: generic.v2.cc.cc_component dest_path: /api/v3/deletemany/quoted/instance dest_http_method: DELETE + +- path: /v2/cc/create_kube_cluster/ + name: create_kube_cluster + label: 创建容器集群 + label_en: create kube cluster + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/create/kube/cluster + dest_http_method: POST + is_hidden: true + +- path: /v2/cc/batch_update_kube_cluster/ + name: batch_update_kube_cluster + label: 批量更新容器集群信息 + label_en: update kube cluster batch + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/updatemany/kube/cluster + dest_http_method: PUT + is_hidden: true + +- path: /v2/cc/update_kube_cluster_type/ + name: update_kube_cluster_type + label: 更新容器集群类型 + label_en: update kube cluster type + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/update/kube/cluster/type + dest_http_method: PUT + is_hidden: true + +- path: /v2/cc/batch_delete_kube_cluster/ + name: batch_delete_kube_cluster + label: 批量删除容器集群 + label_en: batch delete kube cluster + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/delete/kube/cluster + dest_http_method: DELETE + is_hidden: true + +- path: /v2/cc/list_kube_cluster/ + name: list_kube_cluster + label: 查询容器集群 + label_en: list kube cluster + suggest_method: POST + api_type: query + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/findmany/kube/cluster + dest_http_method: POST + +- path: /v2/cc/batch_create_kube_node/ + name: batch_create_kube_node + label: 批量创建容器节点 + label_en: batch create kube node + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/createmany/kube/node + dest_http_method: POST + is_hidden: true + +- path: /v2/cc/batch_update_kube_node/ + name: batch_update_kube_node + label: 批量更新容器节点信息 + label_en: batch update kube node + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/updatemany/kube/node + dest_http_method: PUT + is_hidden: true + +- path: /v2/cc/batch_delete_kube_node/ + name: batch_delete_kube_node + label: 批量删除容器节点 + label_en: batch delete kube node + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/deletemany/kube/node + dest_http_method: DELETE + is_hidden: true + +- path: /v2/cc/list_kube_node/ + name: list_kube_node + label: 查询容器节点 + label_en: list container node + suggest_method: POST + api_type: query + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/findmany/kube/node + dest_http_method: POST + +- path: /v2/cc/batch_create_kube_pod/ + name: batch_create_kube_pod + label: 批量创建容器pod + label_en: batch create kube pod + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/createmany/kube/pod + dest_http_method: POST + is_hidden: true + +- path: /v2/cc/batch_delete_kube_pod/ + name: batch_delete_kube_pod + label: 批量删除Pod + label_en: batch delete kube pod + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/deletemany/kube/pod + dest_http_method: DELETE + is_hidden: true + +- path: /v2/cc/list_kube_pod/ + name: list_kube_pod + label: 查询Pod列表 + label_en: list kube pod + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/findmany/kube/pod + dest_http_method: POST + +- path: /v2/cc/list_kube_container/ + name: list_kube_container + label: 查询Container列表 + label_en: list kube container + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/findmany/kube/container + dest_http_method: POST + +- path: /v2/cc/batch_create_kube_namespace/ + name: batch_create_kube_namespace + label: 批量创建namespace + label_en: batch create namespace + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/createmany/kube/namespace + dest_http_method: POST + is_hidden: true + +- path: /v2/cc/batch_update_kube_namespace/ + name: batch_update_kube_namespace + label: 批量更新namespace + label_en: batch update namespace + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/updatemany/kube/namespace + dest_http_method: PUT + is_hidden: true + +- path: /v2/cc/batch_delete_kube_namespace/ + name: batch_delete_kube_namespace + label: 批量删除namespace + label_en: batch delete namespace + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/deletemany/kube/namespace + dest_http_method: DELETE + is_hidden: true + +- path: /v2/cc/list_kube_namespace/ + name: list_kube_namespace + label: 查询namespace + label_en: list namespace + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/findmany/kube/namespace + dest_http_method: POST + +- path: /v2/cc/batch_create_kube_workload/ + name: batch_create_kube_workload + label: 批量创建workload + label_en: batch create workload + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/createmany/kube/workload/{kind} + dest_http_method: POST + is_hidden: true + +- path: /v2/cc/batch_update_kube_workload/ + name: batch_update_kube_workload + label: 批量更新workload + label_en: batch update workload + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/updatemany/kube/workload/{kind} + dest_http_method: PUT + is_hidden: true + +- path: /v2/cc/batch_delete_kube_workload/ + name: batch_delete_kube_workload + label: 批量删除workload + label_en: batch delete workload + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/deletemany/kube/workload/{kind} + dest_http_method: DELETE + is_hidden: true + +- path: /v2/cc/list_kube_workload/ + name: list_kube_workload + label: 查询workload + label_en: list workload + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/findmany/kube/workload/{kind} + dest_http_method: POST + +- path: /v2/cc/sync_service_template_to_service_instance/ + name: sync_service_template_to_service_instance + label: 同步服务模板信息到相应的服务实例上 + label_en: sync service template to service instance + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/update/proc/service_instance/sync + dest_http_method: PUT + is_hidden: true + +- path: /v2/cc/list_service_template_sync_status/ + name: list_service_template_sync_status + label: 查询服务模板的同步状态 + label_en: list service template sync status + suggest_method: POST + api_type: query + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/findmany/proc/service_template_sync_status/bk_biz_id/{bk_biz_id} + dest_http_method: POST + is_hidden: true \ No newline at end of file diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/batch_get_job_instance_ip_log.md b/paas2/esb/components/confapis/jobv3/apidocs/en/batch_get_job_instance_ip_log.md index 9fc1de821..82b827c9f 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/batch_get_job_instance_ip_log.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/batch_get_job_instance_ip_log.md @@ -1,6 +1,6 @@ ### Function Description -Bulk query of job execution logs by ip list +Bulk query of job execution logs by host list ### Request Parameters @@ -10,11 +10,12 @@ Bulk query of job execution logs by ip list | Fields | Type | Required | Description | |-----------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business, biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business, biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_instance_id | long | yes | Job instance ID | | step_instance_id | long | yes | Step instance ID | -| ip_list | array | yes | Source/target host IP list, see ip for definition | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Host IP list. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | ##### ip @@ -34,15 +35,8 @@ Bulk query of job execution logs by ip list "bk_scope_id": "1", "job_instance_id": 100, "step_instance_id": 200, - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - }, - { - "bk_cloud_id": 0, - "ip": "10.0.0.2" - } + "host_id_list": [ + 101,102 ] } ``` @@ -51,47 +45,80 @@ Bulk query of job execution logs by ip list #### Script execution steps ```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 1, + "job_instance_id": 100, + "step_instance_id": 200, + "script_task_logs": [ + { + "bk_host_id": 101, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "log_content": "[2018-03-15 14:39:30][PID:56875] job_start\n" + }, + { + "bk_host_id": 102, + "ip": "10.0.0.2", + "bk_cloud_id": 0, + "log_content": "[2018-03-15 14:39:30][PID:16789] job_start\n" + } + ] + } +} +``` + +#### File execution steps +```json { "result": true, "code": 0, "message": "", "data": { "log_type": 2, - "task_instance_id": 100, + "job_instance_id": 100, "step_instance_id": 200, "file_task_logs": [ { + "bk_host_id": 101, "ip": "10.0.0.1", "bk_cloud_id": 0, "file_logs": [ { - "mode": 1, + "mode": 1, "src_ip": { - "bk_cloud_id": 0, + "bk_host_id": 102, + "bk_cloud_id": 0, "ip": "10.0.0.2" - }, - "src_path": "/data/1.log", + }, + "src_path": "/data/1.log", "dest_ip": { - "bk_cloud_id": 0, + "bk_host_id": 101, + "bk_cloud_id": 0, "ip": "10.0.0.1" - }, - "dest_path": "/tmp/1.log", + }, + "dest_path": "/tmp/1.log", "status": 4, - "log_content": "[2021-06-28 11:32:16] FileName: /tmp/1.log FileSize: 9.0 Bytes State: dest agent success download file Speed: 1 KB/s Progress: 100% StatusDesc: dest agent success download file Detail: success" + "log_content": "[2021-06-28 11:32:16] FileName: /tmp/1.log FileSize: 9.0 Bytes State: dest agent success download file Speed: 1 KB/s Progress: 100% StatusDesc: dest agent success download file Detail: success" } ] }, { + "bk_host_id": 102, "ip": "10.0.0.2", "bk_cloud_id": 0, "file_logs": [ { - "mode": 0, + "mode": 0, "src_ip": { - "bk_cloud_id": 0, + "bk_host_id": 102, + "bk_cloud_id": 0, "ip": "10.0.0.2" - }, - "src_path": "/data/1.log", + }, + "src_path": "/data/1.log", "status": 4, "log_content": "[2021-06-28 11:32:16] FileName: /data/1.log FileSize: 9.0 Bytes State: source agent success upload file Speed: 1 KB/s Progress: 100% StatusDesc: source agent success upload file Detail: success upload" } @@ -122,7 +149,8 @@ Bulk query of job execution logs by ip list | Fields | Type | Description | |-----------|-----------|-----------| -| bk_cloud_id | int | Target server cloud area ID | +| bk_host_id | long | Host ID | +| bk_cloud_id | int | Target server BK-Net ID | | ip | string | Target server IP address | | log_type | int | Log type. 1 - Script execution task log; 2 - File distribution task log | | script_task_logs | array | Log of script execution task. See script_task_log for definition | @@ -132,6 +160,7 @@ Bulk query of job execution logs by ip list | Fields | Type | Description | |-----------|------------|--------| +| bk_host_id | long | Host ID | | bk_cloud_id | long | BK-Net ID | | ip | string | Target IP address | | log_content | string | Script execution log content | @@ -140,6 +169,7 @@ Bulk query of job execution logs by ip list | Fields | Type | Description | |-----------|------------|--------| +| bk_host_id | long | Host ID | | bk_cloud_id | long | BK-Net ID | | ip | string | Source/target IP address | | file_logs | array | File distribution log content. See file_log for definition | @@ -160,5 +190,6 @@ Bulk query of job execution logs by ip list | Fields | Type | Description | |-----------|------------|--------| +| bk_host_id | long | Host ID | | bk_cloud_id | long | BK-Net ID | | ip | string | IP Address | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/check_script.md b/paas2/esb/components/confapis/jobv3/apidocs/en/check_script.md new file mode 100644 index 000000000..f78d25922 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/check_script.md @@ -0,0 +1,74 @@ +### Function Description + +High risk script detection + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| --------------- | ------ | -------- | ------------------------------------------------------------ | +| script_language | int | yes | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | yes | Script content, requiring Base64 encoding | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_language": 1, + "content": "cm0gLXJmIC8=" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": [ + { + "line": 1, + "line_content": "rm /tmp", + "match_content": "rm /tmp", + "level": 1, + "description": "The first line of the script does not define a valid script type, for example: #!/bin/bash" + }, + { + "line": 1, + "line_content": "rm /tmp", + "match_content": "rm", + "level": 3, + "description": "dangerous!!!" + } + ] +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ------------- | ------ | --------------------------------------------------- | +| line | int | Number of rows where the error occurred | +| line_content | string | The content of the line where the script is located | +| match_content | string | Matching Content | +| level | int | Error level: 1- Warning, 2- Error, 3- Fatal | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/create_credential.md b/paas2/esb/components/confapis/jobv3/apidocs/en/create_credential.md index d31150fa6..d3f53f2c8 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/create_credential.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/create_credential.md @@ -10,8 +10,8 @@ Create credential. | Fields | Type | Required | Description | |----------------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | name | string | yes | Required Credential Name | | type | string | yes | Credential type,value can be ACCESS_KEY_SECRET_KEY,PASSWORD,USERNAME_PASSWORD,SECRET_KEY | | description | string | no | Credentials Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/create_dangerous_rule.md b/paas2/esb/components/confapis/jobv3/apidocs/en/create_dangerous_rule.md new file mode 100644 index 000000000..3891e7588 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/create_dangerous_rule.md @@ -0,0 +1,79 @@ +### Function Description + +Create dangerous rule + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| -------------------- | ------ | -------- | ------------------------------------------------------------ | +| expression | string | yes | Expression | +| script_language_list | array | yes | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | yes | Rule description | +| action | int | yes | Processing actions: 1- Scan, 2- Intercept | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "expression": "rm -rf", + "script_language_list": [1], + "description": "drangerous!!!", + "action": 2 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1, + "expression": "rm -rf", + "script_language_list": [1], + "description": "drangerous!!!", + "action": 2, + "status": 0, + "creator": "admin", + "create_time": 1695193968000, + "last_modify_user": "admin", + "last_modify_time": 1695193968000 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| -------------------- | ------ | ------------------------------------------------------------ | +| id | long | Rule id | +| expression | string | expression | +| script_language_list | array | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | Description | +| action | int | Processing actions: 1- Scan, 2- Intercept | +| status | int | Enabling status: 0- disabled, 1- enabled | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/create_file_source.md b/paas2/esb/components/confapis/jobv3/apidocs/en/create_file_source.md index c587a707b..e7d5d5801 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/create_file_source.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/create_file_source.md @@ -19,8 +19,8 @@ The created file source has the following default features: | **Fields** | **Type** | **Required** | **Description** | |-----------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | code | string | yes | File source identification, beginning with English characters, 1-32 English characters, underscores, numbers, cannot be changed after creation | | alias | string | yes | File source alias | | type | string | yes | File Source Type, Currently only the BlueKing Repository is supported,BLUEKING_ARTIFACTORY | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/create_public_script.md b/paas2/esb/components/confapis/jobv3/apidocs/en/create_public_script.md new file mode 100644 index 000000000..c2914ab1c --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/create_public_script.md @@ -0,0 +1,87 @@ +### Function Description + +Create public script + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| --------------- | ------ | -------- | ------------------------------------------------------------ | +| name | string | yes | Public script name | +| description | string | no | Public script description | +| script_language | int | yes | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | yes | Script content, requiring Base64 encoding | +| version | string | yes | Version | +| version_desc | string | no | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "name": "public script test", + "description": "public script test", + "script_language": "1", + "content": "IyEvYmluL2Jhc2gKbHM=", + "version": "1.0" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000018, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "content": "#!/bin/bash\nls", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691739630000, + "version": "1.0", + "status": 0, + "description": "public script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/create_public_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/en/create_public_script_version.md new file mode 100644 index 000000000..41346677a --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/create_public_script_version.md @@ -0,0 +1,85 @@ +### Function Description + +Create Public Script Version + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ------------ | ------ | -------- | ----------------------------------------- | +| script_id | string | yes | Script id | +| content | string | yes | Script content, requiring Base64 encoding | +| version | string | yes | Version | +| version_desc | string | 否 | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "content": "IyEvYmluL2Jhc2gKbHM=", + "version": "2.0", + "version_desc": "version 2" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000020, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "content": "#!/bin/bash\nls", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691739630000, + "version": "1.0", + "version_desc": "version 2", + "status": 0, + "description": "public script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/create_script.md b/paas2/esb/components/confapis/jobv3/apidocs/en/create_script.md new file mode 100644 index 000000000..ec5af25dd --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/create_script.md @@ -0,0 +1,96 @@ +### Function Description + +Create Script + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| --------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| name | string | yes | Script name | +| description | string | no | Script description | +| script_language | int | yes | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | yes | Script content, requiring Base64 encoding | +| version | string | yes | Version | +| version_desc | string | no | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "name": "script test", + "description": "script test", + "script_language": "1", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version": "1.0" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "#!/bin/bash\ndate\n", + "creator": "admin", + "create_time": 1691741073000, + "last_modify_user": "admin", + "last_modify_time": 1691741073000, + "version": "1.0", + "status": 0, + "description": "script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| bk_scope_type | string | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | + diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/create_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/en/create_script_version.md new file mode 100644 index 000000000..cc1ab0fbb --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/create_script_version.md @@ -0,0 +1,93 @@ +### Function Description + +Create Script Version + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| content | string | yes | Script content, requiring Base64 encoding | +| version | string | yes | Version | +| version_desc | string | no | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version": "2.0", + "version_desc": "version 2" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000021, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "#!/bin/bash\ndate\n", + "creator": "admin", + "create_time": 1691743535000, + "last_modify_user": "admin", + "last_modify_time": 1691743535000, + "version": "2.0", + "version_desc": "version 2", + "status": 0, + "description": "script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| bk_scope_type | string | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/delete_dangerous_rule.md b/paas2/esb/components/confapis/jobv3/apidocs/en/delete_dangerous_rule.md new file mode 100644 index 000000000..6440acc40 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/delete_dangerous_rule.md @@ -0,0 +1,50 @@ +### Function Description + +Delete dangerous rule + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ------ | ---- | -------- | ----------- | +| id | long | yes | Rule id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "id": 1 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +null diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/delete_public_script.md b/paas2/esb/components/confapis/jobv3/apidocs/en/delete_public_script.md new file mode 100644 index 000000000..3b1fd4e37 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/delete_public_script.md @@ -0,0 +1,50 @@ +### Function Description + +Delete public script will also delete all script versions under that script. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| --------- | ------ | -------- | ---------------- | +| script_id | string | yes | Public script id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +null diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/delete_public_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/en/delete_public_script_version.md new file mode 100644 index 000000000..b300ba2aa --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/delete_public_script_version.md @@ -0,0 +1,52 @@ +### Function Description + +Delete script version + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------ | +| script_id | string | yes | Public script id | +| script_version_id | long | yes | Public script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": "1000017" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +null diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/delete_script.md b/paas2/esb/components/confapis/jobv3/apidocs/en/delete_script.md new file mode 100644 index 000000000..7e5f0d9c8 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/delete_script.md @@ -0,0 +1,54 @@ +### Function Description + +Delete script will also delete all script versions under that script + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | long | yes | Script id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +null diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/delete_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/en/delete_script_version.md new file mode 100644 index 000000000..421e4c3be --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/delete_script_version.md @@ -0,0 +1,56 @@ +### Function Description + +Delete script version + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| script_version_id | long | yes | Script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +null diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/disable_dangerous_rule.md b/paas2/esb/components/confapis/jobv3/apidocs/en/disable_dangerous_rule.md new file mode 100644 index 000000000..df49db3a6 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/disable_dangerous_rule.md @@ -0,0 +1,57 @@ +### Function Description + +Disable dangerous rule + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ------ | ---- | -------- | ----------- | +| id | long | yes | Rule id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "id": 1 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1, + "status": 0 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ------ | ---- | ---------------------------------------- | +| id | long | Rule id | +| status | int | Enabling status: 0- disabled, 1- enabled | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/disable_public_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/en/disable_public_script_version.md new file mode 100644 index 000000000..3e8e59492 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/disable_public_script_version.md @@ -0,0 +1,61 @@ +### Function Description + +Disable the public script version. Once disabled successfully, it cannot be restored! And any job steps that reference this version online will not be able to be executed, please be cautious when operating. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------ | +| script_id | string | yes | Public script id | +| script_version_id | long | yes | Public script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000018 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000018, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "status": 3 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_id | string | Script id | +| id | long | Script version id | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/disable_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/en/disable_script_version.md new file mode 100644 index 000000000..32b620f44 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/disable_script_version.md @@ -0,0 +1,65 @@ +### Function Description + +Disable script version, once successfully disabled, cannot be restored! And any job steps that reference this version online will not be able to be executed, please be cautious when operating. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| script_version_id | long | yes | Script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "status": 3 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_id | string | Script id | +| id | long | Script version id | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/enable_dangerous_rule.md b/paas2/esb/components/confapis/jobv3/apidocs/en/enable_dangerous_rule.md new file mode 100644 index 000000000..164b2cf79 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/enable_dangerous_rule.md @@ -0,0 +1,57 @@ +### Function Description + +Enable dangerous rule + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ------ | ---- | -------- | ----------- | +| id | long | yes | Rule id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "id": 1 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1, + "status": 1 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ------ | ---- | ---------------------------------------- | +| id | long | Rule id | +| status | int | Enabling status: 0- disabled, 1- enabled | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/execute_job_plan.md b/paas2/esb/components/confapis/jobv3/apidocs/en/execute_job_plan.md index 2681d20fd..572a02532 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/execute_job_plan.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/execute_job_plan.md @@ -10,8 +10,8 @@ Start Job Plan | Fields | Type | Required | Description | |-----------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_plan_id | long | yes | JOB plan ID | | global_var_list | array | no | Global variables. For global variable values in a job execution plan, the value of the incoming variable is used if it is included in the request parameters; otherwise, the default value currently configured by the JOB Plan is used. See global_var for definition | | callback_url | string | no | Callback URL, when the task execution is completed, JOB will call this URL to inform the task execution result. The callback protocol refers to the callback_protocol component documentation | @@ -29,7 +29,8 @@ Start Job Plan | Fields | Type | Required | Description | | ------------------ | ----- | -------- | ------------------------------------------------------- | -| ip_list | array | no | Static IP list, see ip for definition | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | | dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | | topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | @@ -72,15 +73,9 @@ Start Job Plan "id": "blo8gojho0skft7pr5q0" } ], - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - }, - { - "bk_cloud_id": 0, - "ip": "10.0.0.2" - } + "host_id_list": [ + 101, + 102 ], "topo_node_list": [ { diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_script.md b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_script.md index da3e6f4b1..23aad4be6 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_script.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_script.md @@ -10,8 +10,8 @@ Start Job Plan | Fields | Type | Required | Description | |---------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | script_version_id | long | no | Script version ID. When script_version_id is not empty, the script version corresponding to script_version_id is used| | script_id | string | no |Script id. When script_id is passed in and script_version_id is empty, the online version of the script is used| | script_content | string | no |Script content Base64. If script_version_id and script_id do not exist, script_content is used. Priority: script_version_id>script_id>script_content| @@ -26,11 +26,12 @@ Start Job Plan | callback_url | string | no | Callback URL, when the task execution is completed, the JOB will call this URL to inform the task execution result. Callback protocol refer to the callback_protocol component documentation| #### server -| Fields | Type | Required | Description | -| ------------------ | ----- | -------- | ----------------------------------- | -| ip_list | array | no | Static IP list, as defined in ip | -| dynamic_group_list | array | no | Dynamic grouping list, for definition, see dynamic_group | -| topo_node_list | array | no | Dynamic topo node list. See topo_node for definition| +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | #### ip @@ -74,15 +75,9 @@ Start Job Plan "id": "blo8gojho0skft7pr5q0" } ], - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - }, - { - "bk_cloud_id": 0, - "ip": "10.0.0.2" - } + "host_id_list": [ + 101, + 102 ], "topo_node_list": [ { diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_sql.md b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_sql.md index 51967470d..82fd6575b 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_sql.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_execute_sql.md @@ -10,8 +10,8 @@ Quick execution of SQL scripts | Fields | Type | Required | Description | |---------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | script_version_id | long | no | SQL script version ID| | script_id | string | no |Script id. When script_id is passed in and script_version_id is empty, the online version of the current script is used| | script_content | string | no | Script content Base64. If script_version_id and script_id do not exist, script_content is used. Priority: script_version_id>script_id>script_content| @@ -22,11 +22,12 @@ Quick execution of SQL scripts #### server -| Fields | Type | Required | Description | -| ------------------ | ----- | -------- | ----------------------------------- | -| ip_list | array | no | Static IP list, as defined in ip | -| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | -| topo_node_list | array | no | Dynamic topo node list. See topo_node for definition| +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | #### ip @@ -66,15 +67,9 @@ Quick execution of SQL scripts "id": "blo8gojho0skft7pr5q0" } ], - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - }, - { - "bk_cloud_id": 0, - "ip": "10.0.0.2" - } + "host_id_list": [ + 101, + 102 ], "topo_node_list": [ { diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/fast_transfer_file.md b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_transfer_file.md index 1e708eaa2..d1c6610a9 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/fast_transfer_file.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/fast_transfer_file.md @@ -7,8 +7,8 @@ Quick File transfer #### Interface parameters | Fields | Type | Required | Description | |------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | account_alias | string | no |Target execution account alias, available from the account page, recommended. When both account_alias and account_id exist, account_id takes precedence. | | account_id | long | no |Target execution account ID, available from the get_account_List api. When both account_alias and account_id exist, account_id takes precedence. | | file_target_path | string | yes |File transfer destination path| @@ -39,11 +39,12 @@ Quick File transfer #### server -| Fields | Type | Required | Description | -|-----------|------------|--------|------------| -| ip_list | array | no | Static IP list| -| dynamic_group_list | array | no | Dynamic group ID list| -| topo_node_list | array | no | Dynamic topo node list| +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | #### ip_list @@ -86,15 +87,9 @@ Quick File transfer "id": "blo8gojho0sabc7priuy" } ], - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - }, - { - "bk_cloud_id": 0, - "ip": "10.0.0.2" - } + "host_id_list": [ + 101, + 102 ], "topo_node_list": [ { @@ -129,15 +124,9 @@ Quick File transfer "id": "blo8gojho0sabc7priuy" } ], - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - }, - { - "bk_cloud_id": 0, - "ip": "10.0.0.2" - } + "host_id_list": [ + 103, + 104 ], "topo_node_list": [ { diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/generate_local_file_upload_url.md b/paas2/esb/components/confapis/jobv3/apidocs/en/generate_local_file_upload_url.md index 65934361b..0e76c96b7 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/generate_local_file_upload_url.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/generate_local_file_upload_url.md @@ -10,8 +10,8 @@ Generate the local file upload URL. | Fields | Type | Required | Description | |----------------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | file_name_list | string [] | yes |List of file names to upload| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_account_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_account_list.md index 5a008414f..a95cc678c 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_account_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_account_list.md @@ -10,8 +10,8 @@ Query the list of executive accounts to which users have access under the busine | Fields | Type | Required | Description | |----------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | category | int | no | Account usage (1: system account, 2: DB account)| | start | int | no | Start position of paging record, default 0| | length | int | no |The maximum number of records returned in a single time is 1000 at most, default 20| @@ -80,8 +80,8 @@ Query the list of executive accounts to which users have access under the busine | Fields | Type | Description | |-----------|-----------|-----------| | id | long | Account ID| -| bk_scope_type | string |Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | account | string | Account name| | alias | string | Account alias| | category | int | Account usage (1: system account, 2: DB account)| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_detail.md index a007a32a0..bf6448bff 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_detail.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_detail.md @@ -10,8 +10,8 @@ Query Cron job details | Fields | Type | Required | Description | |------------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | id | long | no | Cron Job ID | ### Example of request @@ -57,10 +57,12 @@ Query Cron job details ], "ip_list": [ { + "bk_host_id": 101, "bk_cloud_id": 0, "ip": "10.0.0.1" }, { + "bk_host_id": 102, "bk_cloud_id": 0, "ip": "10.0.0.2" } @@ -102,8 +104,8 @@ Query Cron job details #### data | Fields | Type | Description | |------------------|-----------|-----------| -| bk_scope_type | string |Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_plan_id | long | Job Plan ID | | id | long | Cron job ID | | name | string | Cron job name | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_list.md index b867e0ced..dc9d199cb 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_cron_list.md @@ -10,8 +10,8 @@ Query information of cron jobs under business | Fields | Type | Required | Description | |------------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | name | string | no | Cron job name | | id | long | no | Cron Job ID. If it exists, ignore other filtering criteria and only query the specified job information | | status | int | no | Cron job status: 1. Started, 2. Paused | @@ -92,8 +92,8 @@ Query information of cron jobs under business #### data | Fields | Type | Description | |------------------|-----------|-----------| -| bk_scope_type | string |Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_plan_id | long | Job Plan ID | | id | long | Cron job ID | | name | string | Cron job name | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_dangerous_rule_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_dangerous_rule_list.md new file mode 100644 index 000000000..d77f0ad4e --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_dangerous_rule_list.md @@ -0,0 +1,79 @@ +### Function Description + +Get dangerous rule list + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| -------------------- | ------ | -------- | ------------------------------------------------------------ | +| expression | string | no | Expression | +| script_language_list | array | no | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | no | Rule description | +| action | int | no | Processing actions: 1- Scan, 2- Intercept | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_language_list": [1], + "action": 2 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": [ + { + "id": 1, + "expression": "rm", + "script_language_list": [1], + "description": "drangerous!!!" + "action": 2, + "status": 0, + "creator": "admin", + "create_time": 1695193968000, + "last_modify_user": "admin", + "last_modify_time": 1695302417000 + } + ] +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| -------------------- | ------ | ------------------------------------------------------------ | +| id | long | Rule id | +| expression | string | expression | +| script_language_list | array | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | Description | +| action | int | Processing actions: 1- Scan, 2- Intercept | +| status | int | Enabling status: 0- disabled, 1- enabled | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_global_var_value.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_global_var_value.md index 3664afcef..3fcb3170b 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_global_var_value.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_global_var_value.md @@ -10,8 +10,8 @@ Gets the value of the job instance global variable | Fields | Type | Required | Description | |-----------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_instance_id | long | yes |Job instance ID| ### Example of request diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_ip_log.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_ip_log.md index 7783c6749..ba1138351 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_ip_log.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_ip_log.md @@ -1,6 +1,6 @@ ### Function Description -Query job execution log by ip +Query job execution log by host ### Request Parameters @@ -10,12 +10,13 @@ Query job execution log by ip | Fields | Type | Required | Description | |-----------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_instance_id | long | yes |Job instance ID| | step_instance_id | long | yes |Step instance ID| -| bk_cloud_id | int | yes |Target server cloud area ID| -| ip | string | yes |Destination server IP| +| bk_cloud_id | int | no |Target server BK-Net ID| +| ip | string | no |Destination server IP. ***Deprecated, it is recommended to use the bk_host_id parameter| +| bk_host_id | string | no | Host ID| ### Example of request @@ -28,8 +29,7 @@ Query job execution log by ip "bk_scope_id": "1", "job_instance_id": 50, "step_instance_id": 100, - "bk_cloud_id": 0, - "ip": "10.0.0.1" + "bk_host_id": 101 } ``` @@ -43,6 +43,7 @@ Query job execution log by ip "message": "", "data": { "log_type": 1, + "bk_host_id": 101, "ip": "10.0.0.1", "bk_cloud_id": 0, "log_content": "[2018-03-15 14:39:30][PID:56875] job_start\n" @@ -59,17 +60,20 @@ Query job execution log by ip "message": "", "data": { "log_type": 2, + "bk_host_id": 101, "ip": "10.0.0.1", "bk_cloud_id": 0, "file_logs": [ { "mode": 1, "src_ip": { + "host_id": 102, "bk_cloud_id": 0, "ip": "10.0.0.2" }, "src_path": "/data/1.log", "dest_ip": { + "bk_host_id": 101, "bk_cloud_id": 0, "ip": "10.0.0.1" }, @@ -80,6 +84,7 @@ Query job execution log by ip { "mode": 0, "src_ip": { + "bk_host_id": 102, "bk_cloud_id": 0, "ip": "10.0.0.2" }, diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_list.md index d9d771fbb..da443c291 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_list.md @@ -10,8 +10,8 @@ Query job instance list (execution history) | Fields | Type | Required | Description | | ----------------- | ------ | ---- | ------------------------------------------------------------ | -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | create_time_start | long | yes |Creation time start, Unix timestamp, in milliseconds | | create_time_end | long | yes |Creation time end, Unix timestamp, in milliseconds | | job_instance_id | long | no |Task instance ID. If job_instance_id is in or out, other query criteria are ignored | @@ -95,8 +95,8 @@ Query job instance list (execution history) | Fields | Type | Description | | --------------- | ------ | ------------------------------------------------------------ | -| bk_scope_type | string | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | id | long | Job Plan ID | | job_template_id | long | Job Template ID, which has a value when the task is Job Plan | | job_plan_id | long | Job Plan ID, which has a value when the task is a Job Plan | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_status.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_status.md index fbe43c183..c88f7f965 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_status.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_instance_status.md @@ -10,8 +10,8 @@ Query job execution status based on job instance ID | Fields | Type | Required | Description | |------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_instance_id | long | yes |Job instance ID| | return_ip_result | boolean | no |Whether to return the task details on each ip corresponds to step_ip_result_list in the return result. The default value is false. | @@ -61,6 +61,7 @@ Query job execution status based on job instance ID "start_time": 1605064271000, "step_ip_result_list": [ { + "bk_host_id": 101, "ip": "10.0.0.1", "bk_cloud_id": 0, "status": 9, @@ -107,8 +108,8 @@ Query job execution status based on job instance ID | start_time | long | Execution start time, Unix timestamp, in milliseconds| | end_time | long | Execution end time, Unix timestamp, in milliseconds| | total_time | int | Total elapsed time in milliseconds| -| bk_scope_type | string |Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_instance_id | long | Job instance ID| #### step_instance @@ -131,6 +132,7 @@ Query job execution status based on job instance ID | Fields | Type | Description | |-----------|-----------|-----------| +| bk_host_id | long | Host ID | | ip | string | IP | | bk_cloud_id | long | BK-Net ID | | status | int | Agent task execution status: 1. Agent exception; Pending implementation Successful execution Failed to distribute the task; 404. Forced termination of task failed| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_detail.md index 2dc0d8c47..4d06281ed 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_detail.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_detail.md @@ -10,8 +10,8 @@ Check Job Plan details by Job Plan ID | Fields | Type | Required | Description | |-------------|-------------|--------|--------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_plan_id | long | yes |Job Plan ID| ### Example of request @@ -68,10 +68,12 @@ Check Job Plan details by Job Plan ID ], "ip_list": [ { + "bk_host_id": 101, "bk_cloud_id": 0, "ip": "10.0.0.1" }, { + "bk_host_id": 102, "bk_cloud_id": 0, "ip": "10.0.0.2" } @@ -158,10 +160,12 @@ Check Job Plan details by Job Plan ID ], "ip_list": [ { + "bk_host_id": 103, "bk_cloud_id": 0, "ip": "10.0.0.3" }, { + "bk_host_id": 104, "bk_cloud_id": 0, "ip": "10.0.0.4" } @@ -202,8 +206,8 @@ Check Job Plan details by Job Plan ID | Fields | Type | Description | |------------------|-----------|-----------| -| bk_scope_type | string |Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_plan_id | long | Job Plan ID | | name | string | Job name| | creator | string | Job creator account number| @@ -269,6 +273,7 @@ Check Job Plan details by Job Plan ID #### ip | Fields | Type | Description | |-------------|---------|---------| +| bk_host_id | long | Host ID | | bk_cloud_id | int | BK-Net ID | | ip | string | IP Address | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_list.md index 0b6b8231f..168fb15d4 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_plan_list.md @@ -10,8 +10,8 @@ Search Job Plan list | Fields | Type | Required | Description | |------------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_template_id | long | no | Job template ID| | creator | string | no | Job Plan creator | | name | string | no |Job Plan name, fuzzy match| @@ -89,8 +89,8 @@ Search Job Plan list | Fields | Type | Description | |------------------|-----------|-----------| -| bk_scope_type | string |Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | id | long | Job Plan ID | | job_template_id | long | Job Template ID | | name | string | Job Plan name | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_template_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_template_list.md index b2a02ddd2..9a297fe77 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_template_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_job_template_list.md @@ -10,8 +10,8 @@ Query job template list | Fields | Type | Required | Description | |------------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | creator | string | no | Job Plan creator account | | name | string | no | Job Plan name, fuzzy match | | create_time_start | long | no | Creation time start, Unix timestamp| @@ -86,8 +86,8 @@ Query job template list | Fields | Type | Description | |------------------|-----------|-----------| -| bk_scope_type | string |Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | id | long | Job template ID| | name | string | Job template name| | creator | string | Creator account number| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_proc_result.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_proc_result.md deleted file mode 100644 index 996e5e410..000000000 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_proc_result.md +++ /dev/null @@ -1,97 +0,0 @@ -### Function Description - -Process results query on action server - -### Request Parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Fields | Type | Required | Description | -|-------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | -| bk_gse_taskid | string | yes |GSE task ID| - -### Example of request - -```json -{ - "bk_app_code": "esb_test", - "bk_app_secret": "xxx", - "bk_token": "xxx", - "bk_scope_type": "biz", - "bk_scope_id": "1", - "bk_gse_taskid": "GSETASK:20180315180551:1000" -} -``` - -### Example of responses - -```json -{ - "result": true, - "code": 0, - "message": "success", - "data": { - "status": 115, - "result": { - "/usr/local/gse/gseagent/plugins/unifyTlogc/sbin/bk_gse_unifyTlogc:0:10.0.0.1": { - "content": { - "process": [ - { - "instance": [ - { - "cpuUsageAve": 0, - "stat": "", - "phyMemUsage": 0, - "cmdline": "", - "freeVMem": "0", - "pid": -1, - "threadCount": 0, - "cpuUsage": 0, - "elapsedTime": 0, - "processName": "bk_gse_unifyTlogc", - "diskSize": -1, - "stime": "0", - "startTime": "", - "usePhyMem": 0, - "utime": "0" - } - ], - "procname": "bk_gse_unifyTlogc" - } - ], - "ip": "10.0.0.1", - "utctime": "2018-04-04 09:56:20", - "utctime2": "2018-04-04 01:56:20", - "timezone": 8 - }, - "error_code": 0, - "error_msg": "success" - } - } - }, - "request_id": "2d00aa03e3034f29a07ee1b9c889d38e" -} -``` - -### Response Description - -#### response -| Fields | Type | Description | -|-----------|-----------|-----------| -| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| -| code | int | Error code. 0 indicates success, >0 indicates failure| -| message | string |Error message| -| data | object |Data returned by request| -| permission | object |Permission information| -| request_id | string |Request chain id| - -#### data - -| Fields | Type | Description | -|-----------|-----------|-----------| -| status | int | Reserved field. GSE task status code| -| result | object | Real data, depending on the GSE data structure| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_list.md index 2b9d70403..35db67510 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_list.md @@ -42,7 +42,6 @@ Query public script list "id": "000dbdddc06c453baf1f2decddf00c69", "name": "a.sh", "script_language": 1, - "public": false, "online_script_version_id": 100, "creator": "admin", "create_time": 1600746078520, diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_detail.md index 20d14aa7c..b99b7eee3 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_detail.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_detail.md @@ -42,7 +42,9 @@ Query public script version details "creator": "admin", "create_time": 1600746078520, "last_modify_user": "admin", - "last_modify_time": 1600746078520 + "last_modify_time": 1600746078520, + "script_language": 1, + "description": "script description" } } ``` @@ -73,3 +75,5 @@ Query public script version details | create_time | long | Creation time Unix timestamp (ms)| | last_modify_user | string | Last modify user| | last_modify_time | long | Last modified time Unix timestamp (ms)| +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_list.md index 26b5691bc..1c25b5bf0 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_public_script_version_list.md @@ -48,7 +48,9 @@ Query public script version list "creator": "admin", "create_time": 1600746078520, "last_modify_user": "admin", - "last_modify_time": 1600746078520 + "last_modify_time": 1600746078520, + "script_language": 1, + "description": "script description" } ], "start": 0, @@ -84,3 +86,5 @@ Query public script version list | create_time | long | Creation time Unix timestamp (ms)| | last_modify_user | string | Last modify user| | last_modify_time | long | Last modified time Unix timestamp (ms)| +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_list.md index f2fe10b16..64fda155e 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_list.md @@ -10,8 +10,8 @@ Query business script list | Fields | Type | Required | Description | |----------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | name | string | no | Script name, supports fuzzy query| | script_language | int | no | Scripting language. 0: all script types, 1: shell, 2: bat,3:perl,4: python,5:powershell,6: sql. Default 0| | start | int | no | Start position of paging record, default 0| @@ -79,8 +79,8 @@ Query business script list | Fields | Type | Description | |-----------|-----------|-----------| | id | string | Script ID| -| bk_scope_type | string |Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | name | string | Script name| | script_language | int | Scripting language. 1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - SQL | | online_script_version_id | long | Online script version ID; null if the script does not have an online version| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_detail.md index 4efcfde9d..2f048768e 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_detail.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_detail.md @@ -10,8 +10,8 @@ Query business script version details | Fields | Type | Required | Description | |----------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | id | long | yes |Script version ID. If passed in, other conditions will be masked based on this condition| | script_id | string | no | Script ID (can be passed in with version to locate a script version)| | version | string | no | Script version (can be passed in with script_id to locate a script version)| @@ -48,7 +48,9 @@ Query business script version details "creator": "admin", "create_time": 1600746078520, "last_modify_user": "admin", - "last_modify_time": 1600746078520 + "last_modify_time": 1600746078520, + "script_language": 1, + "description": "script description" } } ``` @@ -70,8 +72,8 @@ Query business script version details | Fields | Type | Description | |-----------|-----------|-----------| | id | long | Script version ID| -| bk_scope_type | string |Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | script_id | string | Script ID to which the script version belongs| | version | string | Version| | content | string | Script version content| @@ -81,3 +83,5 @@ Query business script version details | create_time | long | Creation time Unix timestamp (ms)| | last_modify_user | string | Last modify user| | last_modify_time | long | Last modified time Unix timestamp (ms)| +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_list.md b/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_list.md index be9d9d098..e03b48201 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/get_script_version_list.md @@ -10,8 +10,8 @@ Query business script version list | Fields | Type | Required | Description | |----------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | script_id | string | yes |Script ID| | return_script_content | bool | no | Whether the script content needs to be returned. True: returns script content; False: does not return script content. The default is false. | | start | int | no | Start position of paging record, default 0| @@ -54,7 +54,9 @@ Query business script version list "creator": "admin", "create_time": 1600746078520, "last_modify_user": "admin", - "last_modify_time": 1600746078520 + "last_modify_time": 1600746078520, + "script_language": 1, + "description": "script description" } ], "start": 0, @@ -81,8 +83,8 @@ Query business script version list | Fields | Type | Description | |-----------|-----------|-----------| | id | long | Script version ID| -| bk_scope_type | string |Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | script_id | string | Script ID to which the script version belongs| | version | string | Version| | content | string | Script content| @@ -92,3 +94,5 @@ Query business script version list | create_time | long | Creation time Unix timestamp (ms)| | last_modify_user | string | Last modify user| | last_modify_time | long | Last modified time Unix timestamp (ms)| +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/manage_proc.md b/paas2/esb/components/confapis/jobv3/apidocs/en/manage_proc.md deleted file mode 100644 index bc46f30d4..000000000 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/manage_proc.md +++ /dev/null @@ -1,128 +0,0 @@ -### Function Description - -Register hosting/unhosting processes on the server - -### Request Parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Fields | Type | Required | Description | -|-------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | -| op_type | int | yes |Operation type, optional value: 1: Register managed processes; 2: unmanage processes| -| process_infos | array | yes |For the process operation parameter array, see the following process_infos structure definition| - -#### process_infos - -| Fields | Type | Required | Description | -|-------------|------------|--------|------------| -| proc_name | string | yes |Process name, for example bk_gse| -| proc_owner | string | yes |Process owner (contact)| -| setup_path | string | no |Process path, for example,/usr/local/gse/sbin| -| pid_path | string | no |Path to pid file for process| -| cfg_path | string | no |Process profile path| -| log_path | string | no |Process log file path| -| start_cmd | string | no |Process start command| -| stop_cmd | string | no |Process stop command| -| restart_cmd | string | no |Process restart command| -| reload_cmd | string | no |Process reload command| -| kill_cmd | string | no |Process kill command| -| func_id | string | no |Process function ID defined by CC| -| instance_id | string | no |CC defined process instance ID| -| value_key | string | no |Agent management process index key. When the index key is empty. The index key takes setup_path+Proc_name. Note: If there are two managed processes with the same setup_path+Proc_name, specify value_key| -| type | int | no |Process managed type, 0: cycle execution process, 1: Resident process, 2: single execution process. Default 0| -| cpu_lmt | int | no |The process uses the cpu limit. The value [range of 0,100, and 10] means 10%. If the limit is exceeded, the agent will stop the process according to the configured stop_cmd. | -| mem_lmt | int | no |The process uses mem limit, the value range 0,100,10 means 10[%, exceeding] the limit agent will stop the process according to the configured stop_cmd. | -| cycle_time | int | no |Process loop execution cycle, cycle_time needs to be specified when type is 0. | -| instance_num | int | no |Number of process instances. | -| op_timeout | int | no |Process operation timeout. | -| start_check_begin_time | int | no |_("Start check time after process starts. ") }} | -| start_check_end_time | int | no |_("End check time after process starts. ") }} | -| ip_list | array | yes |IP object array, see ip_list structure definition below| - - -#### ip_list - -| Fields | Type | Required | Description | -|-------------|------------|--------|------------| -| bk_cloud_id | int | yes | BK-Net ID | -| ip | string | yes | IP Address | - -### Example of request - -```json -{ - "bk_app_code": "esb_test", - "bk_app_secret": "xxx", - "bk_token": "xxx", - "bk_scope_type": "biz", - "bk_scope_id": "1", - "op_type": 1, - "process_infos": [ - { - "proc_name": "nginx", - "proc_owner": "root", - "setup_path": "/data/home/nginx/bin/", - "cfg_path": "/data/etc/nginx.conf", - "log_path": "/data/logs/nginx/", - "pid_path": "/data/var/run/nginx/", - "start_cmd": "echo start", - "stop_cmd": "echo stop", - "restart_cmd": "echo restart", - "reload_cmd": "echo reload", - "kill_cmd": "echo kill", - "func_id": "", - "instance_id": "", - "value_key": "key_test", - "type": 2, - "cpu_lmt": 20, - "mem_lmt": 30, - "cycle_time": 10, - "instance_num": 2, - "start_check_begin_time": 5, - "start_check_end_time": 5, - "op_timeout": 5, - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - } - ] - } - ] -} -``` - -### Example of responses - -```json -{ - "result": true, - "code": 0, - "message": "", - "data": { - "bk_gse_taskid": "GSETASK:20180315180551:1000" - } -} -``` - -### Response Description - -#### response -| Fields | Type | Description | -|-----------|-----------|-----------| -| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed| -| code | int | Error code. 0 indicates success, >0 indicates failure| -| message | string |Error message| -| data | object |Data returned by request| -| permission | object |Permission information| -| request_id | string |Request chain id| - -#### data - -| Fields | Type | Description | -|-----------|-----------|-----------| -| bk_gse_taskid | string | GSE task ID| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/operate_job_instance.md b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_job_instance.md index 6cab9b1c0..088ba8fe5 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/operate_job_instance.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_job_instance.md @@ -10,8 +10,8 @@ Use to perform actions on an executed job instance, such as terminating a job. | Fields | Type | Required | Description | |-----------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_instance_id | long | yes |Job instance ID| | operation_code | int | yes |Operation Code: 1. Terminate job| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/operate_proc.md b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_proc.md deleted file mode 100644 index a425d1175..000000000 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/operate_proc.md +++ /dev/null @@ -1,97 +0,0 @@ -### Function Description - -Processes on the operation server - -### Request Parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Fields | Type | Required | Description | -|-------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | -| op_type | int | yes |Operation type, optional value: 0: Start process; 1: stop process (stop); 2: process status query; 3: Register managed process; 4: cancel managed process; 7: restart the process (restart); 8: reload; 9: kill process (kill)| -| process_infos | array | yes |For the process operation parameter array, see the following process_infos structure definition| - -#### process_infos - -| Fields | Type | Required | Description | -|-------------|------------|--------|------------| -| setup_path | string | yes |Process path, for example,/usr/local/gse/gseagent/plugins/unifyTlogc/sbin| -| proc_name | string | yes |Process name, for example bk_gse_unifyTlogc| -| pid_path | string | yes |Path to the pid file of the process, for example,/usr/local/gse/gseagent/plugins/unifyTlogc/log/bk_gse_unifyTlogc.pid| -| account | string | no | System account, not transferred to root by default| -| cmd_shell_ext | string | no | Extension of process action control script: sh: default shell for Linux or Cygwin,bat: dos scripts for Windows,ps1: Powershell script for Windows; Note: This is a unified configuration for all IPS under the ip_list parameter, so ensure that all IPS under the ip_list parameter passed by the interface can support the specified script. | -| cpu_lmt | int | no | The process uses the cpu limit, beyond which the agent calls the appropriate type of stopCmd to stop the process according to the configured cmd_Shel_ext. | -| mem_lmt | int | no | The process uses mem limits, beyond which the agent will call the appropriate type of stopCmd to stop the process according to the configured cmd_shelll_ext. | -| ip_list | array | yes |IP object array, see ip_list structure definition below| - -#### ip_list - -| Fields | Type | Required | Description | -|-------------|------------|--------|------------| -| bk_cloud_id | int | yes | BK-Net ID | -| ip | string | yes | IP Address | - -### Example of request - -```json -{ - "bk_app_code": "esb_test", - "bk_app_secret": "xxx", - "bk_token": "xxx", - "bk_scope_type": "biz", - "bk_scope_id": "1", - "op_type": 1, - "process_infos": [ - { - "setup_path": "/usr/local/xxx", - "proc_name": "gseagent", - "pid_path": "/usr/local/xxx", - "account": "root", - "cmd_shell_ext": "bat", - "cpu_lmt": 50, - "mem_lmt": 30, - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - } - ] - } - ] -} -``` - -### Example of responses - -```json -{ - "result": true, - "code": 0, - "message": "", - "data": { - "bk_gse_taskid": "GSETASK:20180315180551:1000" - } -} -``` - -### Response Description - -#### response -| Fields | Type | Description | -|-----------|-----------|-----------| -| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| -| code | int | Error code. 0 indicates success, >0 indicates failure| -| message | string |Error message| -| data | object |Data returned by request| -| permission | object |Permission information| -| request_id | string |Request chain id| - -#### data - -| Fields | Type | Description | -|-----------|-----------|-----------| -| bk_gse_taskid | string | GSE task ID| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/operate_process.md b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_process.md deleted file mode 100644 index f61d1f083..000000000 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/operate_process.md +++ /dev/null @@ -1,113 +0,0 @@ -### Function Description - -Processes on the operation server are versioned v2 - -### Request Parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Fields | Type | Required | Description | -|-------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | -| op_type | int | yes |Operation type, optional value: 0: Start process; 1: stop the process (stop); 2: process status query; 3: Register managed process; 4: cancel managed process; 7: restart the process (restart); 8: reload; 9: kill process (kill)| -| process_infos | array | yes |For the process operation parameter array, see the following process_infos structure definition| - -#### process_infos - -| Fields | Type | Required | Description | -|-------------|------------|--------|------------| -| setup_path | string | yes |Process path, for example,/usr/local/gse/gseagent/plugins/unifyTlogc/sbin| -| proc_name | string | yes |Process name, for example bk_gse_unifyTlogc| -| pid_path | string | yes |Path to the pid file of the process, for example,/usr/local/gse/gseagent/plugins/unifyTlogc/log/bk_gse_unifyTlogc.pid| -| cfg_path | String | no | Configuration directory| -| log_path | String | no | Log directory| -| contact | String | no | Process owner (contact)| -| start_cmd | string | no | Process start command| -| stop_cmd | string | no | Process stop command| -| restart_cmd | string | no | Process restart command| -| reload_cmd | string | no | Process reload command| -| kill_cmd | string | no | Process kill command| -| func_id | string | no | Internal use field, which can be blank. CC defined process function id. | -| instance_id | string | no | Internal use field, which can be blank. CC defined process instance ID. | -| value_key | string | no | Agent management process index key, which can be null. When the index key is empty, the index key adopts setupPath+proceName. If there are two managed processes with the same setupPath+proceName, specify value_key to differentiate. | -| type | int | no | Process managed type. 0 is a periodic execution process, 1 is a resident process, and 2 is a single execution process| -| cycle_time | int | no | Process loop execution cycle| -| instance_num | int | no | Number of process instances| -| start_check_begin_time |int| no | Start check time aft process start| -| start_check_end_time | int| no | End check time after process starts| -| op_timeout | int | no | Process operation timeout| -| account | string | no | System account, not transferred to root by default| -| cpu_lmt | int | no | The process uses the cpu limit, beyond which the agent calls the appropriate type of stopCmd to stop the process according to the configured cmd_Shel_ext. | -| mem_lmt | int | no | The process uses the mem limit, beyond which the agent will call the appropriate type of stopCmd to stop the process according to the configured cmd_Shel_ext. | -| ip_list | array | yes |IP object array, see ip_list structure definition below| - -#### ip_list - -| Fields | Type | Required | Description | -|-------------|------------|--------|------------| -| bk_cloud_id | int | yes | BK-Net ID | -| ip | string | yes | IP Address | - -### Example of request - -```json -{ - "bk_app_code": "esb_test", - "bk_app_secret": "xxx", - "bk_token": "xxx", - "bk_scope_type": "biz", - "bk_scope_id": "1", - "op_type": 1, - "process_infos": [ - { - "setup_path": "/usr/local/xxx", - "proc_name": "gseagent", - "pid_path": "/usr/local/xxx", - "account": "root", - "contact": "root", - "cpu_lmt": 50, - "mem_lmt": 30, - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - } - ] - } - ] -} -``` - -### Example of responses - -```json -{ - "result": true, - "code": 0, - "message": "", - "data": { - "bk_gse_taskid": "GSETASK:20180315180551:1000" - } -} -``` - -### Response Description - -#### response -| Fields | Type | Description | -|-----------|-----------|-----------| -| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| -| code | int | Error code. 0 indicates success, >0 indicates failure| -| message | string |Error message| -| data | object |Data returned by request| -| permission | object |Permission information| -| request_id | string |Request chain id| - -#### data - -| Fields | Type | Description | -|-----------|-----------|-----------| -| bk_gse_taskid | string | GSE task ID| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/operate_step_instance.md b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_step_instance.md index 7af9b8cb4..0ca624eb2 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/operate_step_instance.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/operate_step_instance.md @@ -10,8 +10,8 @@ Used to perform actions on the steps of an executed instance, such as retry, ign | Fields | Type | Required | Description | |-----------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_instance_id | long | yes |Job instance ID| | step_instance_id | long | yes |Step instance ID| | operation_code | int | yes |Operation Code: 2. Retry failed IP; 3. Ignore error; 6. Confirm continue; 8. Retry all ; 9. Terminate the confirmation process; 10. Restart the confirmation; 11. Enter the next step; 12. Forcibly skip| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/publish_public_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/en/publish_public_script_version.md new file mode 100644 index 000000000..a8143b547 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/publish_public_script_version.md @@ -0,0 +1,61 @@ +### Function Description + +After the public script version is launched, the previous online script will be set to offline status, but it will not affect the use of tasks. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------ | +| script_id | string | yes | Public script id | +| script_version_id | long | yes | Public script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000018 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000018, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "status": 2 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_id | string | Script id | +| id | long | Script version id | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/publish_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/en/publish_script_version.md new file mode 100644 index 000000000..1777dbd2f --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/publish_script_version.md @@ -0,0 +1,65 @@ +### Function Description + +After the online script version is launched, the previous online script will be set to offline status, but it will not affect the use of homework. + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| script_version_id | long | yes | Script version id | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "status": 1 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_id | string | Script id | +| id | long | Script version id | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/push_config_file.md b/paas2/esb/components/confapis/jobv3/apidocs/en/push_config_file.md index f3d1973fc..644c85858 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/push_config_file.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/push_config_file.md @@ -10,8 +10,8 @@ Distribute configuration files, this interface is used to distribute small plain | Fields | Type | Required | Description | |-------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | task_name | string | no | Custom job name| | account_alias | string | yes |Execute account alias| | file_target_path | string | yes |File transfer destination path| @@ -27,11 +27,13 @@ Distribute configuration files, this interface is used to distribute small plain #### server -| Fields | Type | Required | Description | -| ------------------ | ----- | -------- | ----------------------------------- | -| ip_list | array | no | Static IP list, as defined in ip | -| dynamic_group_list | array | no | Dynamic grouping list, for definition, see dynamic_group | -| topo_node_list | array | no | For dynamic topo node list, see topo_node for definition| +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | + #### ip @@ -60,7 +62,7 @@ Distribute configuration files, this interface is used to distribute small plain "bk_token": "xxx", "bk_scope_type": "biz", "bk_scope_id": "1", - "account": "root", + "account_alias": "root", "file_target_path": "/tmp/", "file_list": [ { @@ -74,15 +76,9 @@ Distribute configuration files, this interface is used to distribute small plain "id": "blo8gojho0skft7pr5q0" } ], - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - }, - { - "bk_cloud_id": 0, - "ip": "10.0.0.2" - } + "host_id_list": [ + 101, + 102 ], "topo_node_list": [ { diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/save_cron.md b/paas2/esb/components/confapis/jobv3/apidocs/en/save_cron.md index b8367f561..7de40b05e 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/save_cron.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/save_cron.md @@ -10,8 +10,8 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default | Fields | Type | Required | Description | |-----------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_plan_id | long | yes |Job Plan ID of the job to be executed regularly| | id | long | no | Cron Job ID, when updating a Cron Job, you must pass this value Cron Job | | name | string | no | Cron job name, required for new creation and optional for modification | @@ -29,11 +29,12 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default | server | object | no | The value of the host type global variable| #### server -| Fields | Type | Required | Description | -|-----------------------|-------|--------|------------| -| ip_list | array | no | Static IP list| -| dynamic_group_list | array | no | Dynamic grouping list| -| topo_node_list | array | no | Dynamic topo node list| +| Fields | Type | Required | Description | +| ------------------ | ----- | -------- | ------------------------------------------------------- | +| host_id_list | array | no | Host ID list | +| ip_list | array | no | Static IP list, see ip for definition. ***Deprecated, it is recommended to use the host_id_list parameter***; if host_id_list and ip_list exist at the same time, the ip_list parameter will be ignored. | +| dynamic_group_list | array | no | Dynamic grouping list, see dynamic_group for definition | +| topo_node_list | array | no | Dynamic topo node list, see topo_node for definition | #### ip @@ -59,7 +60,6 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default "bk_username": "admin", "bk_scope_type": "biz", "bk_scope_id": "1", - "execute_time": 0, "expression": "0 0/5 * * *", "job_plan_id": 1023060, "name": "test API", @@ -87,12 +87,7 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default { "name": "hostVar", "server": { - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - } - ] + "host_id_list": [1,2,3] } } ] @@ -108,7 +103,6 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default "bk_username": "admin", "bk_scope_type": "biz", "bk_scope_id": "1", - "execute_time": 0, "expression": "0 0/5 * * *", "job_plan_id": 1023060, "name": "test API", @@ -136,12 +130,7 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default { "name": "hostVar", "server": { - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - } - ] + "host_id_list": [2,3,4] } } ] @@ -219,6 +208,7 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default "server": { "ip_list": [ { + "bk_host_id": 101, "bk_cloud_id": 0, "ip": "10.0.0.1" } @@ -231,8 +221,7 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default "create_time": 1642045370, "last_modify_user": "admin", "last_modify_time": 1642045370 - }, - "job_request_id": "19b76b84e481846e" + } } ``` #### 2. Update Cron Job @@ -305,6 +294,7 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default "server": { "ip_list": [ { + "bk_host_id": 101, "bk_cloud_id": 0, "ip": "10.0.0.1" } @@ -317,8 +307,7 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default "create_time": 1641990674, "last_modify_user": "admin", "last_modify_time": 1641995052 - }, - "job_request_id": "69f5b499072003aa" + } } ``` @@ -341,8 +330,8 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default | id | long | Cron Job ID | | name | string | Cron job name | | status | int | Cron Job Status | -| bk_scope_type | string |Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string |Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | job_plan_id | long | Job Plan ID of the job to be executed regularly | | creator | string | Creator| | create_time | long | Created time, Unix timestamp| @@ -368,6 +357,7 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default | Fields | Type | Description | |-----------------------|-------|------------| | variable | string |Referenced variable name| +| host_id_list | array | Host ID list | | ip_list | array |Static IP list| | dynamic_group_list | array |Dynamic group ID list| | topo_node_list | array |Dynamic topo node list| @@ -375,6 +365,7 @@ Create or update Cron Job; Create Cron Job, Cron Job status is paused by default #### ip | Fields | Type | Description | |-------------|---------|---------| +| bk_host_id | long | Host ID | | bk_cloud_id | int | BK-Net ID | | ip | string | IP Address | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/set_base_report.md b/paas2/esb/components/confapis/jobv3/apidocs/en/set_base_report.md deleted file mode 100644 index c65f841ee..000000000 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/set_base_report.md +++ /dev/null @@ -1,87 +0,0 @@ -### Function Description - -Turn on/off Agent basic data collection and reporting function - -### Request Parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Fields | Type | Required | Description | -|-------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | -| sys_id | int | yes |Report system information to dataId, if it is " 1," then close reporting| -| cpu_id | int | yes |cpu information is reported to dataId. If it is " 1," the report is closed.| -| mem_id | int | yes |mem information is reported to dataId. If it is "submit 1," the report will be closed.| -| net_id | int | yes |Report the network card information to dataId, and if it is " 1," close the report.| -| disk_id | int | yes |Report disk IO information to dataId, if it is " 1," then close reporting| -| proc_id | int | yes |Report the process information to dataId, and if it is "progress 1," close the report.| -| crontab_id | int | yes |Crontab reports dataId, and if it is "submit 1," the report will be closed| -| iptables_id | int | yes |Iptables information is reported to dataId, and if it is reported to be 1, reporting is closed.| -| ip_list | array | yes | IP object array, see ip_list structure definition below| - -#### ip_list - -| Fields | Type | Required | Description | -|-----------|------------|--------|------------| -| bk_cloud_id | int | yes | BK-Net ID | -| ip | string | yes | IP Address | - -### Example of request - -```json -{ - "bk_app_code": "esb_test", - "bk_app_secret": "xxx", - "bk_token": "xxx", - "bk_scope_type": "biz", - "bk_scope_id": "1", - "sys_id": -1, - "cpu_id": -1, - "mem_id": -1, - "net_id": -1, - "disk_id": -1, - "proc_id": -1, - "crontab_id": -1, - "iptables_id": -1, - "ip_list": [ - { - "bk_cloud_id": 0, - "ip": "10.0.0.1" - } - ] -} -``` - -### Example of responses - -```json -{ - "result": true, - "code": 0, - "message": "", - "data": { - "bk_gse_taskid": "GSETASK:20170621165117:10000" - } -} -``` - -### Response Description - -#### response -| Fields | Type | Description | -|-----------|-----------|-----------| -| result | bool | Whether the request was successful or not. True: request succeeded;False: request failed| -| code | int | Error code. 0 indicates success, >0 indicates failure| -| message | string |Error message| -| data | object |Data returned by request| -| permission | object |Permission information| -| request_id | string |Request chain id| - -#### data - -| Fields | Type | Description | -|-----------|-----------|-----------| -| bk_gse_taskid | string | GSE task ID| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/update_credential.md b/paas2/esb/components/confapis/jobv3/apidocs/en/update_credential.md index 49787fbe4..15957ceb0 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/update_credential.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/update_credential.md @@ -10,8 +10,8 @@ Update credentials. | Fields | Type | Required | Description | |----------------------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | id | string | yes |Credential ID | | name | string | no | Credential name | | type | string | no | Credential type, which can be ACCESS_KEY_SECRET_KEY,PASSWORD,USERNAME_PASSWORD,SECRET_KEY| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/update_cron_status.md b/paas2/esb/components/confapis/jobv3/apidocs/en/update_cron_status.md index b33b42763..9016a2595 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/update_cron_status.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/update_cron_status.md @@ -10,8 +10,8 @@ Update Cron job status, such as started or paused | Fields | Type | Required | Description | |----------- |------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | id | long | yes |Cron job ID| | status | int | yes |State, 1. Start, 2. Paused| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/update_dangerous_rule.md b/paas2/esb/components/confapis/jobv3/apidocs/en/update_dangerous_rule.md new file mode 100644 index 000000000..19ff32aec --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/update_dangerous_rule.md @@ -0,0 +1,81 @@ +### Function Description + +update dangerous rule + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| -------------------- | ------ | -------- | ------------------------------------------------------------ | +| id | long | yes | Rule id | +| expression | string | yes | Expression | +| script_language_list | array | yes | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | yes | Rule description | +| action | int | yes | Processing actions: 1- Scan, 2- Intercept | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "id": 1, + "expression": "rm", + "script_language_list": [1], + "description": "drangerous!!!", + "action": 2 +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1, + "expression": "rm", + "script_language_list": [1], + "description": "drangerous!!!", + "action": 2, + "status": 0, + "creator": "admin", + "create_time": 1695193968000, + "last_modify_user": "admin", + "last_modify_time": 1695302417000 + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| -------------------- | ------ | ------------------------------------------------------------ | +| id | long | Rule id | +| expression | string | expression | +| script_language_list | array | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | Description | +| action | int | Processing actions: 1- Scan, 2- Intercept | +| status | int | Enabling status: 0- disabled, 1- enabled | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/update_file_source.md b/paas2/esb/components/confapis/jobv3/apidocs/en/update_file_source.md index 1c5bb14ef..f82ff26c3 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/en/update_file_source.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/update_file_source.md @@ -10,8 +10,8 @@ Update the file source. | Fields | Type | Required | Description | |-----------------|------------|--------|------------| -| bk_scope_type | string | yes | Resource range type. Optional values: biz - Business,biz_set - Business Set | -| bk_scope_id | string | yes | Resource range ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | | id | int | no | File source ID, at least one of which is required with code, and id preferred | | code | string | no | At least one of the document source identification and id is required, and id preferred. It must start with English characters and consist of 1 32 English characters, underscores or numbers. It can not be changed after creation| | alias | string | no | File source alias| diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/update_public_script_basic.md b/paas2/esb/components/confapis/jobv3/apidocs/en/update_public_script_basic.md new file mode 100644 index 000000000..529595516 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/update_public_script_basic.md @@ -0,0 +1,73 @@ +### Function Description + +Update basic information of public scripts + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------- | ------ | -------- | ------------------ | +| script_id | string | yes | Script id | +| name | string | yes | Script name | +| description | string | no | Script description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "description": "public script test" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691740230000, + "description": "public script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ---------------- | ------ | ------------------------------------------------------------ | +| id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/update_public_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/en/update_public_script_version.md new file mode 100644 index 000000000..5a623e6e7 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/update_public_script_version.md @@ -0,0 +1,85 @@ +### Function Description + +Update public script version + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ----------------------------------------- | +| script_id | string | yes | Script id | +| script_version_id | long | yes | Script version id | +| content | string | yes | Script content, requiring Base64 encoding | +| version_desc | string | no | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000020, + "content": "IyEvYmluL2Jhc2gKbHM=", + "version_desc": "version 2" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000020, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "content": "#!/bin/bash\nls", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691740290000, + "version": "1.0", + "version_desc": "version 2", + "status": 0, + "description": "public script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/update_script_basic .md b/paas2/esb/components/confapis/jobv3/apidocs/en/update_script_basic .md new file mode 100644 index 000000000..0a07ef2b4 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/update_script_basic .md @@ -0,0 +1,80 @@ +### Function Description + +Update script basic information + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| name | string | yes | Script name | +| description | string | no | Script description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "creator": "admin", + "create_time": 1691743535000, + "last_modify_user": "admin", + "last_modify_time": 1691743715000, + "description": "script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ---------------- | ------ | ------------------------------------------------------------ | +| id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| bk_scope_type | string | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/en/update_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/en/update_script_version.md new file mode 100644 index 000000000..eb93e59b3 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/en/update_script_version.md @@ -0,0 +1,93 @@ +### Function Description + +Update Script Version Information + +### Request Parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Fields | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------------------------------------------ | +| bk_scope_type | string | yes | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | yes | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| script_id | string | yes | Script id | +| script_version_id | long | yes | Script version id | +| content | string | yes | Script content, requiring Base64 encoding | +| version_desc | string | no | Version Description | + + +### Example of request + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019, + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version_desc": "version 1.0" +} +``` + +### Example of responses + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "#!/bin/bash\ndate\n", + "creator": "admin", + "create_time": 1691741073000, + "last_modify_user": "admin", + "last_modify_time": 1691741313000, + "version": "1.0", + "version_desc": "version 1.0", + "status": 0, + "description": "script test" + } +} +``` + +### Response Description + +#### response + +| Fields | Type | Description | +| ---------- | ------ | ------------------------------------------------------------ | +| result | bool | Whether the request succeeded or not. True: request succeeded;False: request failed | +| code | int | Error code. 0 indicates success, >0 indicates failure | +| message | string | Error message | +| data | object | Data returned by request | +| permission | object | Permission information | + +#### data + +| Fields | Type | Description | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | Script version id | +| script_id | string | Script id | +| name | string | Script name | +| script_language | int | Script language:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| bk_scope_type | string | Resource scope type. Optional values: biz - Business,biz_set - Business Set | +| bk_scope_id | string | Resource scope ID. Corresponds to bk_scope_type, which means business ID or business set ID | +| content | string | Script content | +| creator | string | Creator | +| create_time | long | Created time, Unix timestamp | +| last_modify_user | string | Last modify user | +| last_modify_time | long | Last modified time, Unix timestamp | +| version | string | Script version | +| version_desc | string | Version description | +| status | int | Script version status (0: Not online, 1: Online, 2: Offline, 3: Disabled) | +| description | string | Description | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/batch_get_job_instance_ip_log.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/batch_get_job_instance_ip_log.md index 79e8e1fea..fcef5cc8b 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/batch_get_job_instance_ip_log.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/batch_get_job_instance_ip_log.md @@ -1,6 +1,6 @@ ### 功能描述 -根据ip列表批量查询作业执行日志 +根据主机列表批量查询作业执行日志 ### 请求参数 @@ -44,6 +44,34 @@ ### 返回结果示例 +#### 脚本执行步骤 +```json +{ + "result": true, + "code": 0, + "message": "", + "data": { + "log_type": 1, + "job_instance_id": 100, + "step_instance_id": 200, + "script_task_logs": [ + { + "bk_host_id": 101, + "ip": "10.0.0.1", + "bk_cloud_id": 0, + "log_content": "[2018-03-15 14:39:30][PID:56875] job_start\n" + }, + { + "bk_host_id": 102, + "ip": "10.0.0.2", + "bk_cloud_id": 0, + "log_content": "[2018-03-15 14:39:30][PID:16789] job_start\n" + } + ] + } +} +``` + #### 文件分发步骤 ```json { @@ -52,7 +80,7 @@ "message": "", "data": { "log_type": 2, - "task_instance_id": 100, + "job_instance_id": 100, "step_instance_id": 200, "file_task_logs": [ { @@ -61,36 +89,37 @@ "bk_cloud_id": 0, "file_logs": [ { - "mode": 1, + "mode": 1, "src_ip": { "bk_host_id": 102, - "bk_cloud_id": 0, + "bk_cloud_id": 0, "ip": "10.0.0.2" - }, - "src_path": "/data/1.log", + }, + "src_path": "/data/1.log", "dest_ip": { "bk_host_id": 101, - "bk_cloud_id": 0, + "bk_cloud_id": 0, "ip": "10.0.0.1" - }, - "dest_path": "/tmp/1.log", + }, + "dest_path": "/tmp/1.log", "status": 4, - "log_content": "[2021-06-28 11:32:16] FileName: /tmp/1.log FileSize: 9.0 Bytes State: dest agent success download file Speed: 1 KB/s Progress: 100% StatusDesc: dest agent success download file Detail: success" + "log_content": "[2021-06-28 11:32:16] FileName: /tmp/1.log FileSize: 9.0 Bytes State: dest agent success download file Speed: 1 KB/s Progress: 100% StatusDesc: dest agent success download file Detail: success" } ] }, { + "bk_host_id": 102, "ip": "10.0.0.2", "bk_cloud_id": 0, "file_logs": [ { - "mode": 0, + "mode": 0, "src_ip": { "bk_host_id": 102, - "bk_cloud_id": 0, + "bk_cloud_id": 0, "ip": "10.0.0.2" - }, - "src_path": "/data/1.log", + }, + "src_path": "/data/1.log", "status": 4, "log_content": "[2021-06-28 11:32:16] FileName: /data/1.log FileSize: 9.0 Bytes State: source agent success upload file Speed: 1 KB/s Progress: 100% StatusDesc: source agent success upload file Detail: success upload" } @@ -103,7 +132,7 @@ **文件任务返回结果说明** -- 如果需要返回文件源的上传日志,需要在ip_list添加源文件服务器IP +- 如果需要返回文件源的上传日志,需要在 host_id_list/ip_list添加源文件主机信息 ### 返回结果说明 diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/check_script.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/check_script.md new file mode 100644 index 000000000..c90dd557b --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/check_script.md @@ -0,0 +1,74 @@ +### 功能描述 + +高危脚本检测。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------------- | ------ | ---- | ------------------------------------------------------------ | +| script_language | int | 是 | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | 是 | 脚本内容,需Base64编码 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_language": 1, + "content": "cm0gLXJmIC8=" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": [ + { + "line": 1, + "line_content": "rm /tmp", + "match_content": "rm /tmp", + "level": 1, + "description": "The first line of the script does not define a valid script type, for example: #!/bin/bash" + }, + { + "line": 1, + "line_content": "rm /tmp", + "match_content": "rm", + "level": 3, + "description": "dangerous!!!" + } + ] +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ------------- | ------ | -------------------------------------- | +| line | int | 错误所在行数 | +| line_content | string | 脚本所在行的内容 | +| match_content | string | 匹配的内容 | +| level | int | 错误级别:1 - 警告,2 - 错误,3 - 致命 | +| description | string | 检查项描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_account.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_account.md new file mode 100644 index 000000000..c0858a012 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_account.md @@ -0,0 +1,94 @@ +### 功能描述 + +创建账号(当前仅支持系统账号) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|---------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID,与bk_scope_type对应,表示业务ID或者业务集ID | +| account | string | 是 | 账号名称 | +| type | int | 是 | 账号类型(1:Linux,2:Windows)| +| category | int | 是 | 账号用途(1:系统账号)| +| password | string | 否 | 系统账号密码,账号用途为系统账号且账号类型为Windows时必传 | +| alias | string | 否 | 别名,不传则以账号名称作为别名 | +| description | string | 否 | 描述 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "account": "Admin", + "type": 2, + "category": 1, + "password": "AdminPassword", + "alias": "Admin", + "description": "An account for windows" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "message": null, + "result": true, + "data": { + "id": 70, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "account": "Admin", + "alias": "Admin", + "category": 1, + "type": 2, + "os": "Windows", + "description": "An account for windows", + "creator": "admin", + "create_time": 1614659536108, + "last_modify_user": "admin", + "last_modify_time": 1614659536116 + }, + "job_request_id": "4e7acb216087eb96" +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|--------------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 | 描述 | +|-----------------------|-----------|-----------| +| id | long | 账号ID | +| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| account | string | 账号名称 | +| alias | string | 账号别名 | +| category | int | 账号用途(1:系统账号) | +| type | int | 账号类型(1:Linux,2:Windows)| +| os | string | 账号用途为系统账号时该字段生效,账号对应的OS | +| description | string | 账号描述 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_dangerous_rule.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_dangerous_rule.md new file mode 100644 index 000000000..6f482388a --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_dangerous_rule.md @@ -0,0 +1,79 @@ +### 功能描述 + +新建高危语句检测规则。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| -------------------- | ------ | ---- | ------------------------------------------------------------ | +| expression | string | 是 | 表达式 | +| script_language_list | array | 是 | 脚本语言列表:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | 是 | 规则描述 | +| action | int | 是 | 处理动作: 1 - 扫描, 2 - 拦截 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "expression": "rm -rf", + "script_language_list": [1], + "description": "drangerous!!!", + "action": 2 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1, + "expression": "rm -rf", + "script_language_list": [1], + "description": "drangerous!!!", + "action": 2, + "status": 0, + "creator": "admin", + "create_time": 1695193968000, + "last_modify_user": "admin", + "last_modify_time": 1695193968000 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| -------------------- | ------ | ------------------------------------------------------------ | +| id | long | 高危语句规则ID | +| expression | string | 表达式 | +| script_language_list | array | 脚本语言列表:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | 规则描述 | +| action | int | 处理动作: 1 - 扫描, 2 - 拦截 | +| status | int | 启用状态: 0 - 停用, 1 - 启用 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_public_script.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_public_script.md new file mode 100644 index 000000000..3a0b99d0c --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_public_script.md @@ -0,0 +1,87 @@ +### 功能描述 + +新建公共脚本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------------- | ------ | ---- | ------------------------------------------------------------ | +| name | string | 是 | 公共脚本名称 | +| description | string | 否 | 公共脚本描述 | +| script_language | int | 是 | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | 是 | 脚本内容,需Base64编码 | +| version | string | 是 | 版本号 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "name": "public script test", + "description": "public script test", + "script_language": "1", + "content": "IyEvYmluL2Jhc2gKbHM=", + "version": "1.0" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000018, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "content": "#!/bin/bash\nls", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691739630000, + "version": "1.0", + "status": 0, + "description": "public script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | 公共脚本版本ID | +| script_id | string | 公共脚本ID | +| name | string | 公共脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | 公共脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 公共脚本版本 | +| version_desc | string | 公共脚本版本描述 | +| status | int | 公共脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 公共脚本描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_public_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_public_script_version.md new file mode 100644 index 000000000..067a72f07 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_public_script_version.md @@ -0,0 +1,85 @@ +### 功能描述 + +新建公共脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ------------ | ------ | ---- | ---------------------- | +| script_id | string | 是 | 公共脚本ID | +| content | string | 是 | 脚本内容,需Base64编码 | +| version | string | 是 | 版本号 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "content": "IyEvYmluL2Jhc2gKbHM=", + "version": "2.0", + "version_desc": "version 2" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000020, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "content": "#!/bin/bash\nls", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691739630000, + "version": "1.0", + "version_desc": "version 2", + "status": 0, + "description": "public script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | 公共脚本版本ID | +| script_id | string | 公共脚本ID | +| name | string | 公共脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | 公共脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 公共脚本版本 | +| version_desc | string | 公共脚本版本描述 | +| status | int | 公共脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 公共脚本描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_script.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_script.md new file mode 100644 index 000000000..ad9cee9b1 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_script.md @@ -0,0 +1,96 @@ +### 功能描述 + +新建脚本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------------- | ------ | ---- | ------------------------------------------------------------ | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| name | string | 是 | 脚本名称 | +| description | string | 否 | 脚本描述 | +| script_language | int | 是 | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | 是 | 脚本内容,需Base64编码 | +| version | string | 是 | 版本号 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "name": "script test", + "description": "script test", + "script_language": "1", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version": "1.0" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "#!/bin/bash\ndate\n", + "creator": "admin", + "create_time": 1691741073000, + "last_modify_user": "admin", + "last_modify_time": 1691741073000, + "version": "1.0", + "status": 0, + "description": "script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | 脚本版本ID | +| script_id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell | +| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| content | string | 脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 脚本版本 | +| version_desc | string | 版本描述 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 脚本描述 | + diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_script_version.md new file mode 100644 index 000000000..695861cd8 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/create_script_version.md @@ -0,0 +1,93 @@ +### 功能描述 + +新建脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| content | string | 是 | 脚本内容,需Base64编码 | +| version | string | 是 | 版本号 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version": "2.0", + "version_desc": "version 2" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000021, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "#!/bin/bash\ndate\n", + "creator": "admin", + "create_time": 1691743535000, + "last_modify_user": "admin", + "last_modify_time": 1691743535000, + "version": "2.0", + "version_desc": "version 2", + "status": 0, + "description": "script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | 脚本版本ID | +| script_id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| content | string | 脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 脚本版本 | +| version_desc | string | 版本描述 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 脚本描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_account.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_account.md new file mode 100644 index 000000000..6db8d984e --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_account.md @@ -0,0 +1,86 @@ +### 功能描述 + +删除账号。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|---------------|------------|--------|------------| +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| id | long | 否 | 账号ID | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "1", + "id": 70 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "message": null, + "result": true, + "data": { + "id": 70, + "bk_scope_type": "biz", + "bk_scope_id": "1", + "account": "Admin", + "alias": "Admin", + "category": 1, + "type": 2, + "db_system_account_id": null, + "os": "Windows", + "description": "An account for windows", + "creator": "admin", + "create_time": 1614659536108, + "last_modify_user": "admin", + "last_modify_time": 1614659536116 + }, + "job_request_id": "4e7acb216087eb96" +} +``` + +### 返回结果参数说明 + +#### response +| 字段 | 类型 | 描述 | +|--------------|-----------|-----------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息| +| data | object | 请求返回的数据| +| permission | object | 权限信息| + + +#### data + +| 字段 | 类型 | 描述 | +|-----------------------|-----------|-----------| +| id | long | 账号ID | +| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| account | string | 账号名称 | +| alias | string | 账号别名 | +| category | int | 账号用途(1:系统账号,2:数据库账号) | +| type | int | 账号类型(1:Linux,2:Windows,9:MySQL,10:Oracle,11:DB2)| +| db_system_account_id | long | 账号用途为数据库账号时该字段生效,表示数据库账号对应的系统账号ID | +| os | string | 账号用途为系统账号时该字段生效,账号对应的OS | +| description | string | 描述 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_dangerous_rule.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_dangerous_rule.md new file mode 100644 index 000000000..e4696f455 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_dangerous_rule.md @@ -0,0 +1,50 @@ +### 功能描述 + +删除高危语句检测规则。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ---- | ---- | -------------- | +| id | long | 是 | 高危语句规则ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "id": 1 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +无 diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_public_script.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_public_script.md new file mode 100644 index 000000000..92528e1d2 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_public_script.md @@ -0,0 +1,50 @@ +### 功能描述 + +删除公共脚本,同时会删除该脚本下的所有的脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ------ | ---- | ---------- | +| script_id | string | 是 | 公共脚本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +无 diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_public_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_public_script_version.md new file mode 100644 index 000000000..14eae102f --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_public_script_version.md @@ -0,0 +1,52 @@ +### 功能描述 + +删除公共脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | -------------- | +| script_id | string | 是 | 公共脚本ID | +| script_version_id | long | 是 | 公共脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": "1000017" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +无 diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_script.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_script.md new file mode 100644 index 000000000..baf012206 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_script.md @@ -0,0 +1,54 @@ +### 功能描述 + +删除脚本,同时会删除该脚本下的所有的脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | long | 是 | 脚本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +无 diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_script_version.md new file mode 100644 index 000000000..d2cfdc496 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/delete_script_version.md @@ -0,0 +1,56 @@ +### 功能描述 + +删除脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| script_version_id | long | 是 | 脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +无 diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_dangerous_rule.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_dangerous_rule.md new file mode 100644 index 000000000..1d8e788be --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_dangerous_rule.md @@ -0,0 +1,57 @@ +### 功能描述 + +停用高危语句检测规则。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ---- | ---- | -------------- | +| id | long | 是 | 高危语句规则ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "id": 1 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1, + "status": 0 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ------ | ---- | ---------------------------- | +| id | long | 高危语句规则ID | +| status | int | 启用状态: 0 - 停用, 1 - 启用 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_public_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_public_script_version.md new file mode 100644 index 000000000..9015340d8 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_public_script_version.md @@ -0,0 +1,61 @@ +### 功能描述 + +禁用公共脚本版本,一旦禁用成功,不可恢复!且线上引用该版本的作业步骤都会无法执行,请务必谨慎操作。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | -------------- | +| script_id | string | 是 | 公共脚本ID | +| script_version_id | long | 是 | 公共脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000018 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000018, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "status": 3 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_id | string | 脚本ID | +| id | long | 脚本版本ID | +| status | int | 脚本版本当前状态(0:未上线,1:已上线,2:已下线,3:已禁用) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_script_version.md new file mode 100644 index 000000000..ab649bfe2 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/disable_script_version.md @@ -0,0 +1,65 @@ +### 功能描述 + +禁用脚本版本,一旦禁用成功,不可恢复!且线上引用该版本的作业步骤都会无法执行,请务必谨慎操作。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| script_version_id | long | 是 | 脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "status": 3 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_id | string | 脚本版本ID | +| id | long | 脚本版本ID | +| status | int | 脚本版本当前状态(0:未上线,1:已上线,2:已下线,3:已禁用) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/enable_dangerous_rule.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/enable_dangerous_rule.md new file mode 100644 index 000000000..b552aa83b --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/enable_dangerous_rule.md @@ -0,0 +1,57 @@ +### 功能描述 + +启用高危语句检测规则。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ---- | ---- | ---- | -------------- | +| id | long | 是 | 高危语句规则ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "id": 1 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1, + "status": 1 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ------ | ---- | ---------------------------- | +| id | long | 高危语句规则ID | +| status | int | 启用状态: 0 - 停用, 1 - 启用 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_account_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_account_list.md index 99909205a..ce68e9a5a 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_account_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_account_list.md @@ -13,6 +13,8 @@ | bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | | category | int | 否 | 账号用途(1:系统账号,2:DB账号),不传则不区分 | +| account | string | 否 | 账号名称 | +| alias | string | 否 | 账号别名 | | start | int | 否 | 分页记录起始位置,不传默认为0 | | length | int | 否 | 单次返回最大记录数,最大1000,不传默认为20 | @@ -26,6 +28,8 @@ "bk_scope_type": "biz", "bk_scope_id": "1", "category": 1, + "account": "aaa", + "alias": "aaa", "start": 0, "length": 1 } diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_dangerous_rule_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_dangerous_rule_list.md new file mode 100644 index 000000000..c5b0042db --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_dangerous_rule_list.md @@ -0,0 +1,79 @@ +### 功能描述 + +查看高危语句检测规则列表。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| -------------------- | ------ | ---- | ------------------------------------------------------------ | +| expression | string | 否 | 表达式 | +| script_language_list | array | 否 | 脚本语言列表:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | 否 | 规则描述 | +| action | int | 否 | 处理动作: 1 - 扫描, 2 - 拦截 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_language_list": [1], + "action": 2 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": [ + { + "id": 1, + "expression": "rm", + "script_language_list": [1], + "description": "drangerous!!!", + "action": 2, + "status": 0, + "creator": "admin", + "create_time": 1695193968000, + "last_modify_user": "admin", + "last_modify_time": 1695302417000 + } + ] +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| -------------------- | ------ | ------------------------------------------------------------ | +| id | long | 高危语句规则ID | +| expression | string | 表达式 | +| script_language_list | array | 脚本语言列表:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | 规则描述 | +| action | int | 处理动作: 1 - 扫描, 2 - 拦截 | +| status | int | 启用状态: 0 - 停用, 1 - 启用 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_ip_log.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_ip_log.md index ac4a91027..f24d3cb8e 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_ip_log.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_job_instance_ip_log.md @@ -1,6 +1,6 @@ ### 功能描述 -根据ip查询作业执行日志 +根据主机查询作业执行日志 ### 请求参数 diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_list.md index 07bc0781c..09210ad31 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_list.md @@ -42,7 +42,6 @@ "id": "000dbdddc06c453baf1f2decddf00c69", "name": "a.sh", "script_language": 1, - "public": false, "online_script_version_id": 100, "creator": "admin", "create_time": 1600746078520, diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_detail.md index 3d7ff5543..45aa36c1f 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_detail.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_detail.md @@ -42,7 +42,9 @@ "creator": "admin", "create_time": 1600746078520, "last_modify_user": "admin", - "last_modify_time": 1600746078520 + "last_modify_time": 1600746078520, + "script_language": 1, + "description": "脚本描述" } } ``` @@ -73,3 +75,5 @@ | create_time | long | 创建时间Unix时间戳(ms) | | last_modify_user | string | 最近一次修改人 | | last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell | +| description | string | 脚本描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_list.md index d94e992c0..680fe3be9 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_public_script_version_list.md @@ -48,7 +48,9 @@ "creator": "admin", "create_time": 1600746078520, "last_modify_user": "admin", - "last_modify_time": 1600746078520 + "last_modify_time": 1600746078520, + "script_language": 1, + "description": "脚本描述" } ], "start": 0, @@ -84,3 +86,5 @@ | create_time | long | 创建时间Unix时间戳(ms) | | last_modify_user | string | 最近一次修改人 | | last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell | +| description | string | 脚本描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_detail.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_detail.md index ca831aba6..daf942880 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_detail.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_detail.md @@ -48,7 +48,9 @@ "creator": "admin", "create_time": 1600746078520, "last_modify_user": "admin", - "last_modify_time": 1600746078520 + "last_modify_time": 1600746078520, + "script_language": 1, + "description": "脚本描述" } } ``` @@ -81,3 +83,5 @@ | create_time | long | 创建时间Unix时间戳(ms) | | last_modify_user | string | 最近一次修改人 | | last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell | +| description | string | 脚本描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_list.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_list.md index 01f07044a..7b8f00ce0 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_list.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/get_script_version_list.md @@ -54,7 +54,9 @@ "creator": "admin", "create_time": 1600746078520, "last_modify_user": "admin", - "last_modify_time": 1600746078520 + "last_modify_time": 1600746078520, + "script_language": 1, + "description": "脚本描述" } ], "start": 0, @@ -92,3 +94,5 @@ | create_time | long | 创建时间Unix时间戳(ms) | | last_modify_user | string | 最近一次修改人 | | last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell | +| description | string | 脚本描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/publish_public_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/publish_public_script_version.md new file mode 100644 index 000000000..363aa1a43 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/publish_public_script_version.md @@ -0,0 +1,61 @@ +### 功能描述 + +上线公共脚本版本,上线后,之前的线上脚本将被置为已下线状态,但不影响作业使用。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | -------------- | +| script_id | string | 是 | 公共脚本ID | +| script_version_id | long | 是 | 公共脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id":"4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000018 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000018, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "status": 2 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_id | string | 脚本ID | +| id | long | 脚本版本ID | +| status | int | 脚本版本当前状态(0:未上线,1:已上线,2:已下线,3:已禁用) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/publish_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/publish_script_version.md new file mode 100644 index 000000000..5a274793b --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/publish_script_version.md @@ -0,0 +1,65 @@ +### 功能描述 + +上线脚本版本,上线后,之前的线上脚本将被置为已下线状态,但不影响作业使用。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| script_version_id | long | 是 | 脚本版本ID | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "status": 1 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| script_id | string | 脚本ID | +| id | long | 脚本版本ID | +| status | int | 脚本版本当前状态(0:未上线,1:已上线,2:已下线,3:已禁用) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_dangerous_rule.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_dangerous_rule.md new file mode 100644 index 000000000..2e14a831c --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_dangerous_rule.md @@ -0,0 +1,81 @@ +### 功能描述 + +修改高危语句检测规则。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| -------------------- | ------ | ---- | ------------------------------------------------------------ | +| id | long | 是 | 高危语句规则ID | +| expression | string | 是 | 表达式 | +| script_language_list | array | 是 | 脚本语言列表:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | 是 | 规则描述 | +| action | int | 是 | 处理动作: 1 - 扫描, 2 - 拦截 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "id": 1, + "expression": "rm", + "script_language_list": [1], + "description": "drangerous!!!", + "action": 2 +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1, + "expression": "rm", + "script_language_list": [1], + "description": "drangerous!!!", + "action": 2, + "status": 0, + "creator": "admin", + "create_time": 1695193968000, + "last_modify_user": "admin", + "last_modify_time": 1695302417000 + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| -------------------- | ------ | ------------------------------------------------------------ | +| id | long | 高危语句规则ID | +| expression | string | 表达式 | +| script_language_list | array | 脚本语言列表:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| description | string | 规则描述 | +| action | int | 处理动作: 1 - 扫描, 2 - 拦截 | +| status | int | 启用状态: 0 - 停用, 1 - 启用 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_file_source.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_file_source.md index 68bd21945..e65e5ee99 100644 --- a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_file_source.md +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_file_source.md @@ -12,8 +12,7 @@ |-----------------|------------|--------|------------| | bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | | bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | -| id | int | 否 | 文件源ID,与code二者至少填一个,同时填写以id为准 | -| code | string | 否 | 文件源标识,与id二者至少填一个,同时填写以id为准,英文字符开头,1-32位英文字符、下划线、数字组成,创建后不可更改 | +| code | string | 是 | 文件源标识,英文字符开头,1-32位英文字符、下划线、数字组成 | | alias | string | 否 | 文件源别名 | | type | string | 否 | 文件源类型,当前仅支持蓝鲸制品库,BLUEKING_ARTIFACTORY | | access_params | object | 否 | 文件源接入参数,根据type传入不同的对象,见后续说明 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_public_script_basic.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_public_script_basic.md new file mode 100644 index 000000000..db6c41a42 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_public_script_basic.md @@ -0,0 +1,73 @@ +### 功能描述 + +更新公共脚本基础信息。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------- | ------ | ---- | ------------ | +| script_id | string | 是 | 公共脚本ID | +| name | string | 是 | 公共脚本名称 | +| description | string | 否 | 公共脚本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "description": "public script test" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691740230000, + "description": "public script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ---------------- | ------ | ------------------------------------------------------------ | +| id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| description | string | 脚本描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_public_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_public_script_version.md new file mode 100644 index 000000000..322538cd0 --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_public_script_version.md @@ -0,0 +1,85 @@ +### 功能描述 + +修改公共脚本版本。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ---------------------- | +| script_id | string | 是 | 公共脚本ID | +| script_version_id | long | 是 | 公共脚本版本ID | +| content | string | 是 | 脚本内容,需Base64编码 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "script_version_id": 1000020, + "content": "IyEvYmluL2Jhc2gKbHM=", + "version_desc": "version 2" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000020, + "script_id": "4537fb49ec0840a1b91cef4179c99f9c", + "name": "public script test", + "script_language": 1, + "content": "#!/bin/bash\nls", + "creator": "admin", + "create_time": 1691739630000, + "last_modify_user": "admin", + "last_modify_time": 1691740290000, + "version": "1.0", + "version_desc": "version 2", + "status": 0, + "description": "public script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | 公共脚本版本ID | +| script_id | string | 公共脚本ID | +| name | string | 公共脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| content | string | 公共脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 公共脚本版本 | +| version_desc | string | 公共脚本版本描述 | +| status | int | 公共脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 公共脚本描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_script_basic .md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_script_basic .md new file mode 100644 index 000000000..39c51d4dc --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_script_basic .md @@ -0,0 +1,80 @@ +### 功能描述 + +更新脚本基础信息。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| name | string | 是 | 脚本名称 | +| description | string | 否 | 脚本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type": "biz", + "bk_scope_id": "2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "creator": "admin", + "create_time": 1691743535000, + "last_modify_user": "admin", + "last_modify_time": 1691743715000, + "description": "script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ---------------- | ------ | ------------------------------------------------------------ | +| id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| description | string | 脚本描述 | diff --git a/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_script_version.md b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_script_version.md new file mode 100644 index 000000000..57076f88c --- /dev/null +++ b/paas2/esb/components/confapis/jobv3/apidocs/zh_hans/update_script_version.md @@ -0,0 +1,93 @@ +### 功能描述 + +修改脚本版本信息。 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ----------------- | ------ | ---- | ------------------------------------------------------- | +| bk_scope_type | string | 是 | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 是 | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| script_id | string | 是 | 脚本ID | +| script_version_id | long | 是 | 脚本版本ID | +| content | string | 是 | 脚本内容,需Base64编码 | +| version_desc | string | 否 | 版本描述 | + + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_token": "xxx", + "bk_scope_type":"biz", + "bk_scope_id":"2", + "script_id": "4a350b0e0707450e93326f6ace921072", + "script_version_id": 1000019, + "content": "IyEvYmluL2Jhc2gKZGF0ZQo=", + "version_desc": "version 1.0" +} +``` + +### 返回结果示例 + +```json +{ + "code": 0, + "result": true, + "data": { + "id": 1000019, + "script_id": "4a350b0e0707450e93326f6ace921072", + "name": "script test", + "script_language": 1, + "bk_scope_type": "biz", + "bk_scope_id": "2", + "content": "#!/bin/bash\ndate\n", + "creator": "admin", + "create_time": 1691741073000, + "last_modify_user": "admin", + "last_modify_time": 1691741313000, + "version": "1.0", + "version_desc": "version 1.0", + "status": 0, + "description": "script test" + } +} +``` + +### 返回结果参数说明 + +#### response + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------------------------------------ | +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| data | object | 请求返回的数据 | +| permission | object | 权限信息 | + +#### data + +| 字段 | 类型 | 描述 | +| ----------------- | ------ | ------------------------------------------------------------ | +| id | long | 脚本版本ID | +| script_id | string | 脚本ID | +| name | string | 脚本名称 | +| script_language | int | 脚本语言:1 - shell, 2 - bat, 3 - perl, 4 - python, 5 - powershell, 6 - sql | +| bk_scope_type | string | 资源范围类型。可选值: biz - 业务,biz_set - 业务集 | +| bk_scope_id | string | 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID | +| content | string | 脚本版本内容 | +| creator | string | 创建人 | +| create_time | long | 创建时间Unix时间戳(ms) | +| last_modify_user | string | 最近一次修改人 | +| last_modify_time | long | 最近一次修改时间Unix时间戳(ms) | +| version | string | 脚本版本 | +| version_desc | string | 版本描述 | +| status | int | 脚本版本状态(0:未上线,1:已上线,2:已下线,3:已禁用) | +| description | string | 脚本描述 | diff --git a/paas2/esb/components/confapis/jobv3/job.yaml b/paas2/esb/components/confapis/jobv3/job.yaml index 23426de70..552a4e185 100644 --- a/paas2/esb/components/confapis/jobv3/job.yaml +++ b/paas2/esb/components/confapis/jobv3/job.yaml @@ -1,5 +1,3 @@ ---- -# Job Execute API - path: /v2/jobv3/execute_job_plan/ name: execute_job_plan label: 执行作业执行方案 @@ -9,7 +7,7 @@ comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-execute/execute_job_plan/ dest_http_method: POST - + - path: /v2/jobv3/fast_execute_script/ name: fast_execute_script label: 快速执行脚本 @@ -29,7 +27,7 @@ comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-execute/fast_execute_sql/ dest_http_method: POST - + - path: /v2/jobv3/fast_transfer_file/ name: fast_transfer_file label: 快速分发文件 @@ -39,7 +37,7 @@ comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-execute/fast_transfer_file/ dest_http_method: POST - + - path: /v2/jobv3/push_config_file/ name: push_config_file label: 分发配置文件 @@ -60,7 +58,7 @@ comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-execute/operate_step_instance/ dest_http_method: POST - + - path: /v2/jobv3/operate_job_instance/ name: operate_job_instance label: 作业实例操作 @@ -70,22 +68,22 @@ comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-execute/operate_job_instance/ dest_http_method: POST - + - path: /v2/jobv3/get_job_instance_status/ name: get_job_instance_status label: 根据作业实例 ID 查询作业执行状态 label_en: Get the job execution status based on the job instance ID - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-execute/get_job_instance_status/ dest_http_method: POST - + - path: /v2/jobv3/get_job_instance_ip_log/ name: get_job_instance_ip_log label: 根据作业实例ID查询作业执行日志 label_en: Get job instance ip log - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-execute/get_job_instance_ip_log/ @@ -100,33 +98,32 @@ comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-execute/batch_get_job_instance_ip_log/ dest_http_method: POST - + - path: /v2/jobv3/get_job_instance_list/ name: get_job_instance_list label: 查询作业实例列表(执行历史) label_en: Get job instance list - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-execute/get_job_instance_list/ dest_http_method: POST - + - path: /v2/jobv3/get_job_instance_global_var_value/ name: get_job_instance_global_var_value label: 获取作业实例全局变量值 label_en: Get job instance global variable value - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-execute/get_job_instance_global_var_value/ dest_http_method: POST -# Job management API - path: /v2/jobv3/get_job_template_list/ name: get_job_template_list label: 查询作业模版列表 label_en: Get job template list - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-manage/get_job_template_list/ @@ -136,37 +133,37 @@ name: get_job_plan_list label: 查询执行方案列表 label_en: Get job execution plan list - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-manage/get_job_plan_list/ dest_http_method: POST - + - path: /v2/jobv3/get_job_plan_detail/ name: get_job_plan_detail label: 查询执行方案详情 label_en: Get job execution plan detail - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-manage/get_job_plan_detail/ dest_http_method: POST - + - path: /v2/jobv3/get_account_list/ name: get_account_list label: 查询业务下的执行账号 label_en: Get accounts - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-manage/get_account_list/ dest_http_method: POST - + - path: /v2/jobv3/get_public_script_list/ name: get_public_script_list label: 查询公共脚本列表 label_en: Get public script list - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-manage/get_public_script_list/ @@ -176,7 +173,7 @@ name: get_public_script_version_list label: 查询公共脚本版本列表 label_en: Get public script version list - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-manage/get_public_script_version_list/ @@ -186,7 +183,7 @@ name: get_public_script_version_detail label: 查询公共脚本详情 label_en: Get public script detail - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-manage/get_public_script_version_detail/ @@ -196,7 +193,7 @@ name: get_script_list label: 查询脚本列表 label_en: Get script list - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-manage/get_script_list/ @@ -206,7 +203,7 @@ name: get_script_version_list label: 查询脚本版本列表 label_en: Get script version list - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-manage/get_script_version_list/ @@ -216,33 +213,32 @@ name: get_script_version_detail label: 查询脚本详情 label_en: Get script version detail - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-manage/get_script_version_detail/ dest_http_method: POST -# Job Crontab API - path: /v2/jobv3/get_cron_list/ name: get_cron_list label: 查询业务下定时作业信息 label_en: Get crontab job list - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-crontab/get_cron_list/ dest_http_method: POST - + - path: /v2/jobv3/get_cron_detail/ name: get_cron_detail label: 查询定时作业详情 label_en: Get crontab job detail - suggest_method: GET + suggest_method: POST api_type: query comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-crontab/get_cron_detail/ dest_http_method: POST - + - path: /v2/jobv3/save_cron/ name: save_cron label: 新建或保存定时作业 @@ -252,7 +248,7 @@ comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-crontab/save_cron/ dest_http_method: POST - + - path: /v2/jobv3/update_cron_status/ name: update_cron_status label: 更新定时作业状态,如启动或暂停 @@ -262,7 +258,6 @@ comp_codename: generic.v2.jobv3.job_component dest_path: /api/job/v3/job-crontab/update_cron_status/ dest_http_method: POST - - path: /v2/jobv3/create_credential/ name: create_credential @@ -318,3 +313,253 @@ dest_path: /api/job/v3/job-manage/generate_local_file_upload_url/ dest_http_method: POST is_hidden: True + +- path: /v2/jobv3/create_public_script/ + name: create_public_script + label: 创建公共脚本 + label_en: Save public script + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/create_public_script/ + dest_http_method: POST + +- path: /v2/jobv3/update_public_script_basic/ + name: update_public_script_basic + label: 更新公共脚本基础信息 + label_en: Update public script + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/update_public_script_basic/ + dest_http_method: POST + +- path: /v2/jobv3/delete_public_script_version/ + name: delete_public_script_version + label: 删除公共脚本版本 + label_en: Delete public script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/delete_public_script_version/ + dest_http_method: POST + +- path: /v2/jobv3/create_public_script_version/ + name: create_public_script_version + label: 新建公共脚本版本 + label_en: Save public script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/create_public_script_version/ + dest_http_method: POST + +- path: /v2/jobv3/update_public_script_version/ + name: update_public_script_version + label: 修改公共脚本版本 + label_en: Update public script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/update_public_script_version/ + dest_http_method: POST + +- path: /v2/jobv3/publish_public_script_version/ + name: publish_public_script_version + label: 发布公共脚本版本 + label_en: Publish public script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/publish_public_script_version/ + dest_http_method: POST + +- path: /v2/jobv3/disable_public_script_version/ + name: disable_public_script_version + label: 禁用公共脚本版本 + label_en: Disable public script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/disable_public_script_version/ + dest_http_method: POST + +- path: /v2/jobv3/delete_public_script/ + name: delete_public_script + label: 删除公共脚本 + label_en: Delete public script + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/delete_public_script/ + dest_http_method: POST + +- path: /v2/jobv3/create_script/ + name: create_script + label: 创建脚本 + label_en: Save script + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/create_script/ + dest_http_method: POST + +- path: /v2/jobv3/update_script_basic/ + name: update_script_basic + label: 更新脚本基础信息 + label_en: Update script basic + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/update_script_basic/ + dest_http_method: POST + +- path: /v2/jobv3/delete_script_version/ + name: delete_script_version + label: 删除脚本版本 + label_en: Delete script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/delete_script_version/ + dest_http_method: POST + +- path: /v2/jobv3/create_script_version/ + name: create_script_version + label: 新建脚本版本 + label_en: Save script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/create_script_version/ + dest_http_method: POST + +- path: /v2/jobv3/update_script_version/ + name: update_script_version + label: 修改脚本版本信息 + label_en: Update script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/update_script_version/ + dest_http_method: POST + +- path: /v2/jobv3/publish_script_version/ + name: publish_script_version + label: 发布脚本版本 + label_en: Publish script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/publish_script_version/ + dest_http_method: POST + +- path: /v2/jobv3/disable_script_version/ + name: disable_script_version + label: 禁用脚本版本 + label_en: Disable script version + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/disable_script_version/ + dest_http_method: POST + +- path: /v2/jobv3/delete_script/ + name: delete_script + label: 删除脚本 + label_en: Delete script + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/delete_script/ + dest_http_method: POST + +- path: /v2/jobv3/create_account/ + name: create_account + label: 创建账号 + label_en: Create account + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/create_account/ + dest_http_method: POST + +- path: /v2/jobv3/delete_account/ + name: delete_account + label: 删除账号 + label_en: Delete account + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/delete_account/ + dest_http_method: POST + +- path: /v2/jobv3/create_dangerous_rule/ + name: create_dangerous_rule + label: 创建高危语句规则 + label_en: Create dangerous rule + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/create_dangerous_rule/ + dest_http_method: POST + +- path: /v2/jobv3/update_dangerous_rule/ + name: update_dangerous_rule + label: 修改高危语句规则 + label_en: Update dangerous rule + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/update_dangerous_rule/ + dest_http_method: POST + +- path: /v2/jobv3/delete_dangerous_rule/ + name: delete_dangerous_rule + label: 删除高危语句规则 + label_en: Delete dangerous rule + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/delete_dangerous_rule/ + dest_http_method: POST + +- path: /v2/jobv3/get_dangerous_rule_list/ + name: get_dangerous_rule_list + label: 查看高危语句规则列表 + label_en: Get dangerous rule list + suggest_method: POST + api_type: query + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/get_dangerous_rule_list/ + dest_http_method: POST + +- path: /v2/jobv3/enable_dangerous_rule/ + name: enable_dangerous_rule + label: 启用高危语句规则 + label_en: Enable dangerous rule + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/enable_dangerous_rule/ + dest_http_method: POST + +- path: /v2/jobv3/disable_dangerous_rule/ + name: disable_dangerous_rule + label: 停用高危语句规则 + label_en: Disable dangerous rule + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/disable_dangerous_rule/ + dest_http_method: POST + +- path: /v2/jobv3/check_script/ + name: check_script + label: 高危脚本检测 + label_en: Check script + suggest_method: POST + api_type: operate + comp_codename: generic.v2.jobv3.job_component + dest_path: /api/job/v3/job-manage/check_script/ + dest_http_method: POST diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/add_shield.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/add_shield.md deleted file mode 100644 index c1443730a..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/add_shield.md +++ /dev/null @@ -1,172 +0,0 @@ -### Function Description - -Create shield configuration - -### Request Parameters - -{{ common_args_desc }} - -#### Nterface Parameters - -| Field | Type | Required | Description | -| ---------------- | ------ | ---- | ------------------------------------------------------------ | -| bk_biz_id | int | yes | business id | -| category | string | yes | shield type (scope: "scope", strategy: "strategy", event: "event", alert: "alert") | -| description | string | yes | description | -| begin_time | string | yes | start time | -| end_time | string | yes | end time | -| cycle_config | dict | yes | shield configuration | -| shield_notice | bool | yes | whether to send shield notifications | -| notice_config | dict | no | notification configuration | -| dimension_config | dict | yes | shield dimension | - -#### Shield Configuration (cycle_config) - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | -------------------------------------------------- | -| begin_time | string | no | start time (every day) | -| end_time | string | no | end time (daily) | -|type | int | yes | type of masking period (single: 1, daily: 2, weekly: 3, monthly: 4) | -| day_list | list | No | When the period is a month, the days to be shielded | -| week_list | list | No | Days to be shielded when the period is weeks | - -#### Notification Configuration (notice_config) - -| Field | Type | Required | Description | -| --------------- | ---- | ---- | ------------------------------------------------------------ | -| notice_time | int | yes | N minutes before shield start/end | -| notice_way | list | yes | type of notification, optional values ​​"weixin", "mail", "sms", "voice" | -| notice_receiver | list | Yes | Notifiers, including operation and maintenance personnel, product personnel, testers, developers, active and standby personnel, and backup managers | - -#### Mask Dimension (dimension_config) - -The masking dimension is related to the masking type (category) - -##### "scope" - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | --------------------------------------------- | -| scope_type | string | yes | masking scope, optional values ​​"instance", "ip", "node", "biz" | -| target | list | no | list of instances according to scope type | -| metric_id | list | no | metric id | - -##### "strategy" - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | ---------------------------- | -| id | list | Yes | policy id | -| level | list | No | alarm level | -| scope_type | string | no | mask scope, optional values ​​"ip", "node" | -| target | list | no | list of instances according to scope type | - -##### "event" - -| Field | Type | Required | Description | -| ---- | ------ | ---- | ------ | -| id | string | Yes | event id | - -##### "alert" - -| Field | Type | Required | Description | -| --------- | ---- | ---- | ------ | -| alert_ids | list | yes | alert ids | - -> Note: The target in scope and strategy is selected according to scope_type. instances corresponds to instances_id, ip corresponds to {ip,bk_cloud_id}, node corresponds to {bk_obj_id, bk_inst_id}, and biz does not need to pass in anything - -#### Sample Data - -Range-Based Shielding - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "category":"scope", - "begin_time":"2019-11-21 00:00:00", - "end_time":"2019-11-23 23:59:59", - "cycle_config":{ - "begin_time":"", - "end_time":"", - "day_list":[], - "week_list":[], - "type":1 - }, - "shield_notice":true, - "notice_config":{ - "notice_time":5, - "notice_way":["weixin"], - "notice_receiver":[ - { - "id":"user1", - "type":"user" - } - ] - }, - "description":"test", - "dimension_config":{ - "scope_type":"instance", - "target":[8] - }, - "bk_biz_id":2 -} -``` - -Policy-Based Shielding - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "category":"strategy", - "begin_time":"2019-11-21 00:00:00", - "end_time":"2019-11-23 23:59:59", - "cycle_config":{ - "begin_time":"", - "end_time":"", - "day_list":[], - "week_list":[], - "type":1 - }, - "shield_notice":true, - "notice_config":{ - "notice_time":5, - "notice_way":["weixin"], - "notice_receiver":[ - { - "id":"user1", - "type":"user" - } - ] - }, - "description":"test", - "dimension_config":{ - "id": 1, - "level":[1] - }, - "bk_biz_id":2 -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | mask configuration id | - -#### Sample data - -```json -{ - "message": "OK", - "code": 200, - "data": { - "id": 1 - }, - "result": true -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_alarm_strategy.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_alarm_strategy.md deleted file mode 100644 index e2c08621f..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_alarm_strategy.md +++ /dev/null @@ -1,46 +0,0 @@ -### Function description - -Delete alert strategy - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| :-------- | ---- | ---- | ---------- | -| bk_biz_id | int | yes | business id | -| id | int | yes | alarm strategy ID | - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_id": 2, - "id": 1 -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | null | return data | - -##### Sample data - -```json -{ - "message": "OK", - "code": 200, - "data": null, - "result": true -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_alarm_strategy_v2.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_alarm_strategy_v2.md deleted file mode 100644 index 60b3ee80e..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_alarm_strategy_v2.md +++ /dev/null @@ -1,49 +0,0 @@ -### Function description - -Delete strategy configuration - -### Request parameters - -{{ common_args_desc }} - -#### interface parameters - -| Field | Type | Required | Description | -| :-------- | ---- | ---- | -------------- | -| bk_biz_id | int | yes | business id | -| ids | list | yes | list of alarm strategy IDs | - - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_id": 7, - "ids": [49] -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------------ | -| result | bool | whether the request was successful | -| code | int | returned status code | -| message | string | description | -| data | list | list of deleted strategy ids | - -#### Sample data - -```json -{ - "result": true, - "code": 200, - "message": "OK", - "data": [ - 49 - ] -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_notice_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_notice_group.md deleted file mode 100644 index 7d00a6376..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/delete_notice_group.md +++ /dev/null @@ -1,44 +0,0 @@ -### Function description - -delete notification group - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| ---- | ---- | ---- | -------- | -| ids | list | yes | notification group id | - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "ids": [1] -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | null | return data | - -#### Sample data - -```json -{ - "message": "OK", - "code": 200, - "data": null, - "result": true -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/disable_shield.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/disable_shield.md deleted file mode 100644 index 350fb9c43..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/disable_shield.md +++ /dev/null @@ -1,44 +0,0 @@ -### Function description - -remove shielding configuration - -### request parameters - -{{ common_args_desc }} - -#### interface parameters - -| Field | Type | Required | Description | -| ---- | ---- | ---- | ---------- | -| id | int | yes | shield config id | - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "id": 1 -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | whether the request was successful | -| code | int | returned status code | -| message | string | description | -| data | string | return data | - -#### Sample data - -```json -{ - "result": true, - "code": 200, - "message": "", - "data": "" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/edit_shield.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/edit_shield.md deleted file mode 100644 index 1c9501bb2..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/edit_shield.md +++ /dev/null @@ -1,95 +0,0 @@ -### Function description - -Edit shield configuration - -### request parameters - -{{ common_args_desc }} - -#### interface parameters - -| Field | Type | Required | Description | -| ------------- | ------ | ---- | --------------------------------------------------------- | -| bk_biz_id | int | yes | business id | -| description | string | yes | description | -| begin_time | string | yes | start time | -| end_time | string | yes | end time | -| cycle_config | dict | yes | shield configuration | -| shield_notice | bool | yes | whether to send shield notifications | -| notice_config | dict | no | notification configuration | -| id | int | yes | mask config id | -| level | int | No | The level of the masking strategy (if the masking type is strategy masking, the level needs to be passed in) | - -#### Shield configuration (cycle_config) - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | -------------------------------------------------- | -| begin_time | string | no | start time (every day) | -| end_time | string | no | end time (daily) | -|type | int | yes | type of masking period (single: 1, daily: 2, weekly: 3, monthly: 4) | -| day_list | list | No | When the period is a month, the days to be masked | -| week_list | list | No | The week is the day that needs to be masked | - -#### Notification configuration (notice_config) - -| Field | Type | Required | Description | -| --------------- | ---- | ---- | ------------------------------------------------------------ | -| notice_time | int | yes | N minutes before shield start/end | -| notice_way | list | yes | type of notification, optional values ​​"weixin", "mail", "sms", "voice" | -| notice_receiver | list | Yes | Notifiers, including operation and maintenance personnel, product personnel, testers, developers, active and standby personnel, and backup managers | - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "category":"scope", - "begin_time":"2019-11-21 00:00:00", - "end_time":"2019-11-23 23:59:59", - "cycle_config":{ - "begin_time":"", - "end_time":"", - "day_list":[], - "week_list":[], - "type":1 - }, - "shield_notice":true, - "notice_config":{ - "notice_time":5, - "notice_way":["weixin"], - "notice_receiver":[ - { - "id":"user1", - "type":"user" - } - ] - }, - "id": 1, - "description":"test", - "bk_biz_id":2 -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ---------------- | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | Modified shielding strategy id | - -#### Sample data - -```json -{ - "message": "OK", - "code": 200, - "data": { - "id": 1 - }, - "result": true -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/export_uptime_check_task.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/export_uptime_check_task.md deleted file mode 100644 index cf2fff074..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/export_uptime_check_task.md +++ /dev/null @@ -1,343 +0,0 @@ -### Function description - -uptime check configuration export - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| ------ | ------ | ---- | ------------------------------------------------------------ | -| bk_biz_id | int | yes | business id | -| protocol | str | no | protocol type (TCP, UDP, HTTP)| -| task_ids | str | no | task IDs, multiple tasks separated by commas | -| node_conf_needed | int | No | Whether to export the node configuration information related to the task, 0 or 1, the default is 1 | - -#### Request parameter example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_id": 2, - "task_ids": "60", - "protocol": "TCP" -} -``` - -### Return parameters - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -| result | bool | Returns the result, true for success, false for failure | -| code | int | Return code, 200 indicates success, other values ​​indicate failure | -| message | string | Error message | -| data | list | results | - -## data - -There are multiple configuration lists (conf_list) - -### Configuration list --conf_list - -| Field | Type | Description | -| -------------- | ---- | -------------- | -| collector_conf | dict | Basic configuration of uptime check | -| target_conf | dict | configuration for dispatching test tasks | -| monitor_conf | list | The monitoring strategy corresponding to the dial test task | - -#### Basic configuration of uptimecheck --data.conf_list.collector_conf - -| Field | Type | Description | -| ----------- | ------ | ------------ | -| location | dict | The address of the dial test target | -| groups | str | The group to which the test task belongs | -| name | str | Call test task name | -| protocol | str | dial test task protocol type | -| config | dict | Detailed configuration of uptime check | - -##### Basic configuration of uptimecheck detailed configuration (TCP)--data.conf_list.collector_conf.config (TCP, UDP) - -| Field | Type | Description | -| ----------- | ------ | ------------ | -| ip_list | list | target IP address | -| port | int | port address | -| period | int | Collection period, unit min | -| response_format | str | response information matching method (inclusive: in, not inclusive: nin, regular: reg) | timeout | int | expected response time | -| response | str | Expected response content | -| response_code | str | Expected response code | - -###### Example of config returned by http task - -```json -{ -"config": { -"insecure_skip_verify": true, -"urls": "http://baidu.com", -"response_code": "", -"request": null, -"period": 1, -"response_format": "in", -"method": "GET", -"headers": [], -"timeout": 3000, -"response": null -} -} -``` -##### Basic configuration of uptimecheck detailed configuration (HTTP)--data.conf_list.collector_conf.config (HTTP) - -| Field | Type | Description | -| ----------- | ------ | ------------ | -| urls | str | url | -| method | str | Request method | -| headers | list | request headers | -| insecure_skip_verify | bool | Whether to enable ssh verification | -| period | int | Collection period, unit min | -| response_format | str | response information matching method (inclusive: in, not inclusive: nin, regular: reg) | timeout | int | expected response time | -| response | str | Expected response content | -| response_code | str | Expected response code | - -##### Dial target address --data.conf_list.collector_conf.location - -| Field | Type | Description | -| ----------- | ------ | ------------ | -| bk_state_name | str | country | -| bk_province_name | str | province | - -#### Uptimecheck delivery configuration --data.conf_list.target_conf - -| Field | Type | Description | -| ----------- | ------ | ------------ | -| bk_biz_id | int | Business ID | -| node_list | list | node information associated with the task | - -##### Task-related node information --data.conf_list.target_conf.node_list - -| Field | Type | Description | -| ----------- | ------ | ------------ | -| node_conf | dict | Node configuration information | -| target_conf | dict | Node delivery information | - -###### Node delivery information --data.conf_list.target_conf.node_list.target_conf - -| Field | Type | Description | -| ----------- | ------ | ------------ | -| bk_biz_id | int | The business of the node | -| ip | str | Node IP | -| bk_cloud_id | int | Node cloud region ID | - -###### Node configuration information --data.conf_list.target_conf.node_list.node_conf - -| Field | Type | Description | -| ----------- | ------ | ------------ | -| carrieroperator | str | carrier information | -| name | str | node name | -| is_common | bool | Is it a common node | -| location | dict | The region where the node is located | - -###### The region where the node is located --data.conf_list.target_conf.node_list.node_conf.location - -| Field | Type | Description | -| ----------- | ------ | ------------ | -| country | str | country | -| city | str | province | - -#### The region where the node is located --data.conf_list.monitor_conf - -| Field | Type | Description | -| ----------- | ------ | ------------ | -| alarm_level_config | dict | Monitoring trigger condition configuration | -| monitor_target | str | monitor target field| -| unit | str | unit | -| display_name | str | monitor name | -| node_count | int | number of nodes | -| is_enabled | bool | whether to enable | -| nodata_alarm | int | no data alarm | -| rules | dict | Alarm convergence configuration | -| is_classify_notice | bool | Whether to classify alarms | -| where_sql | str | Monitoring source query conditions | -| condition | list | Monitoring scope | -| bk_biz_id | int | Business ID | -| scenario | str | monitoring scenario | -| monitor_id | int | monitor source ID | -| alarm_strategy_id | int | monitoring strategy ID | -| is_recovery | bool | auto recovery | - -##### Alarm convergence configuration --data.conf_list.monitor_conf.rules - -| Field | Type | Description | -| ------|-------|-------| -| alarm_window | int | alarm window | -| check_window | int | check window | -| count | int | number | - -##### Monitoring trigger condition configuration --data.conf_list.monitor_conf.alarm_level_config - -Field | Type | Description | -------|-------|-------| -1 | dict | The alarm trigger configuration corresponding to the alarm level, expressed as a fatal alarm | -2 | dict | The alarm trigger configuration corresponding to the alarm level, which is displayed as an early warning alarm | -3 | dict | The alarm trigger configuration corresponding to the alarm level, which is displayed as a reminder alarm | - -###### Alarm trigger configuration corresponding to alarm level --data.conf_list.monitor_conf.alarm_level_config.1 - -Field | Type | Description | -------|-------|-------| -alarm_start_time | str | Start alarm time of the day | -alarm_end_time | str | end of day alarm time | -detect_algorithm | list | Detection algorithm configuration | -is_recovery | str | auto recovery | -monitor_level | int | Alarm level, 1 fatal, 2 early warning, 3 reminder | -notify_way | list |Notification methods, mail, wechat, sms, phone | -phone_receiver | list | Phone notification object, account name | -responsible | list | List of other notifiers | -role_list | list | Notifier group, configured in business management | - -###### Detection algorithm configuration --data.conf_list.monitor_conf.alarm_level_config.1.detect_algorithm - -|Field|Type|Description| -|------|-------|-------| -| config | dict | Detailed configuration of detection algorithm | -| algorithm_id | int | Detection algorithm ID, static threshold 1000, year-on-year strategy (simple) 1001, chain strategy (simple) 1002 | - -###### Detection algorithm detailed configuration (static threshold) --data.conf_list.monitor_conf.alarm_level_config.1.detect_algorithm.config - -|Field|Type|Description| -|------|-------|-------| -threshold | int | comparison value | -method | str | comparison method | -message | str | description | - -###### Detection algorithm detailed configuration (year-on-year, chain ratio)--data.conf_list.monitor_conf.alarm_level_config.1.detect_algorithm.config - -|Field|Type|Description| -|------|-------|-------| -ceil | int | greater than the set value alarm | -floor | str | Lower than set value alarm | -message | str | description | - -#### Return parameter example - -```json -{ - "message": "OK", - "code": 200, - "data": [ - { - "target_conf": { - "bk_biz_id": 0, - "node_id_list": [], - "node_list": [ - { - "node_conf": { - "carrieroperator": "内网", - "location": { - "country": "China", - "city": "Guangdong" - }, - "name": "China Guangdong Intranet", - "is_common": false - }, - "target_conf": { - "bk_biz_id": 0, - "ip": "", - "bk_cloud_id": 0 - } - }, - { - "node_conf": { - "carrieroperator": "内网", - "location": { - "country": "China", - "city": "Guangdong" - }, - "name": "China Guangdong Intranet", - "is_common": false - }, - "target_conf": { - "bk_biz_id": 0, - "ip": "", - "bk_cloud_id": 0 - } - } - ] - }, - "collector_conf": { - "config": { - "ip_list": [ - "10.0.0.1" - ], - "period": 1, - "response_format": "in", - "port": 3306, - "timeout": 2900, - "response": null - }, - "protocol": "TCP", - "name": "test_tcp1", - "groups": "Uncategorized", - "location": { - "bk_state_name": "China", - "bk_province_name": "Beijing" - } - }, - "monitor_conf": [ - { - "alarm_level_config": { - "2": { - "notify_way": [ - "mail" - ], - "role_list": [ - "Tester" - ], - "monitor_level": 2, - "alarm_end_time": "23:59", - "responsible": [], - "detect_algorithm": [ - { - "config": { - "threshold": 10, - "message": "", - "method": "gte" - }, - "algorithm_id": 1000 - } - ], - "phone_receiver": [], - "alarm_start_time": "00:00", - "is_recovery": false - } - }, - "monitor_target": "available", - "unit": "%", - "display_name": "\"test_tcp1\"Node Average Availability", - "node_count": 0, - "is_enabled": true, - "nodata_alarm": 0, - "rules": { - "count": 1, - "alarm_window": 1440, - "check_window": 5 - }, - "is_classify_notice": false, - "where_sql": "", - "condition": [ - [] - ], - "bk_biz_id": 2, - "scenario": "uptimecheck", - "monitor_id": 0, - "alarm_strategy_id": 0, - "is_recovery": false - } - ] - } - ], - "result": true -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/get_event_log.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/get_event_log.md deleted file mode 100644 index 9b44d72f5..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/get_event_log.md +++ /dev/null @@ -1,121 +0,0 @@ -### Function description - -Query event flow records - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| ---- | ------ | ---- | ------ | -| id | string | yes | alert ID | - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "id": 164239028644167 -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | - -#### Data field description - -| Field | Type | Description | -| ----------- | ------ | -------- | -| status | string | status | -| event_id | string | event ID | -| message | string | log message | -| operate | string | record type | -| extend_info | dict | additional data | -| create_time | string | creation time | - -#### operate - record type - -* CREATE - alarm generated -* CONVERGE - alarm convergence -* RECOVER - alarm recovery -* CLOSE - the alarm is closed -* DELAY_RECOVER - delay recovery -* ABORT_RECOVER - Abort recovery -* SYSTEM_RECOVER - alarm recovery -* SYSTEM_CLOSE - alarm close -* ACK - alarm acknowledgement -* SEVERITY_UP - alert level adjustment -* ACTION - handle the action - -#### status - status - -* SUCCESS - success - -#### extend_info - -Different types of records have different data - -##### ANOMALY_NOTICE - alert notification - -* action - notification configuration (refer to the action_list description in the "query event" interface documentation) - -```json -{ - "action": {} -} -``` - -##### CONVERGE - Alarm convergence - -* process_time - the processing time period for the converged data points -* anomaly_count - the number of convergence anomaly points -* data_time - the data time period for the converged data point -* anomaly_record - anomaly point record (refer to the origin_alarm description in the "query event" interface documentation) - -```json -{ - "process_time": { - "max": 1583914154, - "min": 1583911227 - }, - "anomaly_record": {}, - "data_time": { - "max": 1583914020, - "min": 1583911080 - }, - "anomaly_count": 50 -} -``` - -#### Sample data - -```json -{ - "result": true, - "code": 200, - "message": "ok", - "data": [ - { - "status": "SUCCESS", - "event_id": "164239028644167", - "message": "", - "operate": "CREATE", - "extend_info": "", - "create_time": "2020-01-01 00:00:00" - } - ] -} -``` - -| -| diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/get_shield.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/get_shield.md deleted file mode 100644 index 339e1e028..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/get_shield.md +++ /dev/null @@ -1,192 +0,0 @@ -### Function description - -Query shield details - -### Request parameters - -{{ common_args_desc }} - -#### interface parameters - -| Field | Type | Required | Description | -| --------- | ---- | ---- | ------ | -| id | int | yes | shield id | -| bk_biz_id | int | yes | business id | - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "id": 1, - "bk_biz_id": 2 -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | - -#### data field description - -| Field | Type | Description | -| ---------------- | ------ | ------------------------------------------------------------ | -| bk_biz_id | int | Business ID | -| category | string | mask type (scope: "scope", strategy: "strategy", event: "event", alert: "alert") | -| description | string | description | -| begin_time | string | start time | -| end_time | string | end time | -| cycle_config | dict | shield configuration | -| shield_notice | bool | whether to send shield notification | -| notice_config | dict | notification configuration | -| dimension_config | dict | mask dimension | -| id | int | mask ID | -| scope_type | string | scope type | -| status | int | current status, shielding (1), expired (2), released (3) | - -#### Shield configuration (cycle_config) - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | -------------------------------------------------- | -| begin_time | string | no | start time (every day) | -| end_time | string | no | end time (daily) | -|type | int | yes | type of masking period (single: 1, daily: 2, weekly: 3, monthly: 4) | -| day_list | list | No | When the period is a month, the days to be masked | -| week_list | list | No | The week is the day that needs to be masked | - -#### Notification configuration (notice_config) - -| Field | Type | Required | Description | -| --------------- | ---- | ---- | ------------------------------------------------------------ | -| notice_time | int | yes | N minutes before shield start/end | -| notice_way | list | yes | type of notification, optional values ​​"weixin", "mail", "sms", "voice" | -| notice_receiver | list | Yes | Notifiers, including operation and maintenance personnel, product personnel, testers, developers, active and standby personnel, and backup managers | - -#### mask dimension (dimension_config) - -The masking dimension is related to the masking type (category) - -##### "scope" - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | --------------------------------------------- | -| scope_type | string | yes | masking scope, optional values ​​"instance", "ip", "node", "biz" | -| target | list | no | list of instances according to scope type | -| metric_id | list | no | metric id | - -##### "strategy" - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | ---------------------------- | -| id | list | is | policy id | -| level | list | No | Alarm level | -| scope_type | string | no | mask scope, optional values ​​"ip", "node" | -| target | list | no | list of instances according to scope type | - -##### "event" - -| Field | Type | Required | Description | -| ---- | ------ | ---- | ------ | -| id | string | is | event id | - -##### "alert" - -| Field | Type | Required | Description | -| --------- | ---- | ---- | ------ | -| alert_ids | list | yes | alert ids | - -> Note: The target in scope and strategy is selected according to scope_type. instances corresponds to instances_id, ip corresponds to {ip,bk_cloud_id}, node corresponds to {bk_obj_id, bk_inst_id}, and biz does not need to pass in anything - -#### Sample data - -Range-Based Masking - -```json -{ - "code": 200, - "message": "ok", - "result": true, - "data": { - "id": 1, - "scope_type": "instance", - "status": 1, - "category":"scope", - "begin_time":"2019-11-21 00:00:00", - "end_time":"2019-11-23 23:59:59", - "cycle_config":{ - "begin_time":"", - "end_time":"", - "day_list":[], - "week_list":[], - "type":1 - }, - "shield_notice":true, - "notice_config":{ - "notice_time":5, - "notice_way":["weixin"], - "notice_receiver":[ - { - "id":"user1", - "type":"user" - } - ] - }, - "description":"test", - "dimension_config":{ - "scope_type":"instance", - "target":[8] - }, - "bk_biz_id":2 - } -} - -``` - -Policy-Based Shielding - -```json -{ - "result": true, - "code": 200, - "messgae" : "ok", - "data": { - "id": 1, - "scope_type": "instance", - "status": 1, - "category":"scope", - "begin_time":"2019-11-21 00:00:00", - "end_time":"2019-11-23 23:59:59", - "cycle_config":{ - "begin_time":"", - "end_time":"", - "day_list":[], - "week_list":[], - "type":1 - }, - "shield_notice":true, - "notice_config":{ - "notice_time":5, - "notice_way":["weixin"], - "notice_receiver":[ - { - "id":"user1", - "type":"user" - } - ] - }, - "description":"test", - "dimension_config":{ - "scope_type":"instance", - "target":[8] - }, - "bk_biz_id":2 - } -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/get_ts_data.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/get_ts_data.md deleted file mode 100644 index 1decffe2f..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/get_ts_data.md +++ /dev/null @@ -1,103 +0,0 @@ - - -### Function description - -Chart data query -Query the specified storage engine based on the given sql expression - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| sql | string | yes | SQL query statement | -| prefer_storage | string | no | query engine (default influxdb) | -| bk_username | string | No | App_code of the whitelist is required | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_username":"admin", - "sql":"select max(in_use) as _in_use from 3_system_disk where time >= \"1m\" group by ip, bk_cloud_id, bk_supplier_id, device_name, minute1 order by time desc limit 1" -} -``` - -> the resulting table in sql is named biz_id + db_name + table_name -> -> - Biz_id: business id -> - Db_name: database name -> - Table_name: data table name -> -> Example: 2_system_cpu_detail: cpu_detail table of system library under business 2, The sql statement to query the usage of single-core cpu within an hour: -> -> Select Mean(usage) as usage from 2_system_detail where time > '1h' group by ip,device_name,minute1 limit 10 - -> The result table 3_system_disk in the above request example indicates: the disk table in the system library under business 3 - ->Note: The above libraries and tables do not correspond to the actual physical libraries and tables in the time series storage. Instead, it refers to the library table of the 'Source Data Management Module' - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | list | Successfully updated policy id table | -| request_id | string | request id | - -#### Data field description - -| Field | Type | Description | -| ------------ | ------ | -------- | -| list | list | Query results | -| totalRecords | int | total records | -| timetaken | float | query time | -| device | string | query engine | - -#### data.list - -The content here is the relevant content of sql search - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data":{ - "list":[ - { - "ip":"x.x.x.x", - "time":1543487700000, - "bk_supplier_id":"0", - "device_name":"C:", - "_in_use":27.0269684761, - "bk_cloud_id":"0", - "minute1":1543487700000 - }, - { - "ip":"x.x.x.x", - "time":1543487700000, - "bk_supplier_id":"0", - "device_name":"\/", - "_in_use":8.3368418991, - "bk_cloud_id":"0", - "minute1":1543487700000 - } - ], - "timetaken":0.0059459209, - "totalRecords": 2, - "device":"influxdb" - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/import_uptime_check_node.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/import_uptime_check_node.md deleted file mode 100644 index 19d38925c..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/import_uptime_check_node.md +++ /dev/null @@ -1,172 +0,0 @@ -### Function description - -Import the uptime check node - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| --------- | ---- | ---- | -------- | -| conf_list | list | yes | node list | - -#### task list --conf_list - -| Field | Type | Required | Description | -| ----------- | ---- | ---- | ------------ | -| target_conf | dict | yes | node delivery configuration | -| node_conf | dict | yes | node basic configuration | - -##### Node delivery configuration --target_conf - -| Field | Type | Required | Description | -| ----------- | ---- | ---- | -------- | -| ip | str | yes | IP | -| bk_cloud_id | int | yes | cloud zone id | -| bk_biz_id | int | yes | business id | - -##### Node basic configuration --node_conf - -| Field | Type | Required | Description | -| --------------- | ---- | ---- | ------------------------------------------ | -| is_common | bool | No | Is it a common node, default false | -| name | str | Yes | node name | -| location | dict | yes | node location | -| carrieroperator | str | yes | operator, maximum length 50 (intranet, China Unicom, mobile, other) | - -###### Node location --node_conf.location - -| Field | Type | Required | Description | -| ------- | ---- | ---- | ---- | -| country | str | Yes | country | -| city | str | Yes | city | - -#### Request parameter example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "conf_list":[{ - "node_conf": { - "carrieroperator": "内网", - "location": { - "country": "China", - "city": "Guangdong" - }, - "name": "China Guangdong Intranet", - "is_common": false - }, - "target_conf": { - "bk_biz_id": 2, - "bk_cloud_id": 0, - "ip": "x.x.x.x" - } - },{ - "node_conf": { - "carrieroperator": "内网", - "location": { - "country": "China", - "city": "Guangdong" - }, - "name": "China Guangdong Intranet", - "is_common": false - }, - "target_conf": { - "bk_biz_id": 2, - "bk_cloud_id": 0, - "ip": "x.x.x.x" - } - }]} -``` - -### Return result - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -| result | bool | Returns the result, true for success, false for failure | -| code | int | Return code, 200 indicates success, other values ​​indicate failure | -| message | string | Error message | -| data | list | results | - -#### Data field description - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -failed | dict | Import failure related information | -success | dict | Import success related information | - -##### Import failure related information --data.failed - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -total | int | Number of import failures | -detail | list | Import failure details | - -###### Import failed details --data.failed.detail - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -| target_conf | dict | Node delivery configuration | -| error_mes | str | Import failure reason | - -##### Import success related information --data.success - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -| total | int | Number of successful imports | -| detail | list | Import success details | - -###### Import success related information --data.success.datail - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -| target_conf | dict | node delivery configuration | -| node_id | int | node id imported successfully | - -#### return result example - -```json -{ - "message": "OK", - "code": 200, - "data": { - "failed": { - "total": 1, - "detail": [ - "target_conf": { - "bk_biz_id": 2, - "ip": "x.x.x.x", - "bk_cloud_id": 0 - }, - "error_mes": "The host does not exist under the business" - ] - }, - "success": { - "total": 2, - "detail": [ - { - "target_conf": { - "bk_biz_id": 2, - "ip": "x.x.x.x", - "bk_cloud_id": 0 - }, - "node_id": 30 - }, - { - "target_conf": { - "bk_biz_id": 2, - "ip": "x.x.x.x", - "bk_cloud_id": 0 - }, - "node_id": 31 - } - ] - } -}, -"result": true -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/import_uptime_check_task.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/import_uptime_check_task.md deleted file mode 100644 index 89f328336..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/import_uptime_check_task.md +++ /dev/null @@ -1,402 +0,0 @@ -### Function description - -Import uptime check tasks - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| --------- | ---- | ---- | ---------------- | -| bk_biz_id | int | yes | business id | -| conf_list | list | yes | uptime check task configuration list | - -#### uptime check task configuration list --conf_list - -| Field | Type | Required | Description | -| -------------- | ---- | ---- | ---------------- | -| target_conf | dict | yes | configuration of uptime check task delivery | -| collector_conf | dict | yes | basic configuration of uptime check tasks | -| monitor_conf | list | yes | monitoring policy configuration | - -##### uptime check task delivery configuration --conf_list.target_conf - -| Field | Type | Required | Description | -| ------------ | ---- | ---- | ---------------------------------------------------------- | -| bk_biz_id | int | yes | business id | -| node_list | list | No | Default [], need to import node configuration | -| node_id_list | list | No | Default [], send node ID list, node_list and node_id_list cannot be empty at the same time | - -###### Need to import node configuration --conf_list.target_conf.node_list - -| Field | Type | Required | Description | -| ----------- | ---- | ---- | ------------ | -| target_conf | dict | yes | node delivery configuration | -| node_conf | dict | yes | node basic configuration | - -###### Node delivery configuration --conf_list.target_conf.node_list.target_conf - -| Field | Type | Required | Description | -| ----------- | ---- | ---- | -------- | -| ip | str | yes | IP | -| bk_cloud_id | int | yes | cloud zone id | -| bk_biz_id | int | yes | business id | - -###### Node basic configuration --conf_list.target_conf.node_list.node_conf - -| Field | Type | Required | Description | -| --------------- | ---- | ---- | ------------------------------------------ | -| is_common | bool | No | Is it a common node, default false | -| name | str | Yes | node name | -| location | dict | yes | node location | -| carrieroperator | str | yes | operator, maximum length 50 (intranet, China Unicom, mobile, other) | - -###### Node location --conf_list.target_conf.node_list.node_conf.location - -| Field | Type | Required | Description | -| ------- | ---- | ---- | ---- | -| country | str | Yes | country | -| city | str | Yes | city | - -##### Basic configuration of uptime check task --conf_list.collector_conf - -| Field | Type | Required | Description | -| -------- | ---- | ---- | ---------------- | -| location | dict | yes | address of the dial target | -| groups | str | Yes | The group to which the test task belongs | -| name | str | yes | uptime check task name | -| protocol | str | yes | uptime check task protocol type | -| config | dict | yes | detailed configuration of uptime check tasks | - -###### TCP task config example - -```json -"config": { - "ip_list": ["10.0.0.1"], - "port": 3306, - "period": 1, - "response_format": "in", - "timeout": 2900, - "response": null -} -``` - -###### uptime check task detailed configuration (TCP, UDP) --conf_list.collector_conf.config - -| Field | Type | Required | Description | -| --------------- | ---- | ---- | ---------------------------------------------------------- | -| ip_list | list | yes | destination IP address | -| port | int | yes | port address | -| period | int | No | Collection period, unit min, default 1 | -| response_format | str | No | Response information matching method (include: in, exclude: nin, regular: reg), default in | -| timeout | int | No | Expected response time, in ms, default 3000 | -| response | str | no | expected response content | -| response_code | str | no | expected response code | - -###### HTTP task config example - -```json -"config": { - "insecure_skip_verify": true, - "urls": "http://baidu.com", - "response_code": "", - "request": null, - "period": 1, - "response_format": "in", - "method": "GET", - "headers": [], - "timeout": 3000, - "response": null -} -``` - -###### uptime check task detailed configuration (HTTP)--conf_list.collector_conf.config - -| Field | Type | Required | -| -------------------- | ---- | ---- | -| urls | str | yes | -| method | str | yes | -| headers | list | no | -| insecure_skip_verify | bool | no | -| period | int | no | -| response_format | str | no | -| timeout | int | no | -| response | str | no | -| response_code | str | no | -| request | str | no | - -##### Monitoring policy configuration --conf_list.monitor_conf - -| Field | Type | Required | Description | -| ------------------ | ------ | ---- | ----------------------------------------------------- | -| alarm_level_config | dict | yes | monitoring trigger condition configuration | -| alarm_strategy_id | int | yes | monitoring strategy id, 0 | -| bk_biz_id | int | yes | business id | -| condition | list | yes | monitoring scope | -| display_name | string | yes | monitor name | -| is_classify_notice | bool | yes | whether to classify alarms | -| is_enabled | bool | yes | whether to enable | -| is_recovery | bool | yes | recovery alarm switch | -| monitor_target | str | yes | monitor target field | -| nodata_alarm | int | yes | number of no data alarms | -| node_count | int | yes | node average/partial node count | -| rules | dict | yes | convergence rules | -| scenario | str | yes | monitoring scenario | -| unit | str | yes | monitor field unit | -| where_sql | str | yes | can be used for precondition filtering part monitoring support using database directly as source | - -###### Convergence rules --conf_list.monitor_conf.rules - -| Field | Type | Required | Description | -| ------------ | ---- | ---- | -------- | -| alarm_window | int | yes | alarm window | -| check_window | int | yes | check_window | -| count | int | yes | number | - -###### Monitoring trigger condition configuration --conf_list.monitor_conf.alarm_level_config - -| Field | Type | Required | Description | -| ---- | ---- | ---- | ------------------------------------------ | -| 1 | dict | No | The alarm trigger configuration corresponding to the alarm level, which is a fatal alarm | -| 2 | dict | No | The alarm trigger configuration corresponding to the alarm severity, which is displayed as a warning alarm | -| 3 | dict | No | The alarm trigger configuration corresponding to the alarm severity, which is displayed as a reminder alarm | - -###### Alarm trigger configuration corresponding to alarm level --conf_list.monitor_conf.alarm_level_config.1 - -| Field | Type | Required | Description | -| ---------------- | ---- | ---- | -------------------------------------------------- | -| alarm_start_time | str | yes | start alarm time of the day | -| alarm_end_time | str | yes | end alarm time of the day | -| detect_algorithm | list | yes | detection algorithm configuration | -| is_recovery | str | yes | city | -| monitor_level | int | yes | alarm level, 1 fatal, 2 early warning, 3 reminder | -| notify_way | list | Yes | Notification method, mail, wechat, sms, phone | -| phone_receiver | list | yes | phone notification object, account name | -| responsible | list | yes | list of other notifiers | -| role_list | list | Yes | Notifier group, configured in business management | - -###### Detection algorithm configuration --conf_list.monitor_conf.alarm_level_config.1.detect_algorithm - -| Field | Type | Required | Description | -| ------------ | ---- | ---- | ------------------------------------------------------------ | -| config | dict | yes | detection algorithm detailed configuration | -| algorithm_id | int | yes | detection algorithm ID, static threshold 1000, year-on-year strategy (simple) 1001, chain strategy (simple) 1002 | - -###### Detection algorithm detailed configuration (static threshold) --conf_list.monitor_conf.alarm_level_config.1.detect_algorithm.config - -| Field | Type | Required | Description | -| --------- | ---- | ---- | -------- | -| threshold | int | yes | comparison value | -| method | str | yes | comparison method | -| message | str | No | Description | - -###### Detection algorithm detailed configuration (year-on-year, chain ratio) --conf_list.monitor_conf.alarm_level_config.1.detect_algorithm.config - -| Field | Type | Required | Description | -| ------- | ---- | ---- | -------------- | -| ceil | int | yes | greater than the set value alarm | -| floor | str | yes | lower than set value alarm | -| message | str | No | Description | - -#### Request parameter example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_id": 2, - "conf_list": [ - { - "target_conf": { - "bk_biz_id": 0, - "node_id_list": [], - "node_list": [ - { - "node_conf": { - "carrieroperator": "内网", - "location": { - "country": "China", - "city": "Guangdong" - }, - "name": "China Guangdong Intranet", - "is_common": false - }, - "target_conf": { - "bk_biz_id": 0, - "ip": "", - "bk_cloud_id": 0 - } - }, - { - "node_conf": { - "carrieroperator": "内网", - "location": { - "country": "China", - "city": "Guangdong" - }, - "name": "China Guangdong Intranet", - "is_common": false - }, - "target_conf": { - "bk_biz_id": 0, - "ip": "", - "bk_cloud_id": 0 - } - } - ] - }, - "collector_conf": { - "config": { - "ip_list": [ - "10.0.0.1" - ], - "period": 1, - "response_format": "in", - "port": 3306, - "timeout": 2900, - "response": null - }, - "protocol": "TCP", - "name": "test_tcp1", - "groups": "Uncategorized", - "location": { - "bk_state_name": "China", - "bk_province_name": "Beijing" - } - }, - "monitor_conf": [ - { - "alarm_level_config": { - "2": { - "notify_way": [ - "mail" - ], - "role_list": [ - "Tester" - ], - "monitor_level": 2, - "alarm_end_time": "23:59", - "responsible": [], - "detect_algorithm": [ - { - "config": { - "threshold": 10, - "message": "", - "method": "gte" - }, - "algorithm_id": 1000 - }, - { - "config": { - "message": "", - "ceil": 10, - "floor": 10 - }, - "algorithm_id": 1001 - } - ], - "phone_receiver": [], - "alarm_start_time": "00:00", - "is_recovery": false - } - }, - "monitor_target": "available", - "unit": "%", - "display_name": "\"test_tcp1\"Node Average Availability", - "node_count": 0, - "is_enabled": true, - "nodata_alarm": 0, - "rules": { - "count": 1, - "alarm_window": 1440, - "check_window": 5 - }, - "is_classify_notice": false, - "where_sql": "", - "condition": [ - [] - ], - "bk_biz_id": 2, - "scenario": "uptimecheck", - "monitor_id": 0, - "alarm_strategy_id": 0, - "is_recovery": false - } - ] - } - ] -} -``` - -### return result - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -| result | bool | Returns the result, true for success, false for failure | -| code | int | Return code, 200 indicates success, other values ​​indicate failure | -| message | string | Error message | -| data | list | results | - -#### data field description - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -failed | dict | Import failure related information | -success | dict | Import success related information | - -##### Import failure related information --data.failed - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -total | int | Number of import failures | -detail | list | Import failure details | - -###### Import failed details --data.failed.detail - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -| error_mes | str | Import failure reason | -| task_name | str | task name | - -##### Import success related information --data.success - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -| total | int | Number of successful imports | -| detail | list | Import success details | - -###### Import success related information --data.success.datail - -| Field | Type | Description | -| ------- | ------ | ----------------------------------- | -| task_name | str | task name | - -#### return result example - -```json -{ - "message": "OK", - "code": 200, - "data": { - "failed": { - "total": 0, - "detail": [{ - "task_name": "tcp_test2", - "error_month": "xx" - }] - }, - "success": { - "total": 1, - "detail": [ - { - "task_name": "test_tcp1" - } - ] - } - }, - "result": true -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/list_shield.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/list_shield.md deleted file mode 100644 index cc72dc816..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/list_shield.md +++ /dev/null @@ -1,167 +0,0 @@ -### Function description - -Query shield list - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| ---------- | ------ |------| -------- | -| time_range | string | no | time range | -| bk_biz_id | int | no | business ID | -| is_active | bool | no | is it active | -| page | int | no | number of pages | -| page_size | int | no | number of pages per | - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_id": 1, - "is_active": true, - "time_range": "2018-01-01 -- 2019-01-01", - "page": 1, - "page_size": 10 -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | list | data data | - -#### Data details - -| Field | Type | Description | -| ----------- | ---- | ------------ | -| count | int | total number of shielded events | -| shield_list | list | list of shield events | - -#### Shield event list: shield_list - -| Field | Type | Description | -| ---------------- | ------ | ------------------------------------------------------------ | -| bk_biz_id | int | Business ID | -| category | string | mask type (scope: "scope", strategy: "strategy", event: "event", alert: "alert") | -| description | string | description | -| begin_time | string | start time | -| end_time | string | end time | -| cycle_config | dict | shield configuration | -| shield_notice | bool | whether to send shield notification | -| notice_config | dict | notification configuration | -| dimension_config | dict | mask dimension | -| id | int | mask ID | -| scope_type | string | scope type | -| status | int | current status, shielding (1), expired (2), released (3) | -| failure_time | string | failure time | -| content | string | shield content snapshot | -| is_enabled | bool | whether to enable | - -#### Shield configuration (cycle_config) - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | ------------------------------------------------------------ | -| begin_time | string | no | start time (every day) | -| end_time | string | no | end time (daily) | -| type | int | yes | type of masking period (1 if the type is single, 2 per day, 3 per week, 4 per month) | -| day_list | list | No | When the period is a month, the days to be masked | -| week_list | list | No | The week is the day that needs to be masked | - -#### Notification configuration (notice_config) - -| Field | Type | Required | Description | -| --------------- | ---- | ---- | ------------------------------------------------------------ | -| notice_time | int | yes | N minutes before shield start/end | -| notice_way | list | yes | type of notification, optional values ​​"weixin", "mail", "sms", "voice" | -| notice_receiver | list | Yes | Notifiers, including operation and maintenance personnel, product personnel, testers, developers, active and standby personnel, and backup managers | - -#### mask dimension (dimension_config) - -The masking dimension is related to the masking type (category) - -##### "scope" - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | --------------------------------------------- | -| scope_type | string | yes | masking scope, optional values ​​"instance", "ip", "node", "biz" | -| target | list | no | list of instances according to scope type | -| metric_id | list | no | metric id | - -##### "strategy" - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | ---------------------------- | -| id | list | Yes | policy id | -| level | list | No | Alarm level | -| scope_type | string | no | mask scope, optional values ​​"ip", "node" | -| target | list | no | list of instances according to scope type | - -##### "event" - -| Field | Type | Required | Description | -| ---- | ------ | ---- | ------ | -| id | string | Yes | event id | - -##### "alert" - -| Field | Type | Required | Description | -| --------- | ---- | ---- | ------ | -| alert_ids | list | yes | alert ids | - -> Note: The target in scope and strategy is selected according to scope_type. instances corresponds to instances_id, ip corresponds to {ip,bk_cloud_id}, node corresponds to {bk_obj_id, bk_inst_id}, and biz does not need to pass in anything - -#### Sample data - -```json -{ - "result": true, - "code": 200, - "message": "ok", - "data": [ - { - "id": 1, - "scope_type": "instance", - "status": 1, - "category":"scope", - "begin_time":"2019-11-21 00:00:00", - "end_time":"2019-11-23 23:59:59", - "failure_time": "", - "content": "", - "cycle_config":{ - "begin_time":"", - "end_time":"", - "day_list":[], - "week_list":[], - "type":1 - }, - "shield_notice":true, - "notice_config":{ - "notice_time":5, - "notice_way":["weixin"], - "notice_receiver":[ - { - "id":"user1", - "type":"user" - } - ] - }, - "description":"test", - "dimension_config":{ - "scope_type":"instance", - "target":[8] - }, - "bk_biz_id":2 - } - ] -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/list_storage_list.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/list_storage_list.md deleted file mode 100644 index 663fc75cc..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/list_storage_list.md +++ /dev/null @@ -1,53 +0,0 @@ -### Function description - -get storage list -Returns a list of eligible storage clusters based on the given filter parameters (not yet available) - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| ---- | ---- | ---- | ---- | -| -- | -- | -- | -- | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", -} -``` - -### Return result - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | list | data | - -#### Data field description - -| Field | Type | Description | -| ------------ | ------ | ------------ | -| storage_name | string | storage type name | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data":[{ - "storage_name": "influxdb", - }], - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_clean_result_table_metric_split.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_clean_result_table_metric_split.md deleted file mode 100644 index a6d8f1dac..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_clean_result_table_metric_split.md +++ /dev/null @@ -1,52 +0,0 @@ - - -### Function description - -Clean up a result table CMDB split task - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| table_id | string | yes | result table ID | -| cmdb_level | string | yes | CMDB split level name | -| operator | string | Yes | operator | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "table_id": "system.cpu_summary", - "cmdb_level": "set", - "operator": "admin" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | results | -| request_id | string | request id | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data":{}, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_cluster_info.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_cluster_info.md deleted file mode 100644 index e222dc42e..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_cluster_info.md +++ /dev/null @@ -1,76 +0,0 @@ - - -### Function description - -Create a storage cluster configuration -Create a storage cluster configuration based on the given configuration parameters - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| cluster_name | string | yes | storage cluster name | -| cluster_type | string | Yes | Storage cluster type, currently supports influxDB, kafka, redis, elasticsearch | -| domain_name | string | Yes | Storage cluster domain name (IP can be filled in) | -| port | int | yes | storage cluster port | -| operator | string | yes | operator | -| description | string | No | Storage cluster description information | -| auth_info | dict | no | cluster authentication information | -| version | string | no | cluster version information | -| custom_label | string | no | custom label | -| schema | string | No | Forcibly configure schema, which can be used to configure https and other situations | -| is_ssl_verify | bool | no | whether to skip SSL\TLS verification | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "cluster_name": "first_influxdb", - "cluster_type": "influxDB", - "domain_name": "influxdb.service.consul", - "operator": "admin", - "auth_info": { - "username": "username", - "password": "password" - }, - "port": 9052, - "description": "Description" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | request id | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| cluster_id | int | cluster ID | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data":{ - "cluster_id": 1001 - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_data_id.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_data_id.md deleted file mode 100644 index 4ef3823ac..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_data_id.md +++ /dev/null @@ -1,83 +0,0 @@ - - -### Function description - -Create a data source -Creates a data source based on the given configuration parameters - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| data_name | string | yes | data source name | -| etl_config | string | yes | clean template configuration, prometheus exporter corresponds to "prometheus" | -| operator | string | Yes | operator | -| mq_cluster | dict | no | message cluster used by the data source | -| data_description | string | No | The specific description of the data source | -| is_custom_source | bool | No | Whether user-defined data source, the default is Yes | -| source_label | string | yes | data source label, for example: data platform (bk_data), monitor collector (bk_monitor) | -| type_label | string | yes | data type label, for example: time series data (time_series), event data (event), log data (log) | -| custom_label | string | no | custom label configuration information | -| option | string | No | Data source configuration option content, the format is {`option_name`: `option_value`} | - -**Note**: The above `source_label` and `type_label` should be obtained through the `metadata_get_label` interface, and should not be created by yourself - -#### The options currently available for data sources include - -| option name | type | description | -| -------------- | ------ | ----------- | -| group_info_alias | string | Group ID field alias | -| encoding | string | report data encoding | -| separator | string | Separator, used to separate the character content of the reported log | -| separator_field_list | list | Field assignment after split | - - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "data_name": "basereport", - "etl_config": "base report", - "operator": "username", - "data_description": "basereport data source", - "type_label": "time_series", - "source_label": "bk_monitor_collector" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | request id | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| bk_data_id | int | result table ID | - -#### Example results - -```json -{ - "message": "OK", - "code": 200, - "data": { - "bk_data_id": 1001 - }, - "result": true, - "request_id": "408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_event_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_event_group.md deleted file mode 100644 index d3b96c93d..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_event_group.md +++ /dev/null @@ -1,119 +0,0 @@ - - -### Function description - -Create an event group ID -Given a data source and business, create an attributable event group ID - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| bk_data_id | int | yes | data source id | -| bk_biz_id | int | yes | business id | -| event_group_name | string | yes | event group name | -| label | string | Yes | The event grouping label, used to represent the event monitoring object, should reuse the label under the [result_table_label] type | -| operator | string | yes | operator | -| event_info_list | list | no | event list | - -#### event_info_list specific content description - -| Field | Type | Required | Description | -| ------------------- | ------ | -------- | -------- | -| event_name | string | yes | event name | -| dimension | list | Yes | dimension list | - -#### request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_data_id": 123, - "bk_biz_id": 123, - "event_group_name": "Event group name", - "label": "application", - "operator": "system", - "event_info_list": [{ - "event_name": "usage for update", - "dimension_list": ["dimension_name"] - },{ - "event_name": "usage for create", - "dimension_list": ["dimension_name"] - }] -} -``` - -### Return result - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| event_group_id | int | New event group ID | -| bk_data_id | int | data source ID | -| bk_biz_id | int | Business ID | -| event_group_name | string | event group name | -| label | string | label | -| is_enable | bool | whether to enable | -| creator | string | Creator | -| create_time | string | creation time | -| last_modify_user | string | Last updated person | -| last_modify_time | string | Last update time | -| event_info_list | list | event list | - -#### event_info_list description - -| Field | Type | Description | -| -------------- | ------ | -------- | -| bk_event_id | int | event id | -| event_name | string | event name | -| dimension_list | list | dimension list | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data": { - "event_group_id": 1001, - "bk_data_id": 123, - "bk_biz_id": 123, - "event_group_name": "Event group name", - "label": "application", - "is_enable": true, - "creator": "admin", - "create_time": "2019-10-10 10:10:10", - "last_modify_user": "admin", - "last_modify_time": "2020-10-10 10:10:10", - "event_info_list": [{ - "bk_event_id": 1, - "event_name": "usage for update", - "dimension_list": [{ - "dimension_name": "field_name" - }] - },{ - "bk_event_id": 2, - "event_name": "usage for create", - "dimension_list": [{ - "dimension_name": "field_name" - }] - }] - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_result_table.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_result_table.md deleted file mode 100644 index 631358906..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_result_table.md +++ /dev/null @@ -1,172 +0,0 @@ - - -### Function description - -Create a result table -Creates a result table based on the given configuration parameters - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| bk_data_id | int | yes | data source id | -| table_id | string | yes | result table ID, format should be library.table (eg, system.cpu) | -| table_name_zh | string | yes | Chinese name of the result table | -| is_custom_table | bool | yes | user-defined result table | -| schema_type | string | yes | result table field configuration scheme, free (no schema configuration), fixed (fixed schema) | -| operator | string | Yes | operator | -| default_storage | string | yes | default storage type, currently supports influxdb | -| default_storage_config | dict | No | The default storage information, according to each different storage, there will be different configuration content, if not provided, the default value will be used; please refer to the specific description below for the specific content | -| field_list | list | No | Field information, the array element is object, for example, the field has field_name (field name), field_type (field type), tag (field type, metricc -- indicator, dimension -- dimension), alias_name (field alias) | -| bk_biz_id | int | No | Business ID, if not provided, the default is 0 (full business) result table; if non-zero, the result table naming convention will be verified | -| label | string | Yes | The label of the result table, the secondary label is recorded here, and the corresponding primary label will be derived from the secondary label | -| external_storage | list | No | Additional storage configuration, the format is {${storage_type}: ${storage_config}}, storage_type can be kafka, influxdb, redis; storage_config is the same as default_storage_config | -| is_time_field_only | bool | No | Whether the default field requires time only, default False | -| option | list | no | additional configuration information for the result table in the format {`option_name`: `option_value`} | -| time_alias_name | string | No | Time fields need to use other field names when uploading | - -**Note**: The above `label` should be obtained through the `metadata_get_label` interface, and should not be created by yourself - -#### The options currently available for selection in the results table include -| option name | type | description | -| -------------- | ------ | ----------- | -| cmdb_level_config | list | CMDB level split configuration | -| group_info_alias | string | Group ID field alias | -| es_unique_field_list | list | ES generates a list of fields for doc_id | - -###### Parameters: default_storage_config and storage_config -- parameters supported under influxdb - -| Key value | Type | Required | Default value | Description | -| ---- | --- | --- | ---| ---| -| storage_cluster_id | int | no | use default storage cluster for this storage type | specify storage cluster | -| database | string | no | dotted first part of table_id | database stored | -| real_table_name | string | no | dotted second part of table_id | actual storage table name | -| source_duration_time | string | No | 30d | Metadata save time, it needs to conform to influxdb format | - -###### Parameters: default_storage_config and storage_config -- parameters supported under kafka -| Key value | Type | Required | Default value | Description | -| ---- | --- | --- |--- | --- | -| storage_cluster_id | int | no | use default storage cluster for this storage type | specify storage cluster | -| topic | string | no | 0bkmonitor_storage_${table_id} | stored topic configuration | -| partition | int | No | 1 | Stores the number of partitions. Note: This is just a record. If it is a configuration with more than one topic, it needs to be expanded manually through the kafka command line tool | -| retention | int | no | 1800000 | Kafka data retention time, the default is half an hour, in ms | - -###### Parameters: default_storage_config and storage_config -- parameters supported under redis -| Key value | Type | Required | Default value | Description | -| ---- | --- | --- | --- | --- | -| storage_cluster_id | int | no | use default storage cluster for this storage type | specify storage cluster | -| key | string | no | table_id name | store key value | -| db | int | no | 0 | use db config | -| command | string | No | PUBLISH | Store command | -| is_sentinel | bool | no | False | whether sentinel mode | -| master_name | string | no | "" | master name in sentinel mode | - -**Note**: Since redis uses the queue method by default, it is discarded after consumption, so there is no time length configuration - -###### Parameters: default_storage_config and storage_config -- parameters supported under elasticsearch - -| Key value | Type | Required | Default value | Description | -| ---- | --- | --- | --- | --- | -| storage_cluster_id | int | no | - |uses the default storage cluster for this storage type -| retention | int | no | 30 | index retention time, in days, the default is 30 days | -| date_format | string | no | %Y%m%d%H | time format, the default is specific to the hour | -| slice_size | int | No | 500 | The size threshold to be sliced, the unit is GB, the default is 500GB | -| slice_gap | int | no | 120 | index slice interval, in minutes, default 2 hours | -| index_settings | string | yes | - | index creation configuration, json format | -| mapping_settings | string | no | - | index mapping configuration, **does not contain field definitions**, json format | - -**Note**: The actual index construction method is `${table_id}_${date_format}_${current_index}` - -###### Parameters: specific parameter description of field_list - -| Key value | Type | Required | Default value | Description | -| ---- | --- | --- | --- | --- | -| field_name | string | yes | - | field name | -| field_type | string | yes | - | field type, can be float, string, boolean and timestamp | -| description | string | no | "" | field description information | -| tag | string | yes | - | field tag, can be metric, dimemsion, timestamp, group | -| alias_name | string | No | None | Inbound alias | -| option | string | No | {} | Field option configuration, key is option name, value is option configuration | -| is_config_by_user | bool | yes | true | whether the user enables this field configuration | - -The options currently available include: -| option name | type | description | -| -------------- | ------ | ----------- | -| es_type | string | es configuration: map the actual field type | -| es_include_in_all | bool | es configuration: whether to include into the _all field | -| es_format | string | es configuration: time format | -| es_doc_values ​​| bool | es configuration: dimension or not | -| es_index | string | es configuration: word segmentation, the value can be true or false | -| time_format | string | The time format of the data source for Transfer to parse and report the time | -| time_zone | int | Time zone configuration, for Transfer parsing and reporting time as UTC, value range [-12, +12] | - - -#### request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_data_id": 1001, - "table_id": "system.cpu_detail", - "table_name_en": "CPU records", - "is_custom_table": true, - "schema_type": "fixed", - "operator": "username", - "default_storage": "influxdb", - "default_storage_config": { - "storage": 1, - "source_duration_time": "30d" - }, - "field_list": [{ - "field_name": "usage", - "field_type": "double", - "description": "field description", - "tag": "metric", - "alias_name": "usage_alias", - "option": [], - "is_config_by_user": true - }], - "label": "OS", - "external_storage": { - "kafka": { - "expired_time": 1800000 - } - } -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| table_id | string | result table ID | - -#### Example results - -```json -{ - "message": "OK", - "code": 200, - "data": { - "table_id": "system.cpu_detail" - }, - "result": true, - "request_id": "408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_result_table_metric_split.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_result_table_metric_split.md deleted file mode 100644 index a180ba6a5..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_result_table_metric_split.md +++ /dev/null @@ -1,65 +0,0 @@ - - -### Function description - -Create a result table CMDB split task -According to the given data source ID, return the specific information of this result table - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| table_id | string | yes | result table ID | -| cmdb_level | string | yes | CMDB split level name | -| operator | string | Yes | operator | - - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "table_id": "system.cpu_summary", - "cmdb_level": "set", - "operator": "admin" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| bk_data_id | int | newly created data source ID | -| table_id | string | newly created result table ID | - - -#### Example results - -```json -{ - "message": "OK", - "code": 200, - "data": { - "bk_data_id": 1001, - "table_id": "system.cpu_summary_cmdb_level" - }, - "result": true, - "request_id": "408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_time_series_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_time_series_group.md deleted file mode 100644 index 3fc792025..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_create_time_series_group.md +++ /dev/null @@ -1,145 +0,0 @@ - - -### Function description - -Create a custom time series group ID -Given a data source and business, create an attributable custom time series group ID - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| bk_data_id | int | yes | data source id | -| bk_biz_id | int | yes | business id | -| time_series_group_name | string | yes | custom time series group name | -| label | string | Yes | Custom time series grouping label, used to represent monitoring objects, should reuse the label under the [result_table_label] type | -| operator | string | Yes | operator | -| metric_info_list | list | no | custom time series list | - -#### metric_info_list specific content description - -| Field | Type | Required | Description | -| ------------------- | ------ |-----| -------- | -| field_name | string | yes | custom sequence name | -| tag | list | Yes | dimension list | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_data_id": 123, - "bk_biz_id": 123, - "time_series_group_name": "Custom time series group name", - "label": "application", - "operator": "system", - "metric_info_list": [{ - "field_name": "usage for update", - "tag_list": ["dimension_name"] - },{ - "field_name": "usage for create", - "tag_list": ["dimension_name"] - }] -} -``` - -### Return result - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| time_series_group_id | int | New time series group ID | -| time_series_group_name | string | Time series group name | -| bk_data_id | int | data source id | -| bk_biz_id | int | business id | -| table_id | string | result table ID | -| label | string | event label | -| is_enable | bool | whether to enable | -| creator | string | Creator | -| create_time | string | creation time | -| last_modify_user | string | Last updated person | -| last_modify_time | string | Last update time | -| metric_info_list | list | custom time series list | - -#### data.metric_info_list specific content description - -| Field | Type | Description | -| ----------- | ------ | -------- | -| description | string | description | -| field_name | string | Field name | -| unit | string | unit | -| type | string | unit type | -| tag_list | list | tag list | - -#### data.metric_info_list.tag_list specific description - -| Field | Type | Description | -| ----------- | ------ | -------- | -| field_name | string | field name | -| description | string | description | -| unit | string | unit | -| type | string | unit type | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data": { - "bk_data_id": 123, - "bk_biz_id": 123, - "time_series_group_id": 1, - "time_series_group_name": "Time series custom time series group name", - "label": "application", - "is_enable": true, - "creator": "admin", - "create_time": "2019-10-10 10:10:10", - "last_modify_user": "admin", - "last_modify_time": "2020-10-10 10:10:10", - "metric_info_list": [{ - "field_name": "mem_usage", - "description": "mem_usage_2", - "unit": "M", - "type": "double", - "tag_list": [ - { - "field_name": "test_name", - "description": "test_name_2", - "unit": "M", - "type": "double", - } - ] - },{ - "field_name": "cpu_usage", - "description": "mem_usage_2", - "unit": "M", - "type": "double", - "tag_list": [ - { - "field_name": "test_name", - "description": "test_name_2", - "unit": "M", - "type": "double", - } - ] - }] - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_delete_event_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_delete_event_group.md deleted file mode 100644 index ee67f74cf..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_delete_event_group.md +++ /dev/null @@ -1,51 +0,0 @@ - - -### Function description - -delete an event group -Given an event group ID, delete it - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| event_group_id | int | yes | event group ID | -| operator | string | Yes | operator | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "event_group_id": 123, - "operator": "admin" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data": { }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_delete_time_series_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_delete_time_series_group.md deleted file mode 100644 index 25776b629..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_delete_time_series_group.md +++ /dev/null @@ -1,51 +0,0 @@ - - -### Function description - -Delete a custom timing group -Given a custom time series group ID, delete it - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| time_series_group_id | int | yes | custom time series group ID | -| operator | string | Yes | operator | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "time_series_group_id": 123, - "operator": "admin" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data": { }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_data_id.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_data_id.md deleted file mode 100644 index 404157c01..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_data_id.md +++ /dev/null @@ -1,103 +0,0 @@ - - -### Function description - -Query the ID of a data source -According to the given data source ID, return the specific information of this result table - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| bk_data_id | int | no | data source id | -| data_name | string | no | data source name | - -> Note: -> 1. One of the above two must be provided, and both cannot be empty at the same time; -> 2. When bk_data_id is provided, data_name is invalid - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_data_id": 1001 -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| bk_data_id | int | data source ID | -| data_name | string | data source name | -| data_description | string | data source description | -| mq_cluster_info | dict | message queue cluster information, the sample will have a specific description | -| etl_config | string | cleaning configuration name | -| is_custom_source | bool | Whether user-defined data source | -| creator | string | creator | -| create_time | string | Create time, the format is [2018-10-10 10:00:00]| -| last_modify_user | string | last modified by | -| last_modify_time | string | Last modification time [2018-10-10 10:00:00]| -| token | string | verification code for dataID | - -#### data.mq_cluster_info field description - -| Field | Type | Description | -| -------------- | ------ | ---------------------------------- | -| storage_config | dict | Storage cluster characteristics, the fields under each storage are inconsistent | -| cluster_config | dict | Stores cluster information | -| cluster_type | string | Storage cluster type | -| auth_info | dict | authentication information | - -#### Example results - -```json -{ - "message":"OK", - "code": 200, - "data":{ - "bk_data_id": 1001, - "data_name": "Base Data", - "data_description": "Base data data source", - "mq_cluster_info": { - "storage_config": { - "topic": "bk_monitor_1001", - "partition": 1, - }, - "cluster_config": { - "domain_name": "kafka.domain.cluster", - "port": 80, - }, - "cluster_type": "kafka" - }, - "etl_config": "base report", - "is_custom_source": false, - "creator": "username", - "create_time": "2018-10-10 10:10:10", - "last_modify_user": "username", - "last_modify_time": "2018-10-10 10:10:10", - "source_label": "bk_monitor_collector", - "type_label": "time_series", - "token": "5dc2353d913c45bea43dd8d931745a05" - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_event_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_event_group.md deleted file mode 100644 index 720b6f1b7..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_event_group.md +++ /dev/null @@ -1,103 +0,0 @@ - - -### Function description - -Query an event group ID -Given a data source and business, query specific information - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| event_group_id | int | yes | event group ID | -| with_result_table_info | bool | no | event grouping storage information | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "event_group_id": 123, - "with_result_table_info": true -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| bk_event_group_id | int | event group ID | -| bk_data_id | int | data source ID | -| bk_biz_id | int | Business ID | -| event_group_name | string | event group name | -| label | string | event label | -| is_enable | bool | whether to enable | -| creator | string | creator | -| create_time | string | creation time | -| last_modify_user | string | last modified by | -| last_modify_time | string | last modification time | -| event_info_list | array | event list | -| shipper_list | list | Result table configuration information | - -#### data.event_info_list specific content description - -| Field | Type | Description | -| ------------ | ------ | ---------------------- | -| bk_event_id | int | event ID | -| event_name | string | event name | -| dimension | list | dimension list, elements are dimension descriptions | - -#### Example results - -```json -{ - "message":"OK", - "code": 200, - "data": { - "event_group_id": 1001, - "bk_data_id": 123, - "bk_biz_id": 123, - "event_group_name": "Event group name", - "label": "application", - "is_enable": true, - "creator": "admin", - "create_time": "2019-10-10 10:10:10", - "last_modify_user": "admin", - "last_modify_time": "2020-10-10 10:10:10", - "event_info_list": [{ - "bk_event_id": 1, - "event_name": "usage for update", - "dimension_list": ["dimension_name"] - },{ - "bk_event_id": 2, - "event_name": "usage for create", - "dimension_list": ["dimension_name"] - }], - "shipper_list": [{ - "cluster_info": { - "domain_name": "es.service.consul", - "port": 8000 - }, - "cluster_type": "es" - }] - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_result_table.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_result_table.md deleted file mode 100644 index 69ef63f14..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_result_table.md +++ /dev/null @@ -1,99 +0,0 @@ - - -### Function description - -Query information about a result table -According to the given result table ID, return the specific information of the result table - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| table_id | string | yes | result table ID | - - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "table_id": "system.cpu" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| table_id | int | result table ID | -| table_name_zh | string | Chinese name of the result table | -| is_custom_table | bool | Whether to customize the result table | -| schema_type | string | Result table schema configuration scheme, free (no schema configuration), dynamic (dynamic schema), fixed (fixed schema) | -| default_storage | string | Default storage scheme | -| storage_list | list | All storage list, element is string | -| creator | string | creator | -| create_time | string | Create time, the format is [2018-10-10 10:00:00]| -| last_modify_user | string | last modified by | -| last_modify_time | string | Last modification time [2018-10-10 10:00:00]| -| field_list | list | field list | -| label | string | result table label | - -##### Data.field_list specific parameter description - -| key value | type | description | -| ----------------- | ------ | --------------------------------------------------- | -| field_name | string | field name | -| field_type | string | The field type, which can be float, string, boolean and timestamp | -| description | string | Field description information | -| tag | string | Field tag, can be metric, dimemsion, timestamp, group | -| alias_name | string | Inbound alias | -| option | string | Field option configuration, key is option name, value is option configuration | -| is_config_by_user | bool | Whether the user enables this field configuration | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data":{ - "table_id": "system.cpu", - "table_name_en": "Result table name", - "is_custom_table": false, - "scheme_type": "fixed", - "default_storage": "influxdb", - "storage_list": ["influxdb"], - "creator": "username", - "create_time": "2018-10-10 10:10:10", - "last_modify_user": "username", - "last_modify_time": "2018-10-10 10:10:10", - "field_list": [{ - "field_name": "usage", - "field_type": "float", - "tag": "dimension", - "description": "CPU usage", - "is_config_by_user": true - }], - "bk_biz_id": 0, - "label": "OS" - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_result_table_storage.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_result_table_storage.md deleted file mode 100644 index d9880f986..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_result_table_storage.md +++ /dev/null @@ -1,94 +0,0 @@ - - -### Function description - -Query the specified storage information of a result table -According to the given result table ID, return the specific storage cluster information of the result table - -### Request interface - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| result_table_list | string | yes | result table ID | -| storage_type | string | yes | storage type | - - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "result_table_list": "system.cpu", - "storage_type": "elasticsearch" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| table_id | int | result table ID | -| storage_info | list | storage cluster information | - -###### For storage_info, the content of each element is described as follows - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| storage_config | dict | Storage cluster characteristics, the fields under each storage are inconsistent | -| cluster_config | dict | Stores cluster information | -| cluster_type | string | Storage cluster type | -| auth_info | dict | authentication information | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data":{ - "system.cpu": { - "table_id": "system.cpu", - "storage_info": [{ - "storage_config": { - "index_datetime_format": "%Y%m%h", - "slice_size": 400, - "slice_gap": 120, - "retention": 30 - }, - "cluster_config": { - "domain_name": "service.consul", - "port": 1000, - "schema": "http", - "is_ssl_verify": false, - "cluster_id": 1, - "cluster_name": "default_es_storage" - }, - "cluster_type": "elasticsearch", - "auth_info": { - "username": "admin", - "password": "password" - } - }] - } - - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_time_series_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_time_series_group.md deleted file mode 100644 index 63c335c8f..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_get_time_series_group.md +++ /dev/null @@ -1,133 +0,0 @@ - - -### Function description - -Query a custom time series group ID -Given a data source and business, query specific information - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| time_series_group_id | int | yes | custom time series group ID | -| with_result_table_info | bool | no | custom time series group storage information | - - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "time_series_group_id": 123, - "with_result_table_info": true -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| bk_time_series_group_id | int | Custom time series group ID | -| bk_data_id | int | data source ID | -| bk_biz_id | int | Business ID | -| time_series_group_name | string | User-defined time series group name | -| label | string | Custom time series label | -| is_enable | bool | whether to enable | -| creator | string | creator | -| create_time | string | creation time | -| last_modify_user | string | last modified by | -| last_modify_time | string | last modification time | -| metric_info_list | list | Metric info list | -| shipper_list | dict | Result table configuration information | - -#### data.metric_info_list specific content description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| description | string | description | -| field_name | string | Field 名 | -| unit | string | unit | -| type | string | unit type | -| tag_list | list | tag list | - -#### data.metric_info_list.tag_list specific description - -| Field | Type | Description | -| ----------- | ------ | -------- | -| field_name | string | field name | -| description | string | description | -| unit | string | unit | -| type | string | unit type | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data": { - "time_series_group_id": 1001, - "bk_data_id": 123, - "bk_biz_id": 123, - "time_series_group_name": "Custom time series group name", - "label": "application", - "is_enable": true, - "creator": "admin", - "create_time": "2019-10-10 10:10:10", - "last_modify_user": "admin", - "last_modify_time": "2020-10-10 10:10:10", - "metric_info_list": [{ - "field_name": "mem_usage", - "description": "mem_usage_2", - "unit": "M", - "type": "double", - "tag_list": [ - { - "field_name": "test_name", - "description": "test_name_2", - "unit": "M", - "type": "double", - } - ] - },{ - "field_name": "cpu_usage", - "description": "mem_usage_2", - "unit": "M", - "type": "double", - "tag_list": [ - { - "field_name": "test_name", - "description": "test_name_2", - "unit": "M", - "type": "double", - } - ] - }], - "shipper_list": [{ - "cluster_info": { - "domain_name": "es.service.consul", - "port": 8000 - }, - "cluster_type": "es" - }] - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_label.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_label.md deleted file mode 100644 index df3e86140..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_label.md +++ /dev/null @@ -1,98 +0,0 @@ - - -### Function description - -Get data labels -According to the parameters of the request, each request data tag is returned, including the data source tag and the result table tags at all levels - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| label_type | string | yes | label classification, `source_label`, `type_label` or `result_table_label` | -| level | int | yes | label level, the level starts from 1, this configuration only takes effect when `label_type` is `result_table` | -| include_admin_only | bool | yes | whether to show admin visible labels | - - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "include_admin_only": True, - "level": 1, - "label_type": "source_label" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| label_id | string | Label ID (English name) -| label_name | string | Label name (Chinese name) | -| label_type | string | Label classification | -| level | int | Label level | -| parent_label | string | Parent label ID | -| index | int | Sort order of tags at the same level | - - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data": { - "source_label": [{ - "label_id": "bk_monitor_collector", - "label_name": "Blue Whale Monitoring Collector", - "label_type": "source_label", - "level": null, - "parent_label": null, - "index": 0 - }], - "type_label": [{ - "label_id": "time_series", - "label_name": "Time Series Data", - "label_type": "type_label", - "level": null, - "parent_label": null, - "index": 0 - }], - "result_table_label": [{ - "label_id": "OS", - "label_name": "operating system", - "label_type": "result_table_label", - "level": 2, - "parent_label": "host", - "index": 0 - }, { - "label_id": "host", - "label_name": "Host", - "label_type": "result_table_label", - "level": 1, - "parent_label": null, - "index": 1 - }] - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_result_table.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_result_table.md deleted file mode 100644 index 02121414f..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_result_table.md +++ /dev/null @@ -1,105 +0,0 @@ - - -### Function description - -get storage list -According to the given filter parameters (no currently available), return a list of result tables that meet the conditions - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters -No request parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| datasource_type | string | No | The result table type to be filtered, such as system | -| bk_biz_id | int | No | Get the result table information under the specified business | -| is_public_include | int | No | Whether to include the full business result table, 0 means not included, non-0 means include the full business result table | -| is_config_by_user | bool | no | whether to include non-user-config result table content | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_id": 123, - "is_public_include": 1, - "datasource_type": "system" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| result_table_id | int | result table ID | -| table_name_zh | string | Chinese name of the result table | -| is_custom_table | bool | Whether to customize the result table | -| schema_type | string | Result table schema configuration scheme, free (no schema configuration), dynamic (dynamic schema), fixed (fixed schema) | -| default_storage | string | Default storage scheme | -| storage_list | array | All storage list, element is string | -| creator | string | creator | -| create_time | string | Create time, the format is [2018-10-10 10:00:00]| -| last_modify_user | string | last modified by | -| last_modify_time | string | Last modification time [2018-10-10 10:00:00]| -| field_list | list | field list | - -##### Data.field_list specific parameter description - -| key value | type | description | -| ----------------- | ------ | --------------------------------------------------- | -| field_name | string | field name | -| field_type | string | The field type, which can be float, string, boolean and timestamp | -| description | string | Field description information | -| tag | string | Field tag, can be metric, dimemsion, timestamp, group | -| alias_name | string | Inbound alias | -| option | string | Field option configuration, key is option name, value is option configuration | -| is_config_by_user | bool | Whether the user enables this field configuration | -| unit | string | field unit | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data":[{ - "table_id": "system.cpu", - "table_name_en": "Result table name", - "is_custom_table": false, - "scheme_type": "fixed", - "default_storage": "influxdb", - "storage_list": ["influxdb"], - "creator": "username", - "create_time": "2018-10-10 10:10:10", - "last_modify_user": "username", - "last_modify_time": "2018-10-10 10:10:10", - "field_list": [{ - "field_name": "usage", - "field_type": "float", - "tag": "dimension", - "description": "CPU usage", - "is_config_by_user": true, - "unit": "Field Unit" - }], - "bk_biz_id": 0, - "label": "OS" - }], - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_transfer_cluster.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_transfer_cluster.md deleted file mode 100644 index a0a67bc35..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_list_transfer_cluster.md +++ /dev/null @@ -1,56 +0,0 @@ -### Function description - -Get all transfer cluster information - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -No request parameters - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ---------- | ------ | -------------- | -| cluster_id | string | transfer cluster ID | - -#### Example results - -```json -{ - "message": "OK", - "code": 200, - "data": [ - { - "cluster_id": "default" - }, - { - "cluster_id": "bkmonitorv3-na" - } - ], - "result": true, - "request_id": "408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_cluster_info.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_cluster_info.md deleted file mode 100644 index 080474ac6..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_cluster_info.md +++ /dev/null @@ -1,105 +0,0 @@ - - -### Function description - -Query Storage Cluster Configuration -Create a storage cluster configuration based on the given configuration parameters - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| cluster_id | int | yes | cluster id | -| cluster_name | string | yes | storage cluster name | -| operator | string | Yes | modified by | -| description | string | No | Storage cluster description information | -| auth_info | dict | no | cluster username | -| custom_label | string | no | custom label | -| schema | string | No | Forcibly configure schema, which can be used to configure https and other situations | -| is_ssl_verify | bool | no | whether to skip SSL\TLS verification | - -**Note**: Whether the above information can be modified mainly depends on whether the modification parameters will cause the loss of historical data; for example, modifying domain_name requires operation and maintenance intervention, and modification here is not supported - -#### Auth_info description -```json -{ - "username": "username", - "password": "password" -} -``` - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "cluster_id": 1, - "cluster_name": "first_influxdb", - "operator": "admin" -} -``` - -**Note**: The request can provide `cluster_id` or `cluster_name` to locate the cluster information that needs to be modified; but the two are mutually exclusive, and `cluster_id` is preferred - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| cluster_config | dict | cluster information | -| cluster_type | string | cluster type | -| auth_info | dict | cluster username | - -#### Cluster_config details - -| Parameters | Type | Description | -| ------------- | ------ | ----------------- | -| domain_name | string | Cluster domain name | -| port | int | port | -| schema | string | access protocol | -| is_ssl_verify | bool | Is SSL verification strong | -| cluster_id | int | cluster ID | -| cluster_name | string | cluster name | -| version | string | Storage cluster version | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data": [{ - "cluster_config": { - "domain_name": "service.consul", - "port": 9052, - "schema": "https", - "is_ssl_verify": true, - "cluster_id": 1, - "cluster_name": "default_influx", - "version": "" - }, - "cluster_type": "influxDB", - "auth_info": { - "password": "", - "username": "" - } - }], - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_data_id.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_data_id.md deleted file mode 100644 index 81e5eabac..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_data_id.md +++ /dev/null @@ -1,101 +0,0 @@ - - -### Function description - -Modify the data source name - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| data_name | string | no | data source name | -| data_id | int | yes | data source id | -| operator | string | Yes | operator | -| data_description | string | no | data source description | -| option | string | No | Data source configuration option content, the format is {`option_name`: `option_value`} | -| is_enable | bool | no | whether the data source is enabled | - - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "operator": "adminn", - "data_id": 123, - "data_name": "basereport", -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| bk_data_id | int | result table ID | -| data_id | int | result table ID | -| mq_config | dict | message queue cluster information | -| etl_config | string | clean configuration | -| result_table_list | list | result information table | -| option | dict | Contents of data source configuration options | -| type_label | string | data type label | -| source_label | string | Data source label | -| token | string | Report verification token | -| transfer_cluster_id | string | transfer cluster id | - -#### Data.mq_config field description - -| Field | Type | Description | -| -------------- | ------ | ---------------------------------- | -| storage_config | dict | Storage cluster characteristics, the fields under each storage are inconsistent | -| cluster_config | dict | Stores cluster information | -| cluster_type | string | Storage cluster type | -| auth_info | dict | authentication information | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data":{ - "bk_data_id": 1001, - "data_id": 1001, - "mq_config": { - "storage_config": { - "topic": "bk_monitor_1001", - "partition": 1, - }, - "cluster_config": { - "domain_name": "kafka.domain.cluster", - "port": 80, - }, - "cluster_type": "kafka" - }, - 'etl_config': '', - 'result_table_list': [], - 'option': {}, - 'type_label': 'time_series', - 'source_label': 'bk_monitor', - 'token': 'xxxxxx', - 'transfer_cluster_id': 'default' - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_event_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_event_group.md deleted file mode 100644 index 7e15b4392..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_event_group.md +++ /dev/null @@ -1,116 +0,0 @@ - - -### Function description - -Modify an event group ID -Given an event group ID, modify some specific information - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| event_group_id | int | yes | event group id | -| event_group_name | string | no | event group name | -| label | string | No | The event grouping label, used to represent the event monitoring object, should reuse the label under the [result_table_label] type | -| operator | string | Yes | operator | -| event_info_list | list | no | event list | -| is_enable | bool | no | whether to disable the event group | - -#### Event_info_list specific description - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | -------- | -| event_name | string | yes | event name | -| dimension | list | Yes | dimension list | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "event_group_id": 123, - "event_group_name": "event_group_name", - "label": "application", - "operator": "system", - "is_enable": true, - "event_info_list": [{ - "event_name": "usage for update", - "dimension_list": ["dimension_name"] - },{ - "event_name": "usage for create", - "dimension_list": ["dimension_name"] - }] -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ----------------- | ------ | ------------ | -| event_group_id | int | event group ID | -| bk_data_id | int | data source ID | -| bk_biz_id | int | Business ID | -| event_group_name | string | event group name | -| label | string | event label | -| is_enable | bool | whether to enable | -| creator | string | creator | -| create_time | string | creation time | -| last_modify_user | string | last modified by | -| last_modify_time | string | last modification time | -| event_info_list | list | event list | - -#### Event_info_list specific content description - -| Field | Type | Description | -| ------------ | ------ | -------- | -| bk_event_id | int | event ID | -| event_name | string | event name | -| dimension | list | dimension list | - -#### Event_info_list.dimension specific content description - -| Field | Type | Description | -| ----------------- | ------ | ---------- | -| dimension_name | string | dimension name | -| dimension_ch_name | string | Chinese name of the dimension | - - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data": { - "event_group_id": 1001, - "bk_data_id": 123, - "bk_biz_id": 123, - "label": "application", - "description": "use for what?", - "is_enable": true, - "creator": "admin", - "create_time": "2019-10-10 10:10:10", - "last_modify_user": "admin", - "last_modify_time": "2020-10-10 10:10:10", - "event_info_list": [] - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_result_table.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_result_table.md deleted file mode 100644 index 9d0dfdd54..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_result_table.md +++ /dev/null @@ -1,164 +0,0 @@ -### Function description - -Modify the configuration of a result table -According to the given data source ID, return the specific information of this result table - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| table_id | string | yes | result table ID | -| operator | string | Yes | operator | -| field_list | list | no | full field list | -| table_name_zh | string | No | Chinese name of the result table | -| default_storage | string | no | result table default storage type | -| label | string | Yes | The label of the result table, the secondary label is recorded here, and the corresponding primary label will be derived from the secondary label | -| is_time_field_only | bool | No | Whether the default field only needs time, the default is False, this field only takes effect when the field_list parameter is not empty | -| external_storage | dict | No | Additional storage configuration, the format is {${storage_type}: ${storage_config}}, storage_type can be kafka, influxdb, redis; storage_config is the same as default_storage_config | -| is_enable | bool | no | whether to enable the result table | - - -**Note**: The above `label` should be obtained through the `metadata_get_label` interface, and should not be created by yourself - -###### Parameters: default_storage_config and storage_config -- parameters supported under influxdb -| Key value | Type | Required | Default value | Description | -| ---- | --- | --- | --- | --- | -| source_duration_time | string | No | 30d | Metadata save time, it needs to conform to influxdb format | - -###### Parameters: default_storage_config and storage_config -- parameters supported under kafka -| Key value | Type | Required | Default value | Description | -| ---- | --- | --- | --- | --- | -| partition | int | No | 1 | Stores the number of partitions. Note: This is just a record. If it is a configuration with more than one topic, it needs to be expanded manually through the kafka command line tool | -| retention | int | no | 1800000 | Kafka data retention time, the default is half an hour, in ms | - -###### Parameters: default_storage_config and storage_config -- parameters supported under redis - -| Key value | Type | Required | Default value | Description | -| ---- | --- | --- | --- | --- | -| is_sentinel | bool | no | False | whether sentinel mode | -| master_name | string | no | "" | master name in sentinel mode | - -**Note**: Since redis uses the queue method by default, it is discarded after consumption, so there is no time length configuration - -###### Parameters: default_storage_config and storage_config -- parameters supported under elasticsearch -| Key value | Type | Required | Default value | Description | -| ---- | --- | --- | --- | --- | -| retention | int | no | 30 | index retention time, in days, the default is 30 days | -| slice_size | int | No | 500 | The size threshold to be sliced, the unit is GB, the default is 500GB | -| slice_gap | int | no | 120 | index slice interval, in minutes, default 2 hours | -| index_settings | string | yes | - | index creation configuration, json format | -| mapping_settings | string | no | - | index mapping configuration, **does not contain field definitions**, json format | -| alias_name | string | No | None | Inbound alias | -| option | string | No | {} | Field option configuration, key is option name, value is option configuration | - -**Note**: Whether the above information can be modified mainly depends on whether the modified parameters will cause the loss of historical data - -| Key value | Type | Required | Default value | Description | -| ---- | --- | --- | --- | --- | -| filed_name | string | yes | - | field name | -| field_type | string | yes | - | field type | -| description | string | no | "" | field description | -| tag | string | Yes | - | field type, can be metric or dimension | -| alias_name | string | No | "" | Field alias, which can be changed to this alias when entering the library | -| option | list | no | [] | field configuration options | -| is_config_by_user | bool | no | true | whether to enable | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "table_id": "system.cpu", - "operator": "username", - "field_list": [{ - "filed_name": "usage", - "field_type": "double", - "description": "field description", - "tag": "metric", - "alias_name": "usage_alias", - "option": [], - "is_config_by_user": true - }], - "label": "OS", - "table_name_en": "CPU performance data", - "default_storage": "influxdb" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| table_id | int | result table ID | -| table _name_zh | string | Chinese name of the result table | -| is_custom_table | boolean | Whether to customize the result table | -| schema_type | string | Result table schema configuration scheme, free (no schema configuration), dynamic (dynamic schema), fixed (fixed schema) | -| default_storage | string | Default storage scheme | -| storage_list | list | All storage list, element is string | -| creator | string | creator | -| create_time | string | Create time, the format is [2018-10-10 10:00:00]| -| last_modify_user | string | last modified by | -| last_modify_time | string | Last modification time [2018-10-10 10:00:00]| -| label | string | result table label | -| field_list | list | field list | - -#### Data.field_list field description - -| key value | type | description | -| ----------------- | ------ | --------------------------------------------------- | -| field_name | string | field name | -| field_type | string | The field type, which can be float, string, boolean and timestamp | -| description | string | Field description information | -| tag | string | Field tag, can be metric, dimemsion, timestamp, group | -| alias_name | string | Inbound alias | -| option | string | Field option configuration, key is option name, value is option configuration | -| is_config_by_user | bool | Whether the user enables this field configuration | -| unit | string | field unit | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data":{ - "table_id": "system.cpu", - "table_name_en": "Result table name", - "is_custom_table": false, - "scheme_type": "fixed", - "default_storage": "influxdb", - "storage_list": ["influxdb"], - "creator": "username", - "create_time": "2018-10-10 10:10:10", - "last_modify_user": "username", - "last_modify_time": "2018-10-10 10:10:10", - "field_list": [{ - "field_name": "usage", - "field_type": "float", - "tag": "dimension", - "description": "CPU usage", - "is_config_by_user": true, - "unit": "Field Unit" - }], - "label": "OS" - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_time_series_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_time_series_group.md deleted file mode 100644 index 7ed0378f7..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_modify_time_series_group.md +++ /dev/null @@ -1,156 +0,0 @@ - - -### Function description - -Modify a custom timing group ID -Given a custom timing group ID, modify some specific information - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| time_series_group_id | int | yes | custom time series group ID | -| time_series_group_name | string | yes | custom time series group name | -| label | string | No | The event grouping label, used to represent the custom timing monitoring object, should reuse the label under the [result_table_label] type | -| operator | string | no | operator | -| metric_info_list | bool | no | custom timing list | -| is_enable | bool | no | whether to disable custom timing group | -| field_list | list | no | field list | - -##### Field_list specific parameter description - -| Key value | Type | Required or not | Default value | Description | -| ----------------- | ------ | -------- | ------ | --------------------------------------------------- | -| field_name | string | yes | - | field name | -| field_type | string | yes | - | field type, can be float, string, boolean and timestamp | -| description | string | no | "" | field description information | -| tag | string | yes | - | field tag, can be metric, dimemsion, timestamp, group | -| alias_name | string | No | None | Inbound alias | -| option | string | No | {} | Field option configuration, key is option name, value is option configuration | -| is_config_by_user | bool | yes | true | whether the user enables this field configuration | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "time_series_group_id": 123, - "time_series_group_name": "Custom Time Series Development", - "operator": "system", - "description": "what the group use for.", - "is_enable": true, - "field_list": [{ - "filed_name": "usage", - "field_type": "double", - "description": "field description", - "tag": "metric", - "alias_name": "usage_alias", - "option": [], - "is_config_by_user": true - }] -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ---------------------- | ------ | ---------------- | -| time_series_group_id | int | New time series group ID | -| time_series_group_name | string | Time series group name | -| bk_data_id | int | data source id | -| bk_biz_id | int | business id | -| table_id | string | result table ID | -| label | string | event label | -| is_enable | bool | whether to enable | -| creator | string | Creator | -| create_time | string | creation time | -| last_modify_user | string | Last updated person | -| last_modify_time | string | Last update time | -| metric_info_list | list | Custom time series list | - -#### metric_info_list specific content description - -| Field | Type | Description | -| ----------- | ------ | -------- | -| field_name | string | field name | -| description | string | field description | -| unit | string | unit | -| type | string | field type | -| tag_list | list | list of dimensions | - -#### metric_info_list.tag_list specific content description - -| Field | Type | Description | -| ----------- | ------ | -------- | -| field_name | string | field name | -| description | string | field description | -| unit | string | unit | -| type | string | field type | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data": [{ - 'time_series_group_id': 1, - 'time_series_group_name': 'bkunifylogbeat common metrics', - 'bk_data_id': 1100006, - 'bk_biz_id': 0, - 'table_id': 'bkunifylogbeat_common.base', - 'label': 'service_process', - 'is_enable': True, - 'creator': 'system', - 'create_time': '2021-12-07 03:29:51', - 'last_modify_user': 'system', - 'last_modify_time': '2021-12-07 03:29:51', - "metric_info_list": [{ - "field_name": "mem_usage", - "description": "mem_usage_2", - "unit": "M", - "type": "double", - "tag_list": [ - { - "field_name": "test_name", - "description": "test_name_2", - "unit": "M", - "type": "double", - } - ] - },{ - "field_name": "cpu_usage", - "description": "mem_usage_2", - "unit": "M", - "type": "double", - "tag_list": [ - { - "field_name": "test_name", - "description": "test_name_2", - "unit": "M", - "type": "double", - } - ] - }] - }], - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` - diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_event_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_event_group.md deleted file mode 100644 index ec40ee9cc..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_event_group.md +++ /dev/null @@ -1,108 +0,0 @@ - - -### Function description - -Batch query event grouping information - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| label | string | no | event grouping label (monitoring object) | -| event_group_name | string | no | event group name | -| bk_biz_id | int | no | business ID | - - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "label": "application", - "event_group_name": "Event group name", - "bk_biz_id": 123 -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | list | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| event_group_id | int | event group ID | -| bk\_data_id | int | data source ID | -| bk\_biz_id | int | Business ID | -| event\_group_name | string | event group name | -| label | string | event label | -| is_enable | bool | whether to enable | -| creator | string | creator | -| create_time | string | creation time | -| last_modify_user | string | last modified by | -| last_modify_time | string | last modification time | -| event_info_list | list | event list | - -#### data.event_info_list specific content description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| bk\_event_id | int | event ID | -| event_name | string | event name | -| dimension | list | dimension list | - -#### data.event_info_list.dimension specific content description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| dimension_name | string | dimension name | -| dimension_ch_name | string | Chinese name of the dimension | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data": [{ - "event_group_id": 1001, - "bk_data_id": 123, - "bk_biz_id": 123, - "event_group_name": "Event group name", - "label": "application", - "is_enable": true, - "creator": "admin", - "create_time": "2019-10-10 10:10:10", - "last_modify_user": "admin", - "last_modify_time": "2020-10-10 10:10:10", - "event_info_list": [{ - "bk_event_id": 1, - "event_name": "usage for update", - "dimension_list": [{ - "dimension_name": "field_name" - }] - },{ - "bk_event_id": 2, - "event_name": "usage for create", - "dimension_list": [{ - "dimension_name": "field_name" - }] - }] - }], - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_tag_values.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_tag_values.md deleted file mode 100644 index 7e6a43e0c..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_tag_values.md +++ /dev/null @@ -1,59 +0,0 @@ - - -### Function description - -Query the data source to specify the optional value of the specified tag/dimension - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| table_id | string | yes | result table ID | -| tag_name | string | yes | tag/dimension field name | - - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "table_id": "2_bkmonitor_time_series_1500514.base", - "tag_name": "target" -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| tag_values ​​| list | value of tag/dimension | - -#### Example results - -```json -{ - "message":"OK", - "code": 200, - "data": { - "tag_values": ["target1", "target2"] - }, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_time_series_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_time_series_group.md deleted file mode 100644 index 89cf620ba..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_query_time_series_group.md +++ /dev/null @@ -1,129 +0,0 @@ - - -### Function description - -Batch query custom time series grouping information - -### request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| label | string | No | Custom time series grouping label (monitoring object) | -| time_series_group_name | string | no | custom time series group name | -| bk_biz_id | int | no | business ID | - - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "label": "application", - "time_series_group_name": "Custom time series group name", - "bk_biz_id": 123 -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | list | data | -| request_id | string | Request ID | - -#### Data field description - -| Field | Type | Description | -| ---------------------- | ------ | ---------------- | -| time_series_group_id | int | New time series group ID | -| time_series_group_name | string | Time series group name | -| bk_data_id | int | data source id | -| bk_biz_id | int | business id | -| table_id | string | result table ID | -| label | string | event label | -| is_enable | bool | whether to enable | -| creator | string | Creator | -| create_time | string | creation time | -| last_modify_user | string | Last updated person | -| last_modify_time | string | Last update time | -| metric_info_list | list | Custom time series list | - -#### metric_info_list specific content description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| field_name | string | field name | -| description | string | field description | -| unit | string | unit | -| type | string | field type | -| tag_list | list | list of dimensions | - -#### metric_info_list.tag_list specific content description - -| Field | Type | Description | -| ------------------- | ------ | -------- | -| field_name | string | field name | -| description | string | field description | -| unit | string | unit | -| type | string | field type | - -#### Example results - -```json -{ - "message":"OK", - "code":200, - "data": [{ - 'time_series_group_id': 1, - 'time_series_group_name': 'bkunifylogbeat common metrics', - 'bk_data_id': 1100006, - 'bk_biz_id': 0, - 'table_id': 'bkunifylogbeat_common.base', - 'label': 'service_process', - 'is_enable': True, - 'creator': 'system', - 'create_time': '2021-12-07 03:29:51', - 'last_modify_user': 'system', - 'last_modify_time': '2021-12-07 03:29:51', - "metric_info_list": [{ - "field_name": "mem_usage", - "description": "mem_usage_2", - "unit": "M", - "type": "double", - "tag_list": [ - { - "field_name": "test_name", - "description": "test_name_2", - "unit": "M", - "type": "double", - } - ] - },{ - "field_name": "cpu_usage", - "description": "mem_usage_2", - "unit": "M", - "type": "double", - "tag_list": [ - { - "field_name": "test_name", - "description": "test_name_2", - "unit": "M", - "type": "double", - } - ] - }] - }], - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` - diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_upgrade_result_table.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_upgrade_result_table.md deleted file mode 100644 index e0f2e28a1..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/metadata_upgrade_result_table.md +++ /dev/null @@ -1,48 +0,0 @@ -### Function description - -Modify a single business result table to upgrade it to a full business result table - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------------- | ------ | ---- | ----------- | -| table_id_list | list | yes | result table ID list | -| operator | string | Yes | operator | - -#### Request example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "operator": "admin", - "table_id_list": ["2_system.cpu", "3_system.cpu"], -} -``` - -### Return result - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | null | data | -| request_id | string | Request ID | - -#### Example results - -```json -{ - "message":"OK", - "code": 200, - "data": null, - "result":true, - "request_id":"408233306947415bb1772a86b9536867" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/save_alarm_strategy.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/save_alarm_strategy.md deleted file mode 100644 index fc7a5810a..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/save_alarm_strategy.md +++ /dev/null @@ -1,303 +0,0 @@ -### Function description - -Save Alert Strategy - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| :---------- | ------ | ---- | ---------------- | -| action_list | list | yes | action list (Action) | -| bk_biz_id | int | yes | business id | -| item_list | list | yes | monitor item(item) | -| name | string | yes | policy name | -| scenario | string | yes | monitoring object | -| is_enabled | string | No | Whether it is enabled, it is enabled by default| - -#### action_list - -Action currently has only notification type. When creating a policy, if the ID of the notification group is passed in, the notification group will be used. - -| Field | Type | Required | Description | -| --------------------------------- | ------ | ---- | ----------------------- | -| action_type | string | yes | action type (notice) | -| config | dict | yes | action config | -| config.alarm_end_time | string | yes | notification period | -| config.alarm_start_time | string | yes | notification time period | -| config.send_recovery_alarm | bool | yes | whether to send recovery | -| config.alarm_interval | int | yes | notification interval | -| notice_template | dict | no | notification configuration | -| notice_template.anomaly_template | string | no | exception notification template | -| notice_template.recovery_template | string | no | recovery notice template | -| notice_group_list | list | yes | notice group list (NoticeGroup) | - -#### action_list.notice_group_list - -Can use an existing notification group - -1. If there is an id, the notification group corresponding to the id is used, and the incoming notification group configuration will update the notification group. -2. If there is no id, create a new notification group based on the incoming field. - -| Field | Type | Required | Description | -| --------------- | ------ | ---- | -------------------------------------------------- | -| notice_receiver | list | no | recipients | -| name | string | no | notification group name | -| notice_way | dict | No | The notification method, the alarm level is key, and the value is a list of notification methods | -| message | string | No | Remarks | -| id | int | no | notification group id | - -#### item_list - -| Field | Type | Required | Description | -| ------------------------- | ------ | ---- | --------------------------- | -| rt_query_config | dict | yes | metric query configuration (RtQueryConfig) | -| metric_id | string | yes | metric | -| name | string | yes | item name | -| data_source_label | string | yes | data source | -| algorithm_list | list | yes | algorithm configuration list (Algorithm) | -| no_data_config | dict | yes | no data config | -| no_data_config.is_enabled | bool | yes | whether to enable no data alarm | -| no_data_config.continous | int | no | No data alarm detection cycle number | -| data_type_label | string | yes | data type | -| target | list | yes | monitoring target | - -#### item_list.rt_query_config - -| Field | Type | Required | Description | -| --------------- | ------ | ---- | -------- | -| metric_field | string | yes | metric name | -| unit_conversion | int | yes | unit conversion | -| unit | string | Yes | unit | -| extend_fields | string | no | additional fields | -| agg_condition | list | yes | query condition | -| agg_interval | int | yes | aggregation period | -| agg_dimension | list | yes | query dimension | -| agg_method | string | yes | aggregation method | -| result_table_id | string | yes | result table id | - -#### item_list.algorithm_list - -| Field | Type | Required | Description | -| ---------------------------- | ------ | ---- | -------------- | -| algorithm_config | list | yes | algorithm configuration list | -| level | int | yes | alarm level | -| trigger_config | dict | yes | trigger condition | -| trigger_config.count | int | yes | trigger threshold | -| trigger_config.check_window | int | yes | number of trigger check windows | -| algorithm_type | string | yes | algorithm type | -| recovery_config | dict | yes | recovery_config | -| recovery_config.check_window | int | yes | number of recovery cycles | -| message_template | string | No | | - -#### item_list.target field description - -| Field | Type | Required | Description | -| ------ | ------ | ---- | -------------- | -| field | string | yes | monitoring target type | -| value | dict | yes | monitoring target data item | -| method | string | yes | monitoring target method | - -field - a combination based on target node type and target object type -host_target_ip -host_ip -host_topo -service_topo -service_service_template -service_set_template -host_service_template -host_set_template - -#### item_list.target.value field description - -| Field | Type | Required | Description | -| ----------- | ------ | ---- | -------- | -| ip | string | Yes | target ip | -| bk_cloud_id | string | yes | cloud zone id | - -#### Algorithm configuration - -##### Static Threshold - -The static threshold can be configured more than one at a time, so it is a list structure - -```json -[ - { - "method": "gt", // gt,gte,lt,lte,eq,neq - "threshold": 1 - } -] -``` - -##### Simple chain ratio - -```json -{ - "floor": 1, - "ceil": 1 -} -``` - -##### Simple comparison - -```json -{ - "floor": 1, - "ceil": 1 -} -``` - -##### Advanced chain ratio - -```json -{ - "floor": 1, - "ceil": 1, - "floor_interval": 1, - "ceil_interval": 1 -} -``` - -##### Premium YoY - -```json -{ - "floor": 1, - "ceil": 1, - "floor_interval": 1, - "ceil_interval": 1 -} -``` - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_id":2, - "item_list":[ - { - "rt_query_config":{ - "metric_field":"idle", - "agg_dimension":["ip", "bk_cloud_id"], - "unit_conversion":1.0, - "extend_fields":"", - "agg_method":"AVG", - "agg_condition":[], - "agg_interval":60, - "result_table_id":"system.cpu_detail", - "unit":"%" - }, - "metric_id":"bk_monitor.system.cpu_detail.idle", - "name":"\u7a7a\u95f2\u7387", - "data_source_label":"bk_monitor", - "algorithm_list":[ - { - "algorithm_config":[[ - { - "threshold":0.1, - "method":"gte" - } - ]], - "level":1, - "trigger_config":{ - "count":1, - "check_window":5 - }, - "algorithm_type":"Threshold", - "recovery_config":{ - "check_window":5 - }, - "message_template":"" - } - ], - "no_data_config":{ - "is_enabled":false, - "continuous":5 - }, - "data_type_label":"time_series", - "name":"\u7a7a\u95f2\u7387", - "target":[ - [ - { - "field":"bk_target_ip", - "method":"eq", - "value":[ - { - "ip":"127.0.0.1", - "bk_cloud_id":0 - } - ] - } - ] - ] - } - ], - "scenario":"os", - "action_list":[ - { - "notice_template":{ - "anomaly_template":"aa", - "recovery_template":"" - }, - "notice_group_list":[ - { - "notice_receiver":[ - "user#test" - ], - "name":"test", - "notice_way":{ - "1":["weixin"], - "3":["weixin"], - "2":["weixin"] - }, - "message":"", - "notice_group_name":"test", - "id":1 - } - ], - "action_type":"notice", - "config":{ - "alarm_end_time":"23:59:59", - "send_recovery_alarm":false, - "alarm_start_time":"00:00:00", - "alarm_interval":120 - } - } - ], - "name":"test" -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | - -#### Data field description - -| Field | Type | Description | -| ----------- | ---- | ------ | -| strategy_id | int | strategy id | - -#### Sample data - -```json -{ - "result": true, - "code": 200, - "data": { - "strategy_id": 1 - }, - "message": "" -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/save_alarm_strategy_v2.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/save_alarm_strategy_v2.md deleted file mode 100644 index a3d208ce9..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/save_alarm_strategy_v2.md +++ /dev/null @@ -1,483 +0,0 @@ -### Function description - -Save Alert Policy - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters -| Field | Type | Required | Description | -| :--------- | ------- | ---- | -------------------- | -| actions | list | yes | action list (Action) | -| bk_biz_id | int | yes | business id | -| detects | list | Yes | Detect configuration list (Detect) | -| id | int | no | policy id | -| items | list | yes | item list (Item) | -| labels | list | yes | list of policy labels | -| name | string | yes | policy name | -| scenario | string | yes | monitoring object | -| source | string | yes | monitoring source | -| is_enabled | bool | No | Whether to enable, default enabled | - -#### actions - -| Field | Type | Required | Description | -| --------------------------------- | ------ | ---- | ---------------- | -| id | int | Yes | action id | -| type | string | yes | action type (notice) | -| config | dict | yes | action config | -| config.alarm_end_time | string | yes | notification period | -| config.alarm_start_time | string | yes | notification time period | -| config.send_recovery_alarm | bool | yes | whether to send recovery | -| config.alarm_interval | int | yes | notification interval | -| notice_template | dict | no | notification configuration | -| notice_template.anomaly_template | string | no | exception notification template | -| notice_template.recovery_template | string | no | recovery notice template | -| notice_group_ids | list | yes | list of notice group IDs | - -#### detects - -| Field | Type | Required | Description | -| ---------------------------- | ------ | ---- | ---------------- | -| id | int | yes | detection id | -| level | int | yes | alarm level | -| expression | string | yes | calculation formula | -| trigger_config | dict | yes | trigger condition configuration | -| trigger_config.count | int | yes | number of triggers | -| trigger_config.check_window | int | yes | trigger period | -| recovery_config | dict | yes | recovery condition config | -| recovery_config.check_window | int | yes | recovery period | -| connector | string | yes | same-level algorithm connector | - -#### items - -| Field | Type | Required | Description | -| ---------------------------- | ------ | ---- | ------------------------- | -| query_configs | list | yes | metrics query configuration (QueryConfig) | -| id | string | yes | monitoring item configuration id | -| name | string | yes | item name | -| expression | string | yes | calculation formula | -| origin_sql | string | yes | origin sql | -| algorithms | list | yes | algorithm configuration list (Algorithm) | -| no_data_config | dict | yes | no data config | -| no_data_config.is_enabled | bool | yes | whether to enable no data alarm | -| no_data_config.continuous | int | no | No data alarm detection cycle number | -| target | list | yes | monitoring target | - -#### iterms.target - -| Field | Type | Required | Description | -| ---------------------------- | ------ | ---- | ----------------------- | -| field | string | yes | monitoring target type | -| value | dict | yes | monitoring target data item | -| method | string | yes | monitoring target method | - -field - a combination based on target node type and target object type -host_target_ip -host_ip -host_topo -service_topo -service_service_template -service_set_template -host_service_template -host_set_template - -#### items.target.value - -| Field | Type | Required | Description | -| ----------- | ------ | ---- | -------- | -| ip | string | Yes | target ip | -| bk_cloud_id | string | yes | cloud zone id | - -```json -{ - "target": [ - [ - { - "field": "host_topo_node", - "method": "eq", - "value": [ - { - "bk_inst_id": 7, - "bk_obj_id": "biz" - } - ] - } - ] - ] -} -``` - -#### queryconfigs - -| Field | Type | Required | Description | -| ----------------- | ------ | ---- | ------------ | -| alias | string | Yes | alias | -| data_source_label | string | yes | data source label | -| data_type_label | string | yes | data type label | - -##### BkMonitorTimeSeries type - -```json -{ - "data_source_label": "bk_monitor", - "data_type_label": "time_series" -} -``` - -| Field | Type | Required | Description | -| --------------- | ------ | ---- | -------- | -| metric_field | string | yes | metric | -| unit | string | Yes | unit | -| agg_condition | list | yes | query condition | -| agg_dimension | list | Yes | aggregate dimension | -| agg_method | string | yes | aggregation method | -| agg_interval | int | yes | aggregation period | -| result_table_id | string | yes | result table id | - -##### BkMonitorLog type - -```json -{ - "data_source_label": "bk_monitor", - "data_type_label": "log" -} -``` - -| Field | Type | Required | Description | -| --------------- | ------ | ---- | -------- | -| agg_method | string | yes | aggregation method | -| agg_condition | list | yes | query condition | -| result_table_id | string | yes | result table | -| agg_interval | int | yes | aggregation period | - -##### BkMonitorEvent Type - -```json -{ - "data_source_label": "bk_monitor", - "data_type_label": "event" -} -``` - -| Field | Type | Required | Description | -| --------------- | ------ | ---- | -------- | -| metric_field | string | yes | metric | -| agg_condition | list | yes | query condition | -| result_table_id | string | yes | result table | - -##### BkLogSearchTimeSeries type - -```json -{ - "data_source_label": "bk_log_search", - "data_type_label": "time_series" -} -``` - -| Field | Type | Required | Description | -| --------------- | ------ | ---- | -------- | -| metric_field | string | yes | metric | -| index_set_id | int | yes | index set id | -| agg_condition | list | yes | query condition | -| agg_dimension | list | Yes | aggregate dimension | -| agg_method | string | yes | aggregation method | -| result_table_id | string | yes | index | -| agg_interval | int | yes | aggregation period | -| time_field | string | yes | time field | -| unit | string | Yes | unit | - -##### BkLogSearchLog type - -```json -{ - "data_source_label": "bk_log_search", - "data_type_label": "log" -} -``` - -| Field | Type | Required | Description | -| --------------- | ------ | ---- | -------- | -| index_set_id | int | yes | index set id | -| agg_condition | list | yes | query condition | -| query_string | int | yes | query statement | -| agg_dimension | list | Yes | aggregate dimension | -| result_table_id | string | yes | index | -| agg_interval | int | yes | aggregation period | -| time_field | string | yes | time field | - -##### CustomEvent Type - -```json -{ - "data_source_label": "custom", - "data_type_label": "event" -} -``` - -| Field | Type | Required | Description | -| ----------------- | ------ | ---- | -------------- | -| custom_event_name | string | yes | custom event name | -| agg_condition | list | yes | query condition | -| agg_interval | int | yes | aggregation period | -| agg_dimension | list | yes | query dimension | -| agg_method | string | yes | aggregation method | -| result_table_id | string | yes | result table id | - -##### CustomTimeSeries type - -```json -{ - "data_source_label": "custom", - "data_type_label": "time_series" -} -``` -| Field | Type | Required | Description | -| --------------- | ------ | ---- | -------- | -| metric_field | string | yes | metric | -| unit | string | Yes | unit | -| agg_condition | list | yes | query condition | -| agg_dimension | list | Yes | aggregate dimension | -| agg_method | string | yes | aggregation method | -| agg_interval | int | yes | aggregation period | -| result_table_id | string | yes | result table id | - -##### BkDataTimeSeries type - -```json -{ - "data_source_label": "bk_data", - "data_type_label": "time_series" -} -``` - -| Field | Type | Required | Description | -| --------------- | ------ | ---- | -------- | -| metric_field | string | yes | metric | -| unit | string | Yes | unit | -| agg_condition | list | yes | query condition | -| agg_dimension | list | Yes | aggregate dimension | -| agg_method | string | yes | aggregation method | -| agg_interval | int | yes | aggregation period | -| result_table_id | string | yes | result table | -| time_field | string | yes | time field | - -#### algorithms - -| Field | Type | Required | Description | -| ----------- | ------ | ---- | ------------ | -| config | list | yes | algorithm configuration list | -| level | int | yes | alarm level | -| type | string | yes | algorithm type | -| unit_prefix | string | no | algorithm unit prefix | - -#### Algorithm configuration config - -##### Static Threshold Threshold - -```json -[ - { - "method": "gt", // gt,gte,lt,lte,eq,neq - "threshold": "1" - } -] -``` - -##### Simple Ring Ratio SimpleRingRatio - -```json -{ - "floor": "1", - "ceil": "1" -} -``` - -##### Simple compared to SimpleYearRound - -```json -{ - "floor": "1", - "ceil": "1" -} -``` - -##### Advanced Ring Ratio AdvancedRingRatio - -```json -{ - "floor": "1", - "ceil": "1", - "floor_interval": 1, - "ceil_interval": 1 -} -``` - -##### Advanced YoY AdvancedYearRound - -Consistent with the configuration format of the advanced chain ratio detection algorithm - -##### Intelligent Anomaly Detection IntelligentDetect - -```json -{ - "sensitivity_value": 1, // 0-100 - "anomaly_detect_direct": "ceil" // "ceil", "floor", "all"(default) -} -``` - -##### YearRoundAmplitude - -```json -{ - "ratio": 1, - "shock": 1, - "days": 1, - "method": "gte" // gt,gte,lt,lte,eq,neq -} -``` - -##### YearRoundRange - -Consistent with the year-on-year amplitude configuration format - -##### RingRatioAmplitude - -```json -{ - "ratio": 1, - "shock": 1, - "days": 1, - "threshold": 1 -} -``` - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_id": 7, - "scenario": "os", - "name": "Process port", - "labels": [], - "is_enabled": true, - "items": [ - { - "name": "AVG(CPU usage)", - "no_data_config": { - "continuous": 10, - "is_enabled": false, - "agg_dimension": [ - "bk_target_ip", - "bk_target_cloud_id" - ], - "level": 2 - }, - "target": [], - "expression": "a", - "origin_sql": "", - "query_configs": [ - { - "data_source_label": "bk_monitor", - "data_type_label": "time_series", - "alias": "a", - "result_table_id": "system.cpu_summary", - "agg_method": "AVG", - "agg_interval": 60, - "agg_dimension": [ - "bk_target_ip", - "bk_target_cloud_id" - ], - "agg_condition": [], - "metric_field": "usage", - "unit": "percent", - "metric_id": "bk_monitor.system.cpu_summary.usage", - "index_set_id": "", - "query_string": "*", - "custom_event_name": "usage", - "functions": [], - "time_field": "time", - "bkmonitor_strategy_id": "usage", - "alert_name": "usage" - } - ], - "algorithms": [ - { - "level": 1, - "type": "Threshold", - "config": [ - [ - { - "method": "gte", - "threshold": "80" - } - ] - ], - "unit_prefix": "%" - } - ] - } - ], - "detects": [ - { - "level": 1, - "expression": "", - "trigger_config": { - "count": 1, - "check_window": 5 - }, - "recovery_config": { - "check_window": 5 - }, - "connector": "and" - } - ], - "actions": [ - { - "type": "notice", - "config": { - "alarm_start_time": "00:00:00", - "alarm_end_time": "23:59:59", - "alarm_interval": 1440, - "send_recovery_alarm": false - }, - "notice_group_ids": [ - 11 - ], - "notice_template": { - "anomaly_template": "{{content.level}}\n{{content.begin_time}}\n{{content.time}}\n{{content.duration}}\n{{content.target_type}}\n{{content.data_source}}\n{{content.content}}\n{{content.current_value}}\n{{content.biz}}\n{{content.target}}\n{{content.dimension}}\n{{content.detail}}\n{{content.related_info}}", - "recovery_template": "" - } - } - ] -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | - -#### Sample data - -```json -{ - "result": true, - "code": 200, - "message": "OK", - "data": {data returns the saved policy structure, consistent with the request parameters (omitted in the sample data)} -} -``` - - - - - diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/save_notice_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/save_notice_group.md deleted file mode 100644 index 8512c6d1d..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/save_notice_group.md +++ /dev/null @@ -1,103 +0,0 @@ -### Function description - -save alarm group - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| --------------- | ------ | ---- | ------------------------ | -| bk_biz_id | int | yes | business id | -| name | string | Yes | name | -| message | string | yes | description | -| webhook_url | string | no | callback address | -| notice_way | dict | yes | notification methods for each level | -| id | int | no | alarm group ID, if not created | -| notice_receiver | list | yes | list of notification objects | -| wxwork_group | dict | No | Enterprise WeChat Robot | - -#### notice_receiver - list of notification objects - -Notification objects have two types `user` or `group`. - -1. The notification object corresponding to user is the user name -2. group corresponds to the notification group -1. operator - the main person in charge -2. bk_bak_operator - backup manager -3. bk_biz_tester - test -4. bk_biz_productor - Product -5. bk_biz_maintainer --Luck -6. bk_biz_developer - Development - -#### notice_way - notice method - -Notification methods for each alarm level - -The basic notification methods are: - -*weixin -* mail -* voice -* sms - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_id": 2, - "notice_receiver": [ - { - "type": "user", - "id": "admin" - } - ], - "name": "layman", - "notice_way": { - "1": ["weixin"], - "2": ["weixin"], - "3": ["weixin"] - }, - "webhook_url": "https://www.qq.com", - "message": "Test Notification", - "id": 1, - "wxwork_group": { - "1": "Group session ID", - "2": "Group session ID", - "3": "Group Session ID" - } -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | - -#### Data field description - -| Field | Type | Description | -| --------------- | ------ | ------------------ | -| id | int | Alarm ID | - -#### Sample data - -```json -{ - "message": "OK", - "code": 200, - "data": { - "id": 1 - }, - "result": true -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_alarm_strategy.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_alarm_strategy.md deleted file mode 100644 index e8f3bf57c..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_alarm_strategy.md +++ /dev/null @@ -1,270 +0,0 @@ -### Function description - -Querying the Alarm Policy - -### request parameters - -{{ common_args_desc }} - -#### interface parameters - -| Field | Type | Required | Description | -| --------- | ------ | ---- | ---------- | -| page | int | no | page number | -| page_size | int | no | number of entries per page | -| ids | list | no | list of policy IDs | -| metric_id | string | no | metric ID | -| bk_biz_id | int | yes | business id | -| fields | list | no | required fields | - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_id": 2, - "ids": [1, 2] -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | - -#### Data field description - -| Field | Type | Description | -| :---------- | ------ | ---------------- | -| action_list | list | Action list (Action) | -| source_type | string | data source | -| target | list | monitoring targets | -| bk_biz_id | int | Business ID | -| item_list | list | Monitoring items (Item) | -| name | string | Policy name | -| scenario | string | monitoring object | -| id | int | Policy ID | - -#### data.action_list - -| Field | Type | Description | -| --------------------------------- | ------ | ----------------------- | -| action_type | string | action type (notice) | -| config | dict | Action configuration | -| config.alarm_end_time | string | notification period | -| config.alarm_start_time | string | notification time period | -| config.send_recovery_alarm | bool | whether to send recovery | -| config.alarm_interval | int | notification interval | -| notice_template | dict | notification configuration | -| notice_template.anomaly_template | string | Anomaly notification template | -| notice_template.recovery_template | string | Recovery notice template | -| notice_group_list | list | NoticeGroup list | - -#### data.action_list.notice_group_list - -| Field | Type | Description | -| --------------- | ------ | -------------------------------------------------- | -| notice_receiver | list | recipients | -| name | string | Notification group name | -| notice_way | dict | The notification method, the alarm level is key, and the value is a list of notification methods | -| message | string | Remarks | -| id | int | notification group ID | - -#### item_list - -| Field | Type | Description | -| ------------------------- | ------ | --------------------------- | -| rt_query_config | dict | Metric query configuration (RtQueryConfig) | -| metric_id | string | metric | -| name | string | item name | -| data_source_label | string | data source | -| algorithm_list | list | Algorithm configuration list (Algorithm) | -| no_data_config | dict | no data config | -| no_data_config.is_enabled | bool | Whether to enable no data alarm | -| no_data_config.continous | int | No data alarm detection cycle number | -| data_type_label | string | data type | - -#### item_list.rt_query_config - -| Field | Type | Description | -| --------------- | ------ | -------- | -| metric_field | string | metric name | -| unit_conversion | int | unit conversion | -| unit | string | unit | -| extend_fields | string | other fields | -| agg_condition | list | query condition | -| agg_interval | int | aggregation period | -| agg_dimension | list | query dimension | -| agg_method | string | Aggregation method | -| result_table_id | string | result table ID | - -#### item_list.algorithm_list - -| Field | Type | Description | -| ---------------------------- | ------ | -------------- | -| algorithm_config | list | algorithm configuration list | -| level | int | Alarm level | -| trigger_config | dict | trigger condition | -| trigger_config.count | int | trigger threshold | -| trigger_config.check_window | int | Number of trigger check windows | -| algorithm_type | string | algorithm type | -| recovery_config | dict | recovery_config | -| recovery_config.check_window | int | number of recovery cycles | -| message_template | string | | - -#### Sample data - -```json -{ - "message": "OK", - "code": 200, - "data": [ - { - "bk_biz_id": 2, - "item_list": [ - { - "update_time": "2019-11-22 14:50:23+0800", - "data_type_label": "time_series", - "metric_id": "bk_monitor.system.cpu_detail.idle", - "item_name": "Idle Rate", - "strategy_id": 1, - "data_source_label": "bk_monitor", - "algorithm_list": [ - { - "algorithm_config": [[ - { - "threshold": 0.1, - "method": "gte" - } - ]], - "update_time": "2019-11-22 14:50:23+0800", - "trigger_config": { - "count": 1, - "check_window": 5 - }, - "strategy_id": 1, - "level": 1, - "algorithm_type": "Threshold", - "recovery_config": { - "check_window": 5 - }, - "create_time": "2019-11-22 14:50:23+0800", - "algorithm_id": 19, - "message_template": "", - "item_id": 2, - "id": 19 - } - ], - "no_data_config": { - "is_enabled": false, - "continuous": 5 - }, - "create_time": "2019-10-26 15:54:18+0800", - "rt_query_config_id": 2, - "item_id": 2, - "rt_query_config": { - "update_time": "2019-11-22 14:50:23+0800", - "metric_field": "idle", - "agg_dimension": [ - "ip", - "bk_cloud_id" - ], - "unit_conversion": 1, - "result_table_id": "system.cpu_detail", - "extend_fields": "", - "create_time": "2019-10-26 15:54:18+0800", - "rt_query_config_id": 2, - "agg_method": "AVG", - "agg_condition": [], - "agg_interval": 60, - "id": 2, - "unit": "%" - }, - "id": 2, - "name": "Idle Rate" - } - ], - "update_time": "2019-11-22 14:50:23+0800", - "target": [ - [ - { - "field": "bk_target_ip", - "method": "eq", - "value": [ - { - "bk_target_ip": "10.0.0.1", - "bk_target_cloud_id": 0 - } - ] - } - ] - ], - "scenario": "os", - "strategy_id": 1, - "action_list": [ - { - "update_time": "2019-11-22 14:50:24+0800", - "notice_template": { - "recovery_template": "", - "update_time": "2019-11-22 14:50:24+0800", - "create_time": "2019-10-26 15:54:19+0800", - "anomaly_template": "aa", - "action_id": 2 - }, - "id": 2, - "notice_group_list": [ - { - "update_time": "2019-11-18 17:51:54+0800", - "notice_receiver": [ - { - "type": "user", - "id": "admin" - } - ], - "name": "user group", - "notice_way": { - "1": [ - "weixin" - ], - "2": [ - "weixin" - ], - "3": [ - "weixin" - ] - }, - "create_time": "2019-11-18 17:51:54+0800", - "notice_group_id": 5, - "message": "asdf", - "notice_group_name": "user group", - "id": 5 - } - ], - "create_time": "2019-10-26 15:54:18+0800", - "action_type": "notice", - "config": { - "alarm_end_time": "23:59:59", - "send_recovery_alarm": false, - "alarm_start_time": "00:00:00", - "alarm_interval": 120 - }, - "strategy_id": 1, - "action_id": 2 - } - ], - "source_type": "BKMONITOR", - "strategy_name": "test", - "create_time": "2019-10-23 21:34:12+0800", - "id": 1, - "name": "test" - } - ], - "result": true -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_alarm_strategy_v2.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_alarm_strategy_v2.md deleted file mode 100644 index d228eb554..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_alarm_strategy_v2.md +++ /dev/null @@ -1,346 +0,0 @@ -### Function description - -Querying the Alarm Policy List - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| --------- | ------ | ---- | ---------- | -| page | int | yes | page number | -| page_size | int | yes | number of entries per page | -| conditions| list | yes | query conditions | -| bk_biz_id | int | yes | business id | -| scenario | string | no | monitoring scenario | -| with_notice_group | bool | yes | whether to supplement notification group information | - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "page": 1, - "page_size": 10, - "conditions": [ - { - "key": "strategy_id", - "value": [ - "36" - ] - } - ], - "bk_biz_id": 7, - "with_notice_group": false -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | - -#### data field description - -| Field | Type | Description | -| :---------- | ------ | ---------------- | -| data_source_list | list | Data Source List (DataSource) | -| notice_group_list | list | NoticeGroup list | -| scenario_list | list | List of monitored objects (Scenario) | -| strategy_config_list | list | Strategy Configuration List (StrategyConfig)| -| strategy_label_list | list | Strategy Label List (StrategyLabel) | - -#### data.data_source_list - -| Field | Type | Description | -| --------------------------------- | ------ | ----------------------- | -| type | string | data type | -| name | string | data name | -| data_type_label | string | data type label | -| data_source_label| string | data source label | -| count | int | Count the number of policies by data source | - -#### data.notice_group_list - -| Field | Type | Description | -| --------------- | ------ | ------------- | -| notice_group_id | int | notification group ID | -| notice_group_name| string | notice group name | -| count | int | Number of policies by notification group | - -#### data.scenario_list - -| Field | Type | Description | -| ------------------------- | ------ | --------------------------- | -| id | int | Monitoring object ID | -| display_name | string | monitor object name | -| count | int | The number of policies by monitoring object | - -#### data.strategy_config_list - -| Field | Type | Required | Description | -| :---------------------- | ------ | ---- | ------------ | -| actions | list | yes | action list | -| source | string | Yes | policy source | -| detects | list | yes | list of detection configurations | -| id | int | yes | policy id | -| items | list | yes | item list | -| labels | list | yes | list of policy labels | -| name | string | yes | policy name | -| scenario | string | yes | monitoring object | -| is_enabled | bool | no | is it enabled | -| update_time | string | no | policy creation time | -| create_time | string | No | Create policy time | -| update_user | string | no | create policyr | -| create_user | string | no | create policyr | -| alert_count | int | no | number of alerts | -| type | string | no | policy type | -| target_object_type | string | no | target object type | -| shield_info | dict | no | shield configuration info | -| shield_info.is_shielded | bool | no | is shielded | -| add_allowed | bool | no | add_allowed | -| data_source_type | string | no | data source type | -| bk_biz_id | int | yes | business id | - -#### data.strategy_config_list.actions - -| Field | Type | Description | -| --------------------------------- | ------ | ----------------------- | -| action_type | string | action type (notice) | -| config | dict | Action configuration | -| config.alarm_end_time | string | notification period | -| config.alarm_start_time | string | notification time period | -| config.send_recovery_alarm | bool | whether to send recovery | -| config.alarm_interval | int | notification interval | -| notice_template | dict | notification configuration | -| notice_template.anomaly_template | string | Anomaly notification template | -| notice_template.recovery_template | string | Recovery notice template | -| notice_group_list | list | NoticeGroup list | - -#### data.strategy_config_list.actions.notice_group_list - -| Field | Type | Description | -| --------------- | ------ | -------------------------------------------------- | -| notice_receiver | list | recipients | -| name | string | Notification group name | -| notice_way | dict | The notification method, the alarm level is key, and the value is a list of notification methods | -| message | string | Remarks | -| id | int | notification group ID | - -#### data.strategy_config_list.detects - -| Field | Type | Description | -| ---------------------------- | ------ | ---------------- | -| id | int | detection id | -| level | int | Alarm level | -| expression | string | Calculation formula | -| trigger_config | dict | trigger condition configuration | -| trigger_config.count | int | number of triggers | -| trigger_config.check_window | int | trigger period | -| recovery_config | dict | recovery condition configuration | -| recovery_config.check_window | int | recovery period | -| connector | string | same-level algorithm connector | - -#### data.strategy_config_list.items - -| Field | Type | Description | -| ------------------------- | ------ | --------------------------- | -| rt_query_config | dict | Metric query configuration (RtQueryConfig) | -| metric_id | string | metric | -| name | string | item name | -| data_source_label | string | data source | -| algorithm_list | list | Algorithm configuration list (Algorithm) | -| no_data_config | dict | no data config | -| no_data_config.is_enabled | bool | Whether to enable no data alarm | -| no_data_config.continous | int | No data alarm detection cycle number | -| data_type_label | string | data type | - -#### data.strategy_config_list.item_list.rt_query_config - -| Field | Type | Description | -| --------------- | ------ | -------- | -| metric_field | string | metric name | -| unit_conversion | int | unit conversion | -| unit | string | unit | -| extend_fields | string | other fields | -| agg_condition | list | query condition | -| agg_interval | int | aggregation period | -| agg_dimension | list | query dimension | -| agg_method | string | Aggregation method | -| result_table_id | string | result table ID | - -#### data.strategy_config_list.items.algorithm_list - -| Field | Type | Description | -| ---------------------------- | ------ | -------------- | -| algorithm_config | list | algorithm configuration list | -| level | int | Alarm level | -| trigger_config | dict | trigger condition | -| trigger_config.count | int | trigger threshold | -| trigger_config.check_window | int | Number of trigger check windows | -| algorithm_type | string | algorithm type | -| recovery_config | dict | recovery_config | -| recovery_config.check_window | int | number of recovery cycles | -| message_template | string | | - -#### data.strategy_label_list - -| Field | Type | Description | -| --------------- | ------ | -------- | -| label_name | string | Policy label name | -| id | int | Policy Tag ID | -| count | string | Policy count by policy label | - -#### Sample data - -```json -{ - "result": true, - "code": 200, - "message": "OK", - "data": { - "scenario_list": [ - { - "id": "application_check", - "display_name": "Business Application", - "count": 0 - } - ], - "strategy_config_list": [ - { - "id": 36, - "version": "v2", - "bk_biz_id": 7, - "name": "Process port", - "source": "bk_monitorv3", - "scenario": "host_process", - "type": "monitor", - "items": [ - { - "id": 36, - "name": "Process port", - "no_data_config": { - "level": 2, - "continuous": 5, - "is_enabled": false, - "agg_dimension": [] - }, - "target": [ - [ - { - "field": "host_topo_node", - "value": [ - { - "bk_obj_id": "biz", - "bk_inst_id": 7 - } - ], - "method": "eq" - } - ] - ], - "expression": "", - "origin_sql": "", - "query_configs": [ - { - "data_source_label": "bk_monitor", - "data_type_label": "event", - "alias": "A", - "metric_id": "bk_monitor.proc_port", - "id": 36, - "functions": [], - "result_table_id": "system.event", - "metric_field": "proc_port", - "agg_condition": [], - "name": "Process Port" - } - ], - "algorithms": [ - { - "id": 36, - "type": "ProcPort", - "level": 2, - "config": [], - "unit_prefix": "" - } - ] - } - ], - "detects": [ - { - "id": 36, - "level": 2, - "expression": "", - "trigger_config": { - "count": 1, - "check_window": 5 - }, - "recovery_config": { - "check_window": 5, - "status_setter": "recovery" - }, - "connector": "and" - } - ], - "actions": [ - { - "id": 36, - "type": "notice", - "config": { - "alarm_start_time": "00:00:00", - "alarm_end_time": "23:59:59", - "alarm_interval": 1440, - "send_recovery_alarm": false - }, - "notice_group_ids": [ - 11 - ], - "notice_template": { - "anomaly_template": "", - "recovery_template": "" - } - } - ], - "is_enabled": true, - "update_time": "2021-08-11T15:36:58.508375+08:00", - "update_user": "admin", - "create_time": "2021-07-21T13:17:31.539288+08:00", - "create_user": "admin", - "labels": [], - "alert_count": 0, - "shield_info": { - "is_shielded": false - }, - "target_object_type": "HOST", - "add_allowed": true, - "data_source_type": "System Events" - } - ], - "notice_group_list": [ - { - "notice_group_id": 11, - "notice_group_name": "The person in charge of the active and standby", - "count": 1 - } - ], - "data_source_list": [ - { - "type": "bk_monitor_time_series", - "name": "Monitoring Collection Metrics", - "data_type_label": "time_series", - "data_source_label": "bk_monitor", - "count": 1 - } - ], - "strategy_label_list": [] - } -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_event.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_event.md deleted file mode 100644 index 5db2317fd..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_event.md +++ /dev/null @@ -1,264 +0,0 @@ -### Function description - -query event - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| ---------- | ------ | ---- | ------------------------------------------------------------ | -| bk_biz_ids | list | yes | list of business IDs | -| time_range | string | No | The time range when the event ends, in the format: 2020-02-26 00:00:00 -- 2020-02-28 23:59:59 | -| days | int | No | Query the time in the last few days, this parameter exists, time_range is invalid | -| conditions | list | no | query conditions | -| page | int | No | The number of pages, no pagination if not passed | -| page_size | int | no | number of pages per page, default 100 | - -> It should be noted that the currently unrecovered events are not constrained by time conditions, that is, no matter what time range is selected, the current unrecovered events will be detected unless conditions are used to filter the event status. - -#### conditions - -Conditions are used to filter events by other fields related to the event. They are composed of key and value, which means that events in the value list are filtered out of the key field. - -The following matching conditions indicate that the events whose event status is "Recovered" are filtered out. - -```json -[ - { - "key":"event_status", - "value":["RECOVERED"] - } -] -``` - -Available fields are: - -1. strategy_id - the strategy ID associated with the event - -2. id - Event ID - -3. level - the alarm level - 1. 1- Fatal - 2. 2- Warning - 3. 3- Reminders - - -4. event_status - event status - - 1. ABNORMAL - abnormal - 2. CLOSED - closed - 3. RECOVERED - recovered - -5. data_source - data source and type - - It is a string separated by `|`, the left side is the data source, the right side is the data type, such as `bk_monitor|time_series` - - The data sources are: - -1. bk_monitor - monitor collection -2. bk_data - Data Platform -3. bk_log_search - log retrieval -4. custom - user-defined - -​ The data types are: - -1. time_series - time series data -2. event - event -3. log - log keyword - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_ids":[2], - "time_range":"2020-02-26 00:00:00 -- 2020-02-28 23:59:59", - "conditions":[ - { - "key":"event_status", - "value":[ - "RECOVERED" - ] - }, - { - "key":"data_source", - "value":[ - "bk_monitor|time_series" - ] - } - ], - "page": 1, - "page_size": 100 -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | list | data | - -#### data field description - -| Field | Type | Description | -| ------------- | ------ | ------------------------------------------------------------ | -| bk_biz_id | int | Business ID | -| is_ack | bool | whether to confirm | -| level | int | Alarm level, 1 (execution) 2 (warning) 3 (reminder) | -| origin_alarm | dict | Anomaly point data when the event occurred | -| origin_config | dict | The alarm policy configuration when the event is generated. For data, please refer to the related documents of the alarm policy api | -| strategy_id | int | Alert strategy ID | -| id | int | Event table auto-increment ID | -| is_shielded | bool | is shielded | -| event_id | string | exception event ID | -| status | int | event status, ABNORMAL (not recovered) CLOSED (closed) RECOVERED (recovered) | -| create_time | string | The time when the event was generated, in the format yyyy-mm-dd hh:mm:ss | -| begin_time | string | The creation time of the first anomaly point associated with this event, in the format yyyy-mm-dd hh:mm:ss | -| end_time | string | The end time of the event, in the format yyyy-mm-dd hh:mm:ss | -| target_key | string | event target, empty string if it does not exist | -| p_event_id | string | parent event ID, default is empty | - -#### target key - -Indicates the monitoring target corresponding to the current event. The data format is as follows: - -- host: host|ip|bk_cloud_id -eg: host | 10.0.0.1 | 0 -- Service instance: service|bk_target_service_instance_id -eg: service|13 -- topology node: topo|bk_obj_id|$bk_inst_id -eg: topo|us|2 -- none: "" - -#### origin_alarm - -Represents outlier data at the time of the event - -| Field | Type | Description | -| ----------------------- | ------ | -------------- | -| data | dict | data | -| data.dimensions | dict | data dimensions | -| data.values ​​| dict | values ​​of outliers | -| data.time | int | timestamp of the outlier | -| dimension_translation | dict | Dimension display information | -| anomaly | dict | exception information | -| anomaly.key | string | alarm level | -| anomaly.anomaly_message | string | Exception description | -| anomaly.anomaly_time | string | anomaly time | -| anomaly.anomaly_id | string | Anomaly location ID | - -#### origin_alarm.dimension_translation - dimension display information - -Translate the dimension into the content displayed to the user, corresponding to the information in data.dimensions - -1. display_name - dimension name -2. display_value - the value of the dimension -3. value - the original value of the dimension - -```json -{ - "bk_topo_node": { - "display_name":"bk_topo_node", - "display_value":[ - { - "bk_obj_name":"Cluster", - "bk_inst_name":"Free Machine Pool" - }, - { - "bk_obj_name":"Business", - "bk_inst_name":"Blue Whale" - }, - { - "bk_obj_name":"Module", - "bk_inst_name":"idle machine" - } - ], - "value":[ - "set|2", - "biz|2", - "module|3" - ] - }, - "bk_target_cloud_id":{ - "display_name":"bk_target_cloud_id", - "display_value":0, - "value":0 - }, - "bk_target_ip":{ - "display_name":"bk_target_ip", - "display_value":"10.0.0.1", - "value":"10.0.0.1" - } -} -``` - -#### Sample data - -```json -{ - "code": 200, - "result": true, - "message": "ok", - "data": [ - { - "status": "ABNORMAL", - "bk_biz_id": 2, - "is_ack": false, - "level": 1, - "origin_alarm": { - "data": { - "record_id": "d751713988987e9331980363e24189ce.1574439900", - "values": { - "count": 10, - "dtEventTimeStamp": 1574439900 - }, - "dimensions": {}, - "value": 10, - "time": 1574439900 - }, - "trigger": { - "level": "1", - "anomaly_ids": [ - "d751713988987e9331980363e24189ce.1574439660.88.118.1", - "d751713988987e9331980363e24189ce.1574439720.88.118.1", - "d751713988987e9331980363e24189ce.1574439780.88.118.1", - "d751713988987e9331980363e24189ce.1574439840.88.118.1", - "d751713988987e9331980363e24189ce.1574439900.88.118.1", - "d751713988987e9331980363e24189ce.1574439960.88.118.1", - "d751713988987e9331980363e24189ce.1574440020.88.118.1", - "d751713988987e9331980363e24189ce.1574440080.88.118.1", - "d751713988987e9331980363e24189ce.1574440140.88.118.1" - ] - }, - "anomaly": { - "1": { - "anomaly_message": "count >= 1.0, current value 10.0", - "anomaly_time": "2019-11-22 16:31:06", - "anomaly_id": "d751713988987e9331980363e24189ce.1574439900.88.118.1" - } - }, - "dimension_translation": {}, - "strategy_snapshot_key": "bk_bkmonitor.ee.cache.strategy.snapshot.88.1574411061" - }, - "target_key": "", - "strategy_id": 88, - "id": 1364253, - "is_shielded": false, - "event_id": "d751713988987e9331980363e24189ce.1574439660.88.118.1", - "create_time": "2019-11-22 16:31:07", - "end_time": null, - "begin_time": "2019-11-22 16:25:00", - "origin_config": {}, - "p_event_id": "" - } - ] -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_notice_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_notice_group.md deleted file mode 100644 index 590fdf24b..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/search_notice_group.md +++ /dev/null @@ -1,97 +0,0 @@ -### Function description - -Querying an Alarm Group - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| ---------- | ---- | ---- | -------- | -| bk_biz_ids | list | no | business IDs | -| ids | list | no | notification group ids | - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "bk_biz_ids": [2], - "ids": [1] -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | - -#### Data field description - -| Field | Type | Description | -| --------------- | ------ | ------------------ | -| bk_biz_id | int | Business ID | -| name | string | name | -| message | string | Description | -| notice_way | dict | notification methods at each level | -| id | int | Alarm ID | -| notice_receiver | list | list of notifiers | -| webhook_url | string | Callback address | -| update_time | string | update time | -| update_user | string | updated by | -| create_time | string | Created by | - -#### notice_receiver - list of notifiers - -Notification objects have two types `user` or `group`. - -1. The notification object corresponding to user is the user name -2. group corresponds to the notification group -1. operator - the main person in charge -2. bk_bak_operator - backup manager -3. bk_biz_tester - test -4. bk_biz_productor - Product -5. bk_biz_maintainer --Luck -6. bk_biz_developer - Development - -#### Sample data - -```json -{ - "message": "OK", - "code": 200, - "data": [ - { - "bk_biz_id": 2, - "update_time": "2019-11-18 17:51:54+0800", - "notice_receiver": [ - { - "type": "user", - "id": "admin" - } - ], - "update_user": "admin", - "name": "layman", - "notice_way": { - "1": ["weixin"], - "2": ["weixin"], - "3": ["weixin"] - }, - "create_time": "2019-11-18 17:51:54+0800", - "message": "", - "webhook_url": "", - "id": 5 - } - ], - "result": true -} -``` - diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/switch_alarm_strategy.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/switch_alarm_strategy.md deleted file mode 100644 index f60b31ab9..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/switch_alarm_strategy.md +++ /dev/null @@ -1,59 +0,0 @@ -### Function description - -switch alarm strategy - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| --------- | ---- | ---- | ---------- | -| ids | list | Yes | list of policy IDs | -| is_enabled | bool | yes | whether to enable | - -#### Parameters example - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "ids": [80], - "is_enabled": true -} -``` - -### Response parameters - -| Field | Type | Description | -| ---------- | ------ | ------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | dict | data | -| request_id | string | Request ID | - -#### Data parameter description - -| Field | Type | Description | -| --------- | ------ | ---------- | -| ids | list | List of existing policy IDs | - -#### Parameters example - -```json -{ - "result": true, - "code": 200, - "data": { - "ids": [ - 80 - ] - }, - "message": "ok", - "request_id": "eafafwafw1212241212513wafafafw" -} -``` - diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/en/update_partial_strategy_v2.md b/paas2/esb/components/confapis/monitor_v3/apidocs/en/update_partial_strategy_v2.md deleted file mode 100644 index 4107b3e92..000000000 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/en/update_partial_strategy_v2.md +++ /dev/null @@ -1,71 +0,0 @@ -### Function description - -Batch update strategy local configuration - -### Request parameters - -{{ common_args_desc }} - -#### Interface parameters - -| Field | Type | Required | Description | -| -------- | ---- | ---- | -------------- | -| edit_data | dict | yes | data to be modified | -| ids | list | yes | list of policy IDs to be modified | -| bk_biz_id | int | yes | business id | - -#### edit_data - -| Field | Type | Required | Description | -| ------------------ | ------- | ---------- | ---------- | -| is_enabled | bool | no | enabled state | -| notice_group_list | list | No | Alarm group configuration | -| labels | list | no | policy labels | -| trigger_config | dict | no | trigger condition | -| recovery_config | dict | no | recovery conditions | -| alarm_interval | int | no | notification interval | -| send_recovery_alarm | bool | no | recovery notification | -| message_template | string | no | notification template | -| no_data_config | dict | no | no data config | -| target | list | no | monitoring target | - -#### Sample data - -```json -{ - "bk_app_code": "xxx", - "bk_app_secret": "xxxxx", - "bk_token": "xxxx", - "ids": [ - 23121 - ], - "edit_data": { - "notice_group_list": [ - 4644 - ] - }, - "bk_biz_id": 883 -} -``` - -### Response parameters - -| Field | Type | Description | -| ------- | ------ | ------------------ | -| result | bool | Whether the request was successful | -| code | int | Returned status code | -| message | string | Description | -| data | list | Successfully updated policy id table | - -#### Sample data - -```json -{ - "result": true, - "code": 200, - "message": "OK", - "data": [ - 23121 - ] -} -``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/add_shield.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/add_shield.md index 93d0dbfd9..250d0c446 100644 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/add_shield.md +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/add_shield.md @@ -28,7 +28,7 @@ | end_time | string | 否 | 结束时间(每天) | | type | int | 是 | 屏蔽周期类型(单次:1,每天:2,每周:3,每月:4) | | day_list | list | 否 | 周期为月时,需要屏蔽的天 | -| week_list | list | 否 | 周期为星期时,需要屏蔽的天 | +| week_list | list | 否 | 周期为星期是,需要屏蔽的天 | #### 通知配置(notice_config) diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/as_code_export_config.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/as_code_export_config.md new file mode 100644 index 000000000..027bb411f --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/as_code_export_config.md @@ -0,0 +1,54 @@ +### 功能描述 + +导出YAML配置 + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|---------|---------|----|-------------------------------| +| bk_biz_id | integer | 是 | 业务ID | +| dashboard_for_external | boolean | 否 | 是否以外部导出模式导出grafana仪表盘,默认false | + +#### 示例数据 + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "bk_biz_id": 2, + "dashboard_for_external": true, +} +``` + +### 响应参数 + +| 字段 | 类型 | 描述 | +| ------- |-----------| ------------ | +| result | bool | 请求是否成功 | +| message | string | 描述信息 | +| data | dict/null | 返回数据 | + +#### 示例数据 + +```json +{ + "message": "", + "data": { + "rule": { + "xxx.yaml": "xxxx" + }, + "notice": { + "xxx.yaml": "xxxx", + "yyy/zzz.yaml": "xxxx" + }, + "grafana": { + "xxx.yaml": "xxxx" + }, + "action": { + "xxx.yaml": "xxxx" + } + }, + "result": true +} +``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/as_code_import_config.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/as_code_import_config.md new file mode 100644 index 000000000..c5898d19f --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/as_code_import_config.md @@ -0,0 +1,47 @@ +### 功能描述 + +导入YAML配置 + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|---------|---------|----|---------------------| +| configs | dict | 是 | yaml配置 | +| app | string | 否 | 配置分组,默认defult | +| bk_biz_id | integer | 是 | 业务ID | +| overwrite | dict | 否 | 是否跨分组覆盖同名配置,默认false | + +#### 示例数据 + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "configs": { + "rule/xxx.yaml": "xxxx", + "notice/xxx.yaml": "xxxx" + }, + "app": "default", + "bk_biz_id": 2, + "overwrite": false +} +``` + +### 响应参数 + +| 字段 | 类型 | 描述 | +| ------- |-----------| ------------ | +| result | bool | 请求是否成功 | +| message | string | 描述信息 | +| data | dict/null | 返回数据 | + +#### 示例数据 + +```json +{ + "message": "", + "data": {}, + "result": true +} +``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_delete.MD b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_delete.MD new file mode 100644 index 000000000..20af27af1 --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_delete.MD @@ -0,0 +1,46 @@ +### 功能描述 + +删除插件 + +### 请求参数 + +{{ common_args_desc }} + +#### + +| 字段 | 类型 | 描述 | +|------------| ------ |--------| +| plugin_ids | string | 插件id列表 | + + +#### 示例数据 +`路径参数` + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "plugin_ids": ["sss_script"] +} +``` + +### 响应参数 +| 字段 | 类型 | 描述 | +| ------- |--------|-----| +| result | bool | 请求是否成功 | +| code | int | 返回的状态码 | +| message | string | 描述信息 | +| data | dict | 结果 | + + +#### 示例数据 + +```json +{ + "result": true, + "code": 200, + "message": "OK", + "data": {"result": true} +} +``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_detail.MD b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_detail.MD new file mode 100644 index 000000000..6bcdfdde2 --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_detail.MD @@ -0,0 +1,171 @@ +### 功能描述 + +查询插件详情 + +### 请求参数 + +{{ common_args_desc }} + +#### + +| 字段 | 类型 | 描述 | +| ---------- | ------ | -------- | +| plugin_id | string | 插件id | + + +#### 示例数据 +`路径参数` + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "plugin_id": "sss_script", +} +``` + +### 响应参数 + +| 字段 | 类型 | 描述 | +| ------- | ------ | ------------ | +| result | bool | 请求是否成功 | +| code | int | 返回的状态码 | +| message | string | 描述信息 | +| data | dict | 插件信息 | + + +#### 插件信息 + +| 字段 | 类型 | 描述 | +| ----------- | ---- | ------------ | +| plugin_id | string | 插件id | +| plugin_display_name | string | 插件展示名 | +| plugin_type | string | 插件类型 | +| tag | string | 插件标签 | +| bk_biz_id | int | 业务id | +| related_conf_count | int | 关联采集配置数 | +| status | string | 插件状态 | +| create_user | string | 创建人 | +| create_time | string | 创建时间 | +| update_user | string | 更新人 | +| update_time | string | 更新时间 | +| config_version | int | 插件配置版本 | +| info_version | int | 插件信息版本 | +| description_md | string | 描述 | +| edit_allowed | bool | 是否允许编辑 | +| is_support_remote | bool | 是否支持远程采集 | +| label | string | 标签 | +| logo | string | logo | +| is_official | bool | 是否官方 | +| is_safety | bool | 是否未被改动(签名校验)| +| stage | string | 版本阶段 | +| collector_json | dict | 采集器配置 | +| config_json | dict | 参数配置 | +| metric_json | dict | 指标配置 | +| os_type_list | list | 系统列表(如["linux","windows","linux_aarch64"]) | + + +#### collector_json详情 +> 字段与格式取决于实际插件类型 + +#### config_json详情 + +| 字段 | 类型 | 描述 | +| ----------- | ---- | ------------ | +| default | string | 默认值 | +| description | string | 描述| +| type | string | 值类型| +| name | string |参数名| +| mode | string |参数类型| +#### metric_json详情 + +| 字段 | 类型 | 描述 | +| ----------- | ---- | ------------ | +| table_name | string | 表名 | +| table_desc | string | 表描述| +| fields | list | 字段列表| + +#### fields详情 + +| 字段 | 类型 | 描述 | +| ----------- | ---- | ------------ | +| description | string | 描述信息 | +| dimensions | list | 维度列表,如["id","record_type"]| +| is_active | bool | 是否启用| +| is_diff_metric | bool | 是否为差值指标| +| monitor_type | string | 指标类型| +| name | string | 指标名| +| source_name | string | 原指标名| +| type | string | 字段类型| +| unit | string | 单位| + +#### 示例数据 + +```json +{ + "result": true, + "code": 200, + "message": "OK", + "data": { + "plugin_id": "bk_collector", + "plugin_display_name": "apm-rum接收", + "plugin_type": "Pushgateway", + "tag": "", + "label": "os", + "status": "normal", + "logo": "", + "collector_json": {}, + "config_json": [ + { + "default": "", + "mode": "collector", + "type": "text", + "name": "metrics_url", + "description": "采集URL" + } + ], + "metric_json": [ + { + "table_name": "Group1", + "table_desc": "分组1", + "fields": [ + { + "description": "", + "type": "double", + "monitor_type": "metric", + "unit": "none", + "name": "bk_collector_exporter_sent_duration_in_ms_sum", + "is_diff_metric": false, + "is_active": true, + "source_name": "", + "dimensions": [] + } + + ] + } + ], + "description_md": "### 依赖说明...", + "config_version": 1, + "info_version": 2, + "stage": "release", + "bk_biz_id": 2, + "signature": "dcssdscds...", + "is_support_remote": true, + "is_official": false, + "is_safety": true, + "create_user": "admin", + "update_user": "admin", + "os_type_list": [ + "linux", + "windows", + "linux_aarch64" + ], + "create_time": "2023-02-15 15:16:05+0800", + "update_time": "2023-02-15 15:16:22+0800", + "related_conf_count": 0, + "edit_allowed": true + } +} + +``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_list.MD b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_list.MD new file mode 100644 index 000000000..7e5644410 --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/collector_plugin_list.MD @@ -0,0 +1,141 @@ +### 功能描述 + +查询插件列表 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 描述 | +| ---------- | ------ | -------- | +| search_key | string | 查询字段 | +| search_type | string | 插件类型 | +| labels | string | 分类 | +| order | string | 排序字段 | +| status | string | 插件状态 | +| bk_biz_id | int | 业务ID | +| page | int | 页数 | +| page_size | int | 每页数量 | + +#### 示例数据 +`query_string` + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "bk_biz_id": 1, + "search_key": "xxxexporter", + "search_type": "Script", + "labels": "", + "order": "-status", + "page": 1, + "page_size": 10 +} +``` + +### 响应参数 + +| 字段 | 类型 | 描述 | +| ------- | ------ | ------------ | +| result | bool | 请求是否成功 | +| code | int | 返回的状态码 | +| message | string | 描述信息 | +| data | list | data数据 | + +#### data详情 + +| 字段 | 类型 | 描述 | +| ----------- | ---- | ------------ | +| count | dict | 插件类型数量 | +| list | list | 插件列表 | +#### 插件信息 + +| 字段 | 类型 | 描述 | +| ----------- | ---- | ------------ | +| plugin_id | string | 插件id | +| plugin_display_name | string | 插件展示名 | +| plugin_type | string | 插件类型 | +| tag | string | 插件标签 | +| bk_biz_id | int | 业务id | +| related_conf_count | int | 关联采集配置数 | +| status | string | 插件状态 | +| create_user | string | 创建人 | +| create_time | string | 创建时间 | +| update_user | string | 更新人 | +| update_time | string | 更新时间 | +| config_version | int | 插件配置版本 | +| info_version | int | 插件信息版本 | +| edit_allowed | bool | 是否允许编辑 | +| delete_allowed | bool | 是否允许删除 | +| export_allowed | bool | 是否允许导出 | +| logo | string | logo | +| is_official | bool | 是否官方 | +| is_safety | bool | 是否未被改动(签名校验)| +| label_info | dict | 标签信息 | + + +#### label_info详情 + +| 字段 | 类型 | 描述 | +| ----------- | ---- | ------------ | +| first_label | string | 插件标签 | +| first_label_name | string | 插件标签名| +| second_label | string | 插件标签| +| second_label_name | string |插件标签名| + +#### 示例数据 + +```json +{ + "result": true, + "code": 200, + "message": "OK", + "data": { + "count": { + "Exporter": 8, + "Script": 34, + "JMX": 0, + "DataDog": 0, + "Pushgateway": 1, + "Built-In": 0, + "Log": 0, + "Process": 0, + "SNMP_Trap": 0, + "SNMP": 3 + }, + "list": [ + { + "plugin_id": "bk_collector", + "plugin_display_name": "apm-rum接收", + "plugin_type": "Pushgateway", + "tag": "", + "bk_biz_id": 2, + "related_conf_count": 0, + "status": "normal", + "create_user": "admin", + "create_time": "2023-02-15 15:12:29", + "update_user": "admin", + "update_time": "2023-02-15 15:16:22", + "config_version": 1, + "info_version": 2, + "edit_allowed": true, + "delete_allowed": true, + "export_allowed": true, + "label_info": { + "first_label": "hosts", + "first_label_name": "主机&云平台", + "second_label": "os", + "second_label_name": "操作系统" + }, + "logo": "", + "is_official": false, + "is_safety": true + } + ] + } +} +``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/delete_rule_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/delete_rule_group.md new file mode 100644 index 000000000..83ba188e0 --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/delete_rule_group.md @@ -0,0 +1,48 @@ +### 功能描述 + +删除规则组及对应的规则 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ---- | ---- |--| +| bk_biz_id | list | 否 | 业务ID | +| group_ids | list | 否 | 分派组 | + +#### 示例数据 + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "bk_biz_ids": [2], + "group_ids": [7] +} +``` + +### 响应参数 + +| 字段 | 类型 | 描述 | +| ------- |--------|--------| +| result | bool | 请求是否成功 | +| code | int | 返回的状态码 | +| message | string | 描述信息 | +| data | object | 分派组 | + +#### 示例数据 + +```json +{ + "result": true, + "code": 200, + "message": "OK", + "data": {"deleted_group_ids": [7]}, + "request_id": "b8cf17b82cd949e984011d890ac554df" +} +``` + diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/delete_user_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/delete_user_group.md new file mode 100644 index 000000000..d2181950f --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/delete_user_group.md @@ -0,0 +1,50 @@ +### 功能描述 + +删除通知组 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|------------| ---- | ---- |------| +| bk_biz_ids | list | 是 | 业务ID | +| ids | list | 是 | 通知组ID | + +#### 示例数据 + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "ids": [ + 1 + ], + "bk_biz_ids": [ + 2 + ] +} +``` + +### 响应参数 + +| 字段 | 类型 | 描述 | +| ------- | ------ | ------------ | +| result | bool | 请求是否成功 | +| code | int | 返回的状态码 | +| message | string | 描述信息 | +| data | null | 返回数据 | + +#### 示例数据 + +```json +{ + "message": "OK", + "code": 200, + "data": null, + "result": true +} +``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/export_plugin.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/export_plugin.md new file mode 100644 index 000000000..9a41fcd71 --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/export_plugin.md @@ -0,0 +1,54 @@ +### 功能描述 +导出插件,返回一个url + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| -------------- | ------ | ---- |--| +| plugin_id | string | 是 | 插件ID | + +- plugin_id为路径参数 + +#### 请求示例 +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "plugin_id": "script_test" +} +``` + +### 返回结果 + +| 字段 | 类型 | 描述 | +| ---------- | ------ | ------------ | +| result | bool | 请求是否成功 | +| code | int | 返回的状态码 | +| message | string | 描述信息 | +| data | dict | 数据 | +| request_id | string | 请求ID | + +#### data字段说明 + +| 字段 | 类型 | 描述 | +| ------------------- |--------|--| +| download_url | string | 插件下载的url | + +#### 结果示例 + +```json +{ + "message":"OK", + "code":200, + "data":{ + "download_url": "download_url" + }, + "result":true, + "request_id":"408233306947415bb1772a86b9536867" +} +``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/import_uptime_check_node.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/import_uptime_check_node.md index 08a748bdc..c45ae9966 100644 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/import_uptime_check_node.md +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/import_uptime_check_node.md @@ -26,12 +26,14 @@ | ip | str | 是 | IP | | bk_cloud_id | int | 是 | 云区域ID | | bk_biz_id | int | 是 | 业务id | +| bk_host_id | int | 否 | 主机id | ##### 节点基本配置--node_conf | 字段 | 类型 | 必选 | 描述 | | --------------- | ---- | ---- | ------------------------------------------ | | is_common | bool | 否 | 是否为通用节点,默认false | +| ip_type | bool | 否 | ip类型(0、4、6),默认4 | | name | str | 是 | 节点名称 | | location | dict | 是 | 节点所在地区 | | carrieroperator | str | 是 | 运营商,最大长度50(内网、联通、移动、其他) | @@ -50,6 +52,7 @@ "bk_app_code": "xxx", "bk_app_secret": "xxxxx", "bk_token": "xxxx", + "bk_biz_id": 2, "conf_list":[{ "node_conf": { "carrieroperator": "内网", @@ -58,7 +61,8 @@ "city": "广东" }, "name": "中国广东内网", - "is_common": false + "is_common": false, + "ip_type": 4 }, "target_conf": { "bk_biz_id": 2, @@ -73,7 +77,8 @@ "city": "广东" }, "name": "中国广东内网", - "is_common": false + "is_common": false, + "ip_type": 4 }, "target_conf": { "bk_biz_id": 2, diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/metadata_create_result_table.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/metadata_create_result_table.md index 1aea3d589..fe32332d1 100644 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/metadata_create_result_table.md +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/metadata_create_result_table.md @@ -32,11 +32,13 @@ **注意**: 上述的`label`都应该通过`metadata_get_label`接口获取,不应该自行创建 #### 目前结果表可以选择的选项包括 -| 选项名 | 类型 | 描述 | -| -------------- | ------ | ----------- | -| cmdb_level_config | list | CMDB层级拆分配置 | -| group_info_alias | string | 分组标识字段别名 | +| 选项名 | 类型 | 描述 | +|----------------------|--|-----------------| +| cmdb_level_config | list | CMDB层级拆分配置 | +| group_info_alias | string | 分组标识字段别名 | | es_unique_field_list | list | ES生成doc_id的字段列表 | +| segmented_query_enable | bool | 分段查询开关 | + ###### 参数: default_storage_config及storage_config -- 在influxdb下支持的参数 diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/metadata_create_time_series_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/metadata_create_time_series_group.md index 58a8eb551..3b99ffb10 100644 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/metadata_create_time_series_group.md +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/metadata_create_time_series_group.md @@ -73,7 +73,7 @@ | create_time | string | 创建时间 | | last_modify_user | string | 最后更新人 | | last_modify_time | string | 最后更新时间 | -| metric_info_list | list | 自定义时序列表 | +| metric_info_list | list | \自定义时序列表 | #### data.metric_info_list具体内容说明 diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/plugin_import_without_frontend.MD b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/plugin_import_without_frontend.MD new file mode 100644 index 000000000..959c5af94 --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/plugin_import_without_frontend.MD @@ -0,0 +1,47 @@ + +### 功能描述 + +导入插件 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ---- | ---- | -------- | +| file_data | file | 是 | 插件文件 | +| bk_biz_id | int | 是 | 业务id | + +#### 请求参数示例 +`Content-Type multipart/form-data` +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "bk_biz_id": "2", + "file_data":"二进制" +} +``` + +### 返回结果 + +| 字段 | 类型 | 描述 | +|---------|--------|-----------------------| +| result | bool | 返回结果,true为成功,false为失败 | +| code | int | 返回码,200表示成功,其他值表示失败 | +| message | string | 错误信息 | +| data | bool | 结果 | + +#### 返回结果示例 + +```json +{ + "result": true, + "code": 200, + "message": "OK", + "data": true +} +``` diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/save_rule_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/save_rule_group.md new file mode 100644 index 000000000..0f57609f2 --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/save_rule_group.md @@ -0,0 +1,204 @@ +### 功能描述 + +保存(新建或更新)规则组 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口请求参数参数 + +| 字段 | 类型 | 是否必须 | 描述 | +|-----------|------------|------|------------------| +| id | int | 否 | 分派组ID, 没有新建,有则保存 | +| bk_biz_id | int | 是 | 业务ID | +| name | string | 是 | 名称 | +| priority | int | 是 | 优先级 | +| rules | list[rule] | 否 | 规则组列表 | + + +#### `rule` 字段说明 + +| 字段 | 类型 | 是否必填 | 描述 | +|-----------------|-----------------|------|-------------------------------------| +| id | int | 否 | 规则ID ,有修改,没有新增 | +| is_enabled | bool | 是 | 是否启用 | +| user_groups | list[ group_id] | 是 | 通知组ID列表 | +| conditions | list[condition] | 是 | 适配规则 | +| actions | list[action] | 是 | 通知配置 | +| alert_severity | int | 否 | 默认为0(维持不变),1,2,3分别对应 `致命` `预警` `提醒` | +| additional_tags | list[tag] | 否 | 添加标签 | + +#### `tag` 字段说明 + +| 字段 | 类型 | 是否必填 | 描述 | +|---------------|--------|------|-----------------| +| key | string | 是 | 标签key, 可参考页面配置项 | +| value | string | 是 | 标签value值 | +| display_key | string | 是 | key的翻译显示 | +| display_value | string | 是 | value的翻译显示 | + +#### `condition` 字段说明 + +| 字段 | 类型 | 是否必填 | 描述 | +|--------|--------------|------|-----------------------------------------------------------| +| field | string | 是 | 适配字段key, 可参考页面配置项 | +| value | list[string] | 是 | 表达式value值 | +| method | string | 否 | 表达式方法 `eq`(默认) `neq` `include`, `exclude`, `reg`, `nreg` | + +#### `action` 字段说明 + +| 字段 | 类型 | 是否必须 | 描述 | +|----------------|--------|------------|--------------------------------| +| action_type | string | 是 | 处理套餐类型 `notice(通知)` `itsm(流程)` | +| upgrade_config | dict | 否 | 升级配置(通知的时候才有效) | +| is_enabled | bool | 是 | 是否生效,通知默认为`True` | +| action_id | int | 否(流程的时候必须) | 流程套餐ID(流程的时候必须) | + +#### `upgrade_config` 字段说明 + +| 字段 | 类型 | 是否必须 | 描述 | +|------------------|-----------|------|--------------------------| +| user_groups | list[int] | 是 | 告警升级接收通知组(不可与当前规则的负责人重复) | +| upgrade_interval | int | 否 | 升级周期,单位分钟,默认60 min | +| is_enabled | bool | 否 | 是否生效,通知默认为`True` | + +#### 请求示例数据 + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "name": "分派测试11112", + "bk_biz_id": 2, + "priority": 10002, + "settings": {}, + "rules": [ + { + "id": 9, + "bk_biz_id": 2, + "assign_group_id": 7, + "is_enabled": true, + "user_groups": [ + 62 + ], + "conditions": [ + { + "field": "bcs_cluster_id", + "value": [ + "123" + ], + "method": "eq", + "condition": "and" + } + ], + "actions": [ + { + "action_type": "notice", + "upgrade_config": { + "is_enabled": true, + "user_groups": [ + 68 + ], + "upgrade_interval": 1440 + }, + "is_enabled": true + } + ], + "alert_severity": 1, + "additional_tags": [ + { + "key": "key1", + "value": "123value", + "display_key": "", + "display_value": "" + } + ] + }, + { + "id": 10, + "bk_biz_id": 2, + "assign_group_id": 7, + "is_enabled": true, + "user_groups": [ + 62 + ], + "conditions": [ + { + "field": "bcs_cluster_id", + "value": [ + "567890" + ], + "method": "eq", + "condition": "and" + } + ], + "actions": [ + { + "action_type": "notice", + "upgrade_config": { + "is_enabled": true, + "user_groups": [ + 68 + ], + "upgrade_interval": 1440 + }, + "is_enabled": true + }, + { + "action_type": "itsm", + "action_id": 1309, + "is_enabled": true + } + ], + "alert_severity": 1, + "additional_tags": [ + { + "key": "key1", + "value": "123value", + "display_key": "", + "display_value": "" + } + ] + } + ] +} +``` + +### 返回数据格式 + +| 字段 | 类型 | 描述 | +|---------|--------|--------| +| result | bool | 请求是否成功 | +| code | int | 返回的状态码 | +| message | string | 描述信息 | +| data | object | 分派组 | + +### data格式 + +| 字段 | 类型 | 描述 | +|-----------------|------|-----------| +| bk_biz_id | int | 业务ID | +| assign_group_id | int | 分派组ID | +| rules | list | 当前分派组规则ID | +| aborted_rules | list | 删除的规则ID | + + +#### 返回示例数据 + +```json +{ + "result": true, + "code": 200, + "message": "OK", + "data": { + "bk_biz_id": 2, + "assign_group_id": 1, + "rules": [9, 10], + "aborted_rules": [] + }, + "request_id": "b8cf17b82cd949e984011d890ac554df" +} +``` + diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/save_user_group.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/save_user_group.md new file mode 100644 index 000000000..83016e466 --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/save_user_group.md @@ -0,0 +1,246 @@ +### 功能描述 + +查询告警组 + +### 请求参数 + +{{ common_args_desc }} + + +#### 接口参数 +| 字段 | 类型 | 必须 | 描述 | +|------------|--------| ---- |--------------------------------| +| id | int | 是 | 告警组ID(没有表示新建) | +| bk_biz_id | int | 是| 业务ID | +| name | string | 是| 名称 | +| need_duty | bool | 是| 是否轮值 | +| channels | list | 是| 通知渠道 可选项 `user(内部用户)`, `wxwork-bot(企业微信机器人)` | +| desc | string | 是| 说明 | +| alert_notice | list | 是| 告警通知方式 | +| action_notice | list | 是| 告警处理通知配置 | +| duty_arranges | list | 是| 通知接收人员 | + + +### `alert_notice` 数据格式 +| 字段 | 类型 | 必须 | 描述 | +|------------|--------| ---- |--------------------------------| +| time_range | string | 是 | 生效时间范围 | +| notify_config | list[alert_notice_config] | 是 | 生效时间范围 | + + +### `action_notice` 数据格式 +| 字段 | 类型 | 必须 | 描述 | +|------------|----------------------------| ---- |--------------------------------| +| time_range | string | 是 | 生效时间范围 | +| notify_config | list[action_notice_config] | 是 | 生效时间范围 | + +### `alert_notice_config` 数据格式 +| 字段 | 类型 | 必须 | 描述 | +|------------|--------|------|--------------------------------| +| level | int | 是 | 1(致命),2(预警),3(提醒) | +| notice_ways | list[notice_way] | 是 | 通知方式 | + +### `action_notice_config` 数据格式 +| 字段 | 类型 | 必须 | 描述 | +|------------|--------|------|--------------------------------| +| phase | int | 是 | 1(失败时),2(成功时),3(执行前) | +| notice_ways | list[notice_way] | 是 | 通知方式 | + + +### `notice_way` 数据格式 + +| 字段 | 类型 | 必须 | 描述 | +|------------|--------|--|--------------------------------| +| name | string | 是 | `weixin(微信)`, `sms(短信)`, `voice(语音通知)`, `wxwork-bot(企业微信机器人)` | +| receivers | list[str] | 否 | 通知接收人员:企业微信机器人为chatID, bkchat为对应的选项ID | + + +### `duty_arranges` 数据格式 +| 字段 | 类型 | 必须 | 描述 | +|----------------| ---- | ---- |--------------------------------| +| id |int|否| 轮值ID,保存时有id表示更新,没有id表示新增 | +| need_rotation | bool | 否| 是否需要交接班 | +| handoff_time |object|否| `need_rotation` 为`True`,此字段必填 | +| effective_time |string|是| 生效时间, 格式 `2022-03-11 00:00:00` | +| duty_time |list[object]|否| 工作时间配置,默认为每天 24小时工作 | +| duty_users |list[list[user]]|否| 值班人员组 | +| users |list[user]|否| 值班人员兼容老接口,不需要轮值的时候可以保留该字段 | +| duty_plans |list[user]|否| 参考生效参数表,格式可以下参考示例 | + +#### `user` 选项说明 +| 字段 | 类型 | 必须 | 描述 | +| ----- | ---- | ---- | ------------------ | +| id|string|是| 用户英文名或者角色代号 | +| type | string | 是| `group` or `user`| + +#### `handoff_time` 选项说明 +| 字段 | 类型 | 必须 | 描述 | +| ----- | ---- | ---- | ------------------ | +| rotation_type|string|是| 轮值类型,默认 `daily` | +| date | int | 否| 交班日期 | +| time | string | 是| 交班时间, 格式 `08:00` | + +`rotation_type`类型对应日期选择说明 + +| 轮值类型 | 对应选项说明 | +| ----- | ---- | +| daily | 为空,不需要设置 | +| weekly | 1,2,3,4,5,6,7 代表周一 至 周日, 如有全部选项,则设置为 [1,2,3,4,5,6,7]| +| monthly | 1-31号之间选择,如有全部选项,则设置为 [1,2,3,4,5,6,7...31] | + +#### `duty_time` 内元素选项说明 +| 字段 | 类型 | 必须 | 描述 | +| ----- | ---- | ---- | ------------------ | +| work_type|string|是| 轮值类型,默认 `daily`, 可选项 `daily`,`weekly`, `monthly` | +| work_days | list[int] | 否| 工作日期, 选项根据`work_type`,参考rotation_type的对应日期选项说明 | +| work_time | string | 是| 工作时间段 格式 `00:00--23:59` | + + +#### users 格式说明 + +| 字段 | 类型 | 描述 | +|--------------|--------|--------------------| +| id | string | 角色key或者用户ID | +| display_name | string | 显示名 | +| type | string | 类型,可选项`group`,`user` | +| members | list | 对应的人员信息(针对group类型) | + +#### 请求示例数据 + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "id": 69, + "name": "lunzhi", + "bk_biz_id": 2, + "desc": "xxxxx", + "duty_arranges": [ + { + "id": 90, + "user_group_id": 69, + "need_rotation": false, + "duty_time": [ + { + "work_type": "daily", + "work_days": [], + "work_time": "00:00--23:59" + } + ], + "effective_time": "2023-07-25 11:00:00", + "handoff_time": { + "date": 1, + "time": "00:00", + "rotation_type": "daily" + }, + "duty_users": [ + [ + { + "id": "bk_biz_maintainer", + "display_name": "运维人员", + "logo": "", + "type": "group", + "members": [] + } + ] + ], + "backups": [], + "order": 1 + } + ], + "alert_notice": [ + { + "time_range": "00:00:00--23:59:00", + "notify_config": [ + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "level": 3 + }, + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "level": 2 + }, + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "level": 1 + } + ] + } + ], + "action_notice": [ + { + "time_range": "00:00:00--23:59:00", + "notify_config": [ + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "phase": 3 + }, + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "phase": 2 + }, + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "phase": 1 + } + ] + } + ], + "need_duty": true, + "channels": [ + "user", + "wxwork-bot" + ] +} +``` + +### 响应参数 + +| 字段 | 类型 | 描述 | +| ------- | ------ | ------------ | +| result | bool | 请求是否成功 | +| code | int | 返回的状态码 | +| message | string | 描述信息 | +| data | dict | 数据 | +| request_id | str | ESB记录请求ID | + +#### data 格式说明: 参考获取告警组详情接口 + + diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_alarm_strategy_without_biz.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_alarm_strategy_without_biz.md index 229b4213c..72c78e42c 100644 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_alarm_strategy_without_biz.md +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_alarm_strategy_without_biz.md @@ -311,7 +311,7 @@ | 字段 | 类型 | 必选 | 描述 | |-----------------------------------|--------|-----|--------------| | options | dict | 是 | 通知套餐配置 | -| options.converge_config | dict | 是 | 收敛配置 | +| options.converge_config | string | 是 | 收敛配置 | | options.noise_reduce_config | dict | 否 | 降噪配置,不带默认不开启 | | options.start_time | string | 是 | 生效开始时间(格式:00:00:00) | | options.end_time | string | 是 | 生效结束时间(格式:23:59:59) | diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_alert.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_alert.md index d227776dc..107becf70 100644 --- a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_alert.md +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_alert.md @@ -18,7 +18,7 @@ | start_time | int | 是 | 开始时间 | | end_time | int | 是 | 结束时间 | | page | int | 是 | 页数 | -| page_size | int | 是 | 每页条数(最大500) | +| page_size | int | 是 | 每页条数(最大5000) | | show_overview | bool | 否 | 是否返回总览统计信息,默认 true | | show_aggs | bool | 否 | 是否返回聚合统计信息,默认 true | | show_dsl | Bool | 否 | 是否返回DSL,默认False | diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_rule_groups.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_rule_groups.md new file mode 100644 index 000000000..938bdedc0 --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_rule_groups.md @@ -0,0 +1,203 @@ +### 功能描述 + +查询规则组列表 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ---- | ---- |--| +| bk_biz_id | list | 否 | 业务ID | +| group_ids | list | 否 | 分派组 | + +#### 示例数据 + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "bk_biz_ids": [2], + "group_ids": [7] +} +``` + +### 响应参数 + +| 字段 | 类型 | 描述 | +| ------- |--------------|--------| +| result | bool | 请求是否成功 | +| code | int | 返回的状态码 | +| message | string | 描述信息 | +| data | list[object] | 分派组 | + +#### `data` 元素字段说明 + +| 字段 | 类型 | 描述 | +| --------------- |------------|-----------------| +| id | int | 分派组ID | +| bk_biz_id | int | 业务ID | +| name | string | 名称 | +| priority | int | 优先级 | +| rules | list[rule] | 通知人列表 | +| settings | dict | 前端快捷操作配置,API可忽略 | + + +#### `rule` 字段说明 +| 字段 | 类型 | 描述 | +| --------------- |-----------------|-------------------------------------| +| id | int | 规则ID | +| bk_biz_id | int | 业务ID,与组业务ID一致 | +| assign_group_id | int | 对应分派组ID | +| is_enabled | bool | 是否启用 | +| user_groups | list[ group_id] | 通知组ID列表 | +| conditions | list[condition] | 适配规则 | +| actions | list[action] | 通知配置 | +| alert_severity | int | 默认为0(维持不变),1,2,3分别对应 `致命` `预警` `提醒` | +| additional_tags | list[tag] | 添加标签 | + + +#### `tag` 字段说明 +| 字段 | 类型 | 描述 | +|---------------|--------|:----------------| +| key | string | 标签key, 可参考页面配置项 | +| value | string | 标签value值 | +| display_key | string | key的翻译显示 | +| display_value | string | value的翻译显示 | + +#### `condition` 字段说明 +| 字段 | 类型 | 描述 | +|------------|-----------|:------------------------------------------------------| +| field | string | 适配字段key, 可参考页面配置项 | +| value | list[string] | 适配value值 | +| method | string | 表达式方法 `eq` `neq` `include`, `exclude`, `reg`, `nreg` | +| condition | string | 连接条件,当前仅支持`and` | + +#### `action` 字段说明 +| 字段 | 类型 | 描述 | +|----------------|--------|--------------------------------| +| action_type | string | 处理套餐类型 `notice(通知)` `itsm(流程)` | +| upgrade_config | dict | 升级配置(通知的时候才有效) | +| is_enabled | bool | 是否生效,通知默认为`True` | +| action_id | int | 流程套餐ID(notice情况下不需要) | + +#### `upgrade_config` 字段说明 +| 字段 | 类型 | 描述 | +|----------------|-----------|--------------------------| +| user_groups | list[int] | 告警升级接收通知组(不可与当前规则的负责人重复) | +| upgrade_interval | int | 升级周期,单位分钟 | +| is_enabled | bool | 是否生效,通知默认为`True` | + + +#### 示例数据 + +```json +{ + "result": true, + "code": 200, + "message": "OK", + "data": [ + { + "id": 7, + "name": "分派测试11112", + "bk_biz_id": 2, + "priority": 10002, + "settings": {}, + "rules": [ + { + "id": 9, + "bk_biz_id": 2, + "assign_group_id": 7, + "is_enabled": true, + "user_groups": [ + 62 + ], + "conditions": [ + { + "field": "bcs_cluster_id", + "value": [ + "123" + ], + "method": "eq", + "condition": "and" + } + ], + "actions": [ + { + "action_type": "notice", + "upgrade_config": { + "is_enabled": true, + "user_groups": [ + 68 + ], + "upgrade_interval": 1440 + }, + "is_enabled": true + } + ], + "alert_severity": 1, + "additional_tags": [ + { + "key": "key1", + "value": "123value", + "display_key": "", + "display_value": "" + } + ] + }, + { + "id": 10, + "bk_biz_id": 2, + "assign_group_id": 7, + "is_enabled": true, + "user_groups": [ + 62 + ], + "conditions": [ + { + "field": "bcs_cluster_id", + "value": [ + "567890" + ], + "method": "eq", + "condition": "and" + } + ], + "actions": [ + { + "action_type": "notice", + "upgrade_config": { + "is_enabled": true, + "user_groups": [ + 68 + ], + "upgrade_interval": 1440 + }, + "is_enabled": true + }, + { + "action_type": "itsm", + "action_id": 1309, + "is_enabled": true + } + ], + "alert_severity": 1, + "additional_tags": [ + { + "key": "key1", + "value": "123value", + "display_key": "", + "display_value": "" + } + ] + } + ] + } + ], + "request_id": "b8cf17b82cd949e984011d890ac554df" +} +``` + diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_user_group_detail.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_user_group_detail.md new file mode 100644 index 000000000..cf2496ab7 --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_user_group_detail.md @@ -0,0 +1,276 @@ +### 功能描述 + +查询告警组 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| --------- | ---- | ---- | -------- | +| id | list | 否 | 通知组ID | + +#### 示例数据 + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "id": 77 +} +``` + +### 响应参数 + +| 字段 | 类型 | 描述 | +| ------- | ------ | ------------ | +| result | bool | 请求是否成功 | +| code | int | 返回的状态码 | +| message | string | 描述信息 | +| data | dict | 数据 | +| request_id | str | ESB记录请求ID | + +#### data字段说明 + +| 字段 | 类型 | 描述 | +|----------------|--------|------------------------------------------| +| bk_biz_id | int | 业务ID | +| name | string | 名称 | +| need_duty | bool | 是否轮值 | +| channels | list | 通知渠道 可选项 `user(内部用户)`, `wxwork-bot(企业微信机器人)` | +| id | int | 告警组ID | +| desc | string | 说明 | +| duty_arranges | list | 通知接收人员 | +| alert_notice | list | 告警通知方式 | +| action_notice | list | 告警处理通知配置 | +| strategy_count | int | 关联的告警策略数量 | +| delete_allowed | bool | 是否可删除 | +| edit_allowed | bool | 是否可编辑 | +| config_source | string | 配置来源 | +| update_time | string | 更新时间 | +| update_user | string | 更新人 | +| create_time | string | 创建时间 | +| create_user | string | 创建人 | + + +### `duty_arranges` 数据格式 +| 字段 | 类型 | 必须 | 描述 | +|----------------| ---- | ---- |--------------------------------| +| id |int|否| 轮值ID,保存时有id表示更新,没有id表示新增 | +| need_rotation | bool | 否| 是否需要交接班 | +| handoff_time |object|否| `need_rotation` 为`True`,此字段必填 | +| effective_time |string|是| 生效时间, 格式 `2022-03-11 00:00:00` | +| duty_time |list[object]|否| 工作时间配置,默认为每天 24小时工作 | +| duty_users |list[list[user]]|否| 值班人员组 | +| users |list[user]|否| 值班人员兼容老接口,不需要轮值的时候可以保留该字段 | +| duty_plans |list[user]|否| 参考生效参数表,格式可以下参考示例 | + +#### `user` 选项说明 +| 字段 | 类型 | 必须 | 描述 | +| ----- | ---- | ---- | ------------------ | +| id|string|是| 用户英文名或者角色代号 | +| type | string | 是| `group` or `user`| + +#### `handoff_time` 选项说明 +| 字段 | 类型 | 必须 | 描述 | +| ----- | ---- | ---- | ------------------ | +| rotation_type|string|是| 轮值类型,默认 `daily` | +| date | int | 否| 交班日期 | +| time | string | 是| 交班时间, 格式 `08:00` | + +`rotation_type`类型对应日期选择说明 + +| 轮值类型 | 对应选项说明 | +| ----- | ---- | +| daily | 为空,不需要设置 | +| weekly | 1,2,3,4,5,6,7 代表周一 至 周日, 如有全部选项,则设置为 [1,2,3,4,5,6,7]| +| monthly | 1-31号之间选择,如有全部选项,则设置为 [1,2,3,4,5,6,7...31] | + +#### `duty_time` 内元素选项说明 +| 字段 | 类型 | 必须 | 描述 | +| ----- | ---- | ---- | ------------------ | +| work_type|string|是| 轮值类型,默认 `daily`, 可选项 `daily`,`weekly`, `monthly` | +| work_days | list[int] | 否| 工作日期, 选项根据`work_type`,参考rotation_type的对应日期选项说明 | +| work_time | string | 是| 工作时间段 格式 `00:00--23:59` | + + +#### users 格式说明 + +| 字段 | 类型 | 描述 | +|--------------|--------|--------------------| +| id | string | 角色key或者用户ID | +| display_name | string | 显示名 | +| type | string | 类型,可选项`group`,`user` | +| members | list | 对应的人员信息(针对group类型) | + + +#### 示例数据 + +```json +{ + "result": true, + "code": 200, + "message": "OK", + "data": { + "id": 69, + "name": "lunzhi", + "bk_biz_id": 2, + "desc": "", + "update_user": "admin", + "update_time": "2023-07-25 11:48:19+0800", + "create_user": "admin", + "create_time": "2023-07-25 11:48:19+0800", + "duty_arranges": [ + { + "id": 90, + "user_group_id": 69, + "need_rotation": false, + "duty_time": [ + { + "work_type": "daily", + "work_days": [], + "work_time": "00:00--23:59" + } + ], + "effective_time": "2023-07-25T11:48:00+08:00", + "handoff_time": { + "date": 1, + "time": "00:00", + "rotation_type": "daily" + }, + "duty_users": [ + [ + { + "id": "bk_biz_maintainer", + "display_name": "运维人员", + "logo": "", + "type": "group", + "members": [] + } + ] + ], + "backups": [], + "order": 1 + } + ], + "alert_notice": [ + { + "time_range": "00:00:00--23:59:00", + "notify_config": [ + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "level": 3 + }, + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "level": 2 + }, + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "level": 1 + } + ] + } + ], + "action_notice": [ + { + "time_range": "00:00:00--23:59:00", + "notify_config": [ + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "phase": 3 + }, + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "phase": 2 + }, + { + "type": [], + "notice_ways": [ + { + "name": "weixin", + "receivers": [] + } + ], + "phase": 1 + } + ] + } + ], + "need_duty": true, + "path": "", + "channels": [ + "user", + "wxwork-bot" + ], + "users": [], + "strategy_count": 1, + "delete_allowed": false, + "edit_allowed": true, + "config_source": "UI", + "duty_plans": [ + { + "id": 1, + "user_group_id": 69, + "duty_arrange_id": 90, + "duty_time": [ + { + "work_days": [], + "work_time": "00:00--23:59", + "work_type": "daily" + } + ], + "begin_time": "2023-07-25 11:49:00+0800", + "end_time": null, + "users": [ + { + "id": "bk_biz_maintainer", + "display_name": "运维人员", + "logo": "", + "type": "group", + "members": [] + } + ], + "order": 1, + "is_active": true + } + ], + "rule_count": 0 + }, + "request_id": "496391f5c8a247709dc5a7184ddf9ab5" +} +``` + diff --git a/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_user_groups.md b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_user_groups.md new file mode 100644 index 000000000..d60cff52c --- /dev/null +++ b/paas2/esb/components/confapis/monitor_v3/apidocs/zh_hans/search_user_groups.md @@ -0,0 +1,113 @@ +### 功能描述 + +查询告警组 + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +| ---------- | ---- | ---- | -------- | +| bk_biz_ids | list | 否 | 业务ID | +| ids | list | 否 | 通知组ID | + +#### 示例数据 + +```json +{ + "bk_app_code": "xxx", + "bk_app_secret": "xxxxx", + "bk_token": "xxxx", + "bk_biz_ids": [2], + "ids": [1] +} +``` + +### 响应参数 + +| 字段 | 类型 | 描述 | +| ------- |--------|-----------| +| result | bool | 请求是否成功 | +| code | int | 返回的状态码 | +| message | string | 描述信息 | +| data | dict | 数据 | +| request_id | str | ESB记录请求ID | + + +#### data字段说明 + +| 字段 | 类型 | 描述 | +| --------------- |--------|-----------| +| bk_biz_id | int | 业务ID | +| name | string | 名称 | +| need_duty | bool | 是否轮值 | +| channels | list | 通知渠道 可选项 `user(内部用户)`, `wxwork-bot(企业微信机器人)` | +| id | int | 告警组ID | +| desc | string | 说明 | +| users | list | 通知接收人员 | +| strategy_count | int | 关联的告警策略数量 | +| delete_allowed | bool | 是否可删除 | +| edit_allowed | bool | 是否可编辑 | +| config_source | string | 配置来源 | +| update_time | string | 更新时间 | +| update_user | string | 更新人 | +| create_time | string | 创建人 | + +#### users 格式说明 + +| 字段 | 类型 | 描述 | +|--------------|--------|----------------------| +| id | string | 角色key或者用户ID | +| display_name | string | 显示名 | +| type | string | 类型,可选项`group`,`user` | +| members | list | 对应的人员信息 | + + +#### 示例数据 + +```json +{ + "result": true, + "code": 200, + "message": "OK", + "data": [ + { + "id": 62, + "name": "企业微信机器人1234", + "bk_biz_id": 2, + "need_duty": false, + "channels": [ + "user", + "wxwork-bot" + ], + "desc": "", + "update_user": "admin", + "update_time": "2023-09-08 17:54:31+0800", + "create_user": "admin", + "create_time": "2023-04-07 12:52:50+0800", + "app": "default", + "users": [ + { + "id": "bk_biz_maintainer", + "display_name": "运维人员", + "type": "group", + "members": [] + }, + { + "id": "admin", + "display_name": "admin", + "type": "user" + } + ], + "strategy_count": 6, + "delete_allowed": false, + "edit_allowed": true, + "config_source": "YAML" + } + ], + "request_id": "6b439ff5729b4e15b4b94b138b5f0fc1" +} +``` + diff --git a/paas2/esb/components/confapis/monitor_v3/monitor_v3.yaml b/paas2/esb/components/confapis/monitor_v3/monitor_v3.yaml index 166ae111d..dab7751b2 100644 --- a/paas2/esb/components/confapis/monitor_v3/monitor_v3.yaml +++ b/paas2/esb/components/confapis/monitor_v3/monitor_v3.yaml @@ -88,6 +88,18 @@ name: metadata_modify_result_table path: /v2/monitor_v3/metadata_modify_result_table/ method: POST + +- api_type: query + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: GET + dest_path: /api/v3/meta/is_data_label_exist/ + is_hidden: false + label: 判断结果表中是否存在指定data_label + label_en: whether data_label exist + name: metadata_is_data_label_exist + path: /v2/monitor_v3/metadata_is_data_label_exist/ + method: GET + - api_type: query comp_codename: generic.v2.monitor_v3.monitor_v3_component dest_http_method: GET @@ -98,6 +110,16 @@ name: metadata_get_data_id path: /v2/monitor_v3/metadata_get_data_id/ method: GET +- api_type: query + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v3/meta/query_data_source_by_space_uid/ + is_hidden: false + label: 根据space_uid查询data_source + label_en: metadata query data source by space_uid + name: metadata_query_data_source_by_space_uid + path: /v2/monitor_v3/metadata_query_data_source_by_space_uid/ + method: POST - api_type: query comp_codename: generic.v2.monitor_v3.monitor_v3_component dest_http_method: GET @@ -620,8 +642,46 @@ name: save_notice_group path: /v2/monitor_v3/save_notice_group/ suggest_method: POST - - +- api_type: query + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v4/user_group/search/ + is_hidden: false + label: 查询用户组(新版) + label_en: search user group latest + name: search_user_groups + path: /v2/monitor_v3/search_user_groups/ + suggest_method: POST +- api_type: query + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v4/user_group/search_detail/ + is_hidden: false + label: 查询单个用户组详情 + label_en: search user group detail + name: search_user_group_detail + path: /v2/monitor_v3/search_user_group_detail/ + suggest_method: POST +- api_type: operate + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v4/user_group/delete/ + is_hidden: false + label: 批量删除用户组 + label_en: delete user groups + name: delete_user_groups + path: /v2/monitor_v3/delete_user_groups/ + suggest_method: POST +- api_type: operate + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v4/user_group/save/ + is_hidden: false + label: 保存用户组 + label_en: save user group + name: save_user_group + path: /v2/monitor_v3/save_user_group/ + suggest_method: POST - api_type: operate comp_codename: generic.v2.monitor_v3.monitor_v3_component dest_http_method: POST @@ -699,6 +759,17 @@ path: /v2/monitor_v3/save_collect_config/ suggest_method: POST +- api_type: operate + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: GET + dest_path: /api/v4/collect/config_detail/ + is_hidden: true + label: 查询采集配置详情 + label_en: query collect config detail + name: query_collect_config_detail + path: /v2/monitor_v3/query_collect_config_detail/ + suggest_method: POST + - api_type: query comp_codename: generic.v2.monitor_v3.monitor_v3_component dest_http_method: POST @@ -2189,6 +2260,39 @@ path: /v2/monitor_v3/deploy_event_plugin/ method: POST +- api_type: operate + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v4/metrics/get_metric_list/ + is_hidden: false + label: 指标通用查询 + label_en: get metric list + name: get_metric_list + path: /v2/monitor_v3/get_metric_list/ + method: POST + +- api_type: operate + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v4/collector_plugin/plugin_import_without_frontend/ + is_hidden: true + label: 导入插件API + label_en: plugin_import_without_frontend + name: plugin_import_without_frontend + path: /v2/monitor_v3/plugin_import_without_frontend/ + suggest_method: POST + +- api_type: operate + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: GET + dest_path: /api/v4/collector_plugin/export_plugin/ + is_hidden: true + label: 导出插件 + label_en: export_plugin + name: export_plugin + path: /v2/monitor_v3/export_plugin/ + suggest_method: GET + - api_type: query comp_codename: generic.v2.monitor_v3.monitor_v3_component dest_http_method: GET @@ -2321,6 +2425,17 @@ path: /v2/monitor_v3/metadata_update_registered_cluster/ method: POST +- api_type: query + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: GET + dest_path: /api/v3/meta/query_data_source/ + is_hidden: true + label: 查询数据源 + label_en: query_data_source + name: metadata_query_data_source + path: /v2/monitor_v3/metadata_query_data_source/ + method: GET + - api_type: operate comp_codename: generic.v2.monitor_v3.monitor_v3_component dest_http_method: POST @@ -2397,14 +2512,63 @@ name: apm_application_info_by_app_name path: /v2/monitor_v3/apm/application_info_by_app_name/ suggest_method: GET - +- api_type: operate + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v4/as_code/import_config/ + is_hidden: true + label: 【AS_CODE】导入配置 + label_en: import as code config + name: as_code_import_config + path: /v2/monitor_v3/as_code/import_config/ + suggest_method: POST - api_type: query comp_codename: generic.v2.monitor_v3.monitor_v3_component dest_http_method: POST - dest_path: /api/v3/meta/query_data_source_by_space_uid/ + dest_path: /api/v4/as_code/export_config/ + is_hidden: true + label: 导出yaml配置 + label_en: export as code config + name: as_code_export_config + path: /v2/monitor_v3/as_code/export_config/ + suggest_method: POST +- api_type: query + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v4/alert_assign/search_rule_groups/ is_hidden: false - label: 根据space_uid查询data_source - label_en: metadata query data source by space_uid - name: metadata_query_data_source_by_space_uid - path: /v2/monitor_v3/metadata_query_data_source_by_space_uid/ - method: POST + label: 查询分派组 + label_en: search assign group + name: search_rule_groups + path: /v2/monitor_v3/assign/search_rule_groups/ + suggest_method: POST +- api_type: operate + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v4/alert_assign/save_rule_group/ + is_hidden: false + label: 保存分派组 + label_en: save assign group + name: save_rule_group + path: /v2/monitor_v3/assign/save_rule_group/ + suggest_method: POST +- api_type: operate + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v4/alert_assign/delete_rule_group/ + is_hidden: false + label: 删除分派组 + label_en: delete assign group + name: delete_rule_group + path: /v2/monitor_v3/assign/delete_rule_group/ + suggest_method: POST +- api_type: operate + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: POST + dest_path: /api/v4/grafana/log/query/ + is_hidden: false + label: 事件检索 + label_en: grafana log query + name: grafana_log_query + path: /v2/monitor_v3/log_query/ + suggest_method: POST diff --git a/paas2/esb/components/confapis/nodeman/nodeman.yaml b/paas2/esb/components/confapis/nodeman/nodeman.yaml index 8d1225a8f..e5b086956 100644 --- a/paas2/esb/components/confapis/nodeman/nodeman.yaml +++ b/paas2/esb/components/confapis/nodeman/nodeman.yaml @@ -1165,3 +1165,80 @@ dest_http_method: POST suggest_method: POST is_hidden: true + +- api_type: operate + comp_codename: generic.v2.nodeman.nodeman_component + name: ipchooser_host_check + label: 根据用户手动输入的`IP`/`IPv6`/`主机名`/`host_id`等关键字信息获取真实存在的机器信息 + label_en: null + dest_path: /core/api/ipchooser_host/check/ + path: /v2/nodeman/core/api/ipchooser_host/check/ + dest_http_method: POST + suggest_method: POST + is_hidden: true + +- api_type: operate + comp_codename: generic.v2.nodeman.nodeman_component + name: ipchooser_host_details + label: 根据主机关键信息获取机器详情信息 + label_en: null + dest_path: /core/api/ipchooser_host/details/ + path: /v2/nodeman/core/api/ipchooser_host/details/ + dest_http_method: POST + suggest_method: POST + is_hidden: true + +- api_type: operate + comp_codename: generic.v2.nodeman.nodeman_component + name: ipchooser_topo_agent_statistics + label: 获取多个拓扑节点的主机 Agent 状态统计信息 + label_en: null + dest_path: /core/api/ipchooser_topo/agent_statistics/ + path: /v2/nodeman/core/api/ipchooser_topo/agent_statistics/ + dest_http_method: POST + suggest_method: POST + is_hidden: true + +- api_type: operate + comp_codename: generic.v2.nodeman.nodeman_component + name: ipchooser_topo_query_host_id_infos + label: 根据多个拓扑节点与搜索条件批量分页查询所包含的主机 ID 信息 + label_en: null + dest_path: /core/api/ipchooser_topo/query_host_id_infos/ + path: /v2/nodeman/core/api/ipchooser_topo/query_host_id_infos/ + dest_http_method: POST + suggest_method: POST + is_hidden: true + +- api_type: operate + comp_codename: generic.v2.nodeman.nodeman_component + name: ipchooser_topo_query_hosts + label: 根据多个拓扑节点与搜索条件批量分页查询所包含的主机信息 + label_en: null + dest_path: /core/api/ipchooser_topo/query_hosts/ + path: /v2/nodeman/core/api/ipchooser_topo/query_hosts/ + dest_http_method: POST + suggest_method: POST + is_hidden: true + +- api_type: operate + comp_codename: generic.v2.nodeman.nodeman_component + name: ipchooser_topo_query_path + label: 查询多个节点拓扑路径 + label_en: null + dest_path: /core/api/ipchooser_topo/query_path/ + path: /v2/nodeman/core/api/ipchooser_topo/query_path/ + dest_http_method: POST + suggest_method: POST + is_hidden: true + +- api_type: operate + comp_codename: generic.v2.nodeman.nodeman_component + name: ipchooser_topo_trees + label: 批量获取含各节点主机数量的拓扑树 + label_en: null + dest_path: /core/api/ipchooser_topo/trees/ + path: /v2/nodeman/core/api/ipchooser_topo/trees/ + dest_http_method: POST + suggest_method: POST + is_hidden: true From 7f6d540d5cee859457d2c283e4de90a0278468f8 Mon Sep 17 00:00:00 2001 From: alex-smile <443677891@qq.com> Date: Fri, 8 Dec 2023 15:28:52 +0800 Subject: [PATCH 2/2] update monitor_v3 --- .../components/confapis/monitor_v3/monitor_v3.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/paas2/esb/components/confapis/monitor_v3/monitor_v3.yaml b/paas2/esb/components/confapis/monitor_v3/monitor_v3.yaml index dab7751b2..c254b7b5b 100644 --- a/paas2/esb/components/confapis/monitor_v3/monitor_v3.yaml +++ b/paas2/esb/components/confapis/monitor_v3/monitor_v3.yaml @@ -2572,3 +2572,14 @@ name: grafana_log_query path: /v2/monitor_v3/log_query/ suggest_method: POST +- api_type: query + comp_codename: generic.v2.monitor_v3.monitor_v3_component + dest_http_method: GET + dest_path: /api/v3/meta/query_result_table_storage_detail/ + is_hidden: true + label: 查询结果表的存储信息 + label_en: query result table storage detail + name: metadata_query_result_table_storage_detail + path: /v2/monitor_v3/metadata_query_result_table_storage_detail/ + method: GET +