### GET Request Example for Job Instance List Source: https://github.com/tencentblueking/bk-job/blob/master/ai_agent/user/skills/bk-job/reference/apidocs/v4_get_job_instance_list.md This example demonstrates how to construct a GET request to retrieve a list of job instances. It includes common query parameters for filtering. ```http /api/v4/get_job_instance_list?bk_scope_type=biz&bk_scope_id=1&type=0&launch_mode=1&status=3&operator=admin&name=test&create_time_start=1546272000000&create_time_end=1577807999999&offset=40&length=20 ``` -------------------------------- ### GET Request Example for Job Instance List Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_list.md This example demonstrates how to construct a GET request to retrieve a list of job instances. It includes common query parameters for filtering and pagination. ```http /api/v3/get_job_instance_list?bk_scope_type=biz&bk_scope_id=1&type=0&launch_mode=1&status=3&operator=admin&name=test&create_time_start=1546272000000&create_time_end=1577807999999&start=0&length=20 ``` -------------------------------- ### Get Job Plan List Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/ai_agent/user/skills/bk-job/reference/apidocs/get_job_plan_list.md This example demonstrates how to construct a GET request to the API to fetch job plans. It includes common query parameters for filtering and pagination. ```http /api/v3/get_job_plan_list?bk_scope_type=biz&bk_scope_id=1&job_template_id=1&creator=admin&name=test&create_time_start=1546272000000&create_time_end=1577807999999&start=0&length=20 ``` -------------------------------- ### Get Script List Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_script_list.md This example demonstrates how to construct a GET request to retrieve a list of scripts. It includes query parameters for scope, name, language, and pagination. ```http /api/v3/get_script_list?bk_scope_type=biz&bk_scope_id=1&name=script1&script_language=1&start=0&length=10 ``` -------------------------------- ### GET Request Example for Job Instance IP Log Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_ip_log.md This example demonstrates how to construct a GET request to retrieve job instance IP logs. Ensure all required query parameters are correctly provided. ```bash /api/v3/get_job_instance_ip_log?bk_scope_type=biz&bk_scope_id=1&job_instance_id=50&step_instance_id=100&bk_cloud_id=0&ip=127.0.0.1 ``` -------------------------------- ### Start a Microservice using Shell Script Source: https://github.com/tencentblueking/bk-job/blob/master/docs/install/backend.md Example of how to start a specific microservice using its provided shell script. Ensure JAVA_HOME is correctly configured before execution. ```shell cd /data/bkee/job/backend/job-config/bin ./job-config.sh start ``` -------------------------------- ### Get Account List Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_account_list.md This example demonstrates how to construct a GET request to retrieve account lists. It includes parameters for scope type, scope ID, category, account name, alias, and pagination. ```http /api/v3/get_account_list?bk_scope_type=biz&bk_scope_id=1&category=1&account=aaa&alias=aaa&start=0&length=1 ``` -------------------------------- ### GET Request Example for Public Script Version List Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_public_script_version_list.md This example demonstrates how to make a GET request to retrieve a list of public script versions. It includes query parameters for script ID, whether to return script content, and pagination settings. ```bash GET /api/v3/get_public_script_version_list?script_id=000dbdddc06c453baf1f2decddf00c69&return_script_content=true&start=0&length=10 ``` -------------------------------- ### Get Job Plan Detail Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/ai_agent/user/skills/bk-job/reference/apidocs/get_job_plan_detail.md Example of a GET request to retrieve job plan details. Ensure to include scope type, scope ID, and job plan ID as query parameters. ```http /api/v3/get_job_plan_detail?bk_scope_type=biz&bk_scope_id=1&job_plan_id=100 ``` -------------------------------- ### Get Job Plan Detail Example Source: https://github.com/tencentblueking/bk-job/blob/master/ai_agent/user/skills/bk-job/reference/apidocs/get_job_plan_detail.md This example demonstrates the structure of the response when retrieving the details of a job plan. It includes information about the plan's scope, creator, timestamps, global variables, and the list of steps involved in the job execution. ```APIDOC ## Get Job Plan Detail ### Description Retrieves the detailed configuration of a specific job plan. ### Method GET ### Endpoint `/job/plan/{job_plan_id}` ### Parameters #### Path Parameters - **job_plan_id** (integer) - Required - The ID of the job plan to retrieve. ### Response #### Success Response (200) - **result** (boolean) - Indicates if the operation was successful. - **code** (integer) - The status code of the operation. - **data** (object) - Contains the job plan details. - **bk_scope_type** (string) - The scope type of the job plan (e.g., 'biz'). - **bk_scope_id** (string) - The scope ID of the job plan. - **job_plan_id** (integer) - The ID of the job plan. - **name** (string) - The name of the job plan. - **creator** (string) - The user who created the job plan. - **create_time** (integer) - The timestamp when the job plan was created. - **last_modify_user** (string) - The user who last modified the job plan. - **last_modify_time** (integer) - The timestamp when the job plan was last modified. - **global_var_list** (array) - A list of global variables defined for the job plan. - **id** (integer) - The ID of the global variable. - **type** (integer) - The type of the global variable. - **name** (string) - The name of the global variable. - **value** (string) - The value of the global variable. - **description** (string) - A description of the global variable. - **required** (integer) - Indicates if the global variable is required. - **server** (object) - Server configuration for the global variable (if applicable). - **step_list** (array) - A list of steps in the job plan. - **id** (integer) - The ID of the step. - **type** (integer) - The type of the step. - **name** (string) - The name of the step. - **script_info** (object) - Information about a script step. - **script_type** (integer) - The type of the script. - **script_timeout** (integer) - The timeout for script execution. - **script_content** (string) - The content of the script. - **script_param** (string) - Parameters for the script. - **is_param_sensitive** (integer) - Indicates if script parameters are sensitive. - **account** (string) - The account to execute the script with. - **script_id** (string) - The ID of the script (if using a pre-defined script). - **script_version_id** (integer) - The version ID of the script. - **file_info** (object) - Information about a file step. - **file_source** (array) - Details about the source of the files. - **file_destination** (object) - Details about the destination of the files. #### Response Example ```json { "result": true, "code": 0, "data": { "bk_scope_type": "biz", "bk_scope_id": "1", "job_plan_id": 100, "name": "test", "creator": "admin", "create_time": 1546272000000, "last_modify_user": "admin", "last_modify_time": 1577807999999, "global_var_list": [ { "id": 11, "type": 1, "name": "varName", "value": "value is Me", "description": "hello", "required": 1 }, { "id": 12, "type": 3, "name": "servers", "description": "", "required": 0, "server": { "dynamic_group_list": [ { "id": "blo8gojho0skft7pr5q0" }, { "id": "blo8gojho0sabc7priuy" } ], "ip_list": [ { "bk_host_id": 101, "bk_cloud_id": 0, "ip": "127.0.0.1" }, { "bk_host_id": 102, "bk_cloud_id": 0, "ip": "127.0.0.2" } ], "topo_node_list": [ { "id": 1000, "node_type": "module" } ] } } ], "step_list": [ { "id": 1059, "type": 1, "name": "run local script", "script_info": { "script_type": 1, "script_timeout": 1000, "script_content": "ZWNobyAkMSAkMiAkMw==", "script_param": "YTEgYTIgYTM=", "is_param_sensitive": 0, "account": "root" } }, { "id": 1060, "type": 1, "name": "run cite script", "script_info": { "script_type": 2, "script_id": "aaaaa-bbb-ccc-ddddd", "script_version_id": 1078, "script_timeout": 1000, "script_param": "YTEgYTIgYTM=", "is_param_sensitive": 1, "account": "root" } }, { "id": 1061, "type": 2, "name": "xxx", "file_info": { "file_source": [ { "file_list": [ "/tmp/REGEX:[a-z]*.txt" ], "server": { "variable": "servers" }, "account": { "id": 1, "name": "root" }, "file_type": 1 }, { "file_list": [ "testbucket/test.txt" ], "file_type": 3, "file_source_id": 1 } ], "file_destination": { "path": "/tmp/", "account": { "id": 1, "name": "root" }, "server": { "variable": "", "dynamic_group_list": [ { "id": "blo8gojho0skft7pr5q0" }, { "id": "blo8gojho0sabc7priuy" } ], "ip_list": [ { "bk_host_id": 103, "bk_cloud_id": 0, "ip": "127.0.0.3" }, { "bk_host_id": 104, "bk_cloud_id": 0, "ip": "127.0.0.4" } ], "topo_node_list": [ ] } } } } ] } } ``` ``` -------------------------------- ### GET Request Example for Job Instance Status Source: https://github.com/tencentblueking/bk-job/blob/master/ai_agent/user/skills/bk-job/reference/apidocs/v4_get_job_instance_status.md This example demonstrates how to make a GET request to the API to retrieve the status of a job instance. Ensure you provide the necessary query parameters like bk_scope_type, bk_scope_id, and job_instance_id. ```bash /api/v4/get_job_instance_status?bk_scope_type=biz&bk_scope_id=1&job_instance_id=100&return_ip_result=true ``` -------------------------------- ### Get Script Version Detail Response Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_script_version_detail.md This is an example of a successful response when querying for script version details. It includes metadata such as script ID, version, content, status, and timestamps. ```json { "result": true, "code": 0, "message": "success", "data": { "id": 1, "bk_scope_type": "biz", "bk_scope_id": "1", "script_id": "000dbdddc06c453baf1f2decddf00c69", "version": "V1.0", "content": "#!/bin/bash***", "status": 1, "version_desc": "版本描述", "creator": "admin", "create_time": 1600746078520, "last_modify_user": "admin", "last_modify_time": 1600746078520, "script_language": 1, "description": "脚本描述" } } ``` -------------------------------- ### Get Job Plan Detail Example Source: https://github.com/tencentblueking/bk-job/blob/master/ai_agent/user/skills/bk-job/reference/apidocs/get_job_plan_detail.md This example shows the structure of the response when retrieving the details of a job plan. ```APIDOC ## GET /job/plan/{job_plan_id} ### Description Retrieves the detailed plan of a specific job. ### Endpoint /job/plan/{job_plan_id} ### Response #### Success Response (200) - **job_plan_id** (integer) - The ID of the job plan. - **job_request_id** (string) - The ID of the job request. - **steps** (array) - A list of steps in the job plan. - **id** (integer) - The ID of the step. - **type** (integer) - The type of the step. - **action_type** (integer) - The action type of the step. - **name** (string) - The name of the step. - **script_param** (object) - Parameters for script execution. - **script_content** (string) - The content of the script. - **script_args** (string) - Arguments for the script. - **file_param** (object) - Parameters for file transfer. - **file_path** (string) - The path of the file. - **account** (string) - The account to use for file transfer. - **server_list** (array) - A list of servers for file transfer. - **ip** (string) - The IP address of the server. - **alias** (string) - The alias of the server. - **cloud_area_id** (integer) - The cloud area ID. - **node_type** (string) - The type of the node. - **timeout** (integer) - The timeout for the step in seconds. - **transfer_mode** (integer) - The transfer mode. - **upload_speed_limit** (integer) - The upload speed limit in KB/s. - **download_speed_limit** (integer) - The download speed limit in KB/s. ### Response Example ```json { "job_plan_id": 123, "job_request_id": "xxx", "steps": [ { "id": 1, "type": 1, "action_type": 1, "name": "Step 1", "script_param": { "script_content": "echo hello", "script_args": "" }, "file_param": { "file_path": "/tmp/test.txt", "account": "root", "server_list": [ { "ip": "192.168.1.1", "alias": "server1", "cloud_area_id": 1, "node_type": "module" } ] }, "timeout": 60, "transfer_mode": 1, "upload_speed_limit": 1000, "download_speed_limit": 1000 } ] } ``` ``` -------------------------------- ### Get Script Version Detail Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_script_version_detail.md This example demonstrates how to make a GET request to the API to retrieve the details of a script version. Ensure you provide the necessary query parameters such as bk_scope_type, bk_scope_id, and optionally id, script_id, or version. ```http GET /api/v3/get_script_version_detail?bk_scope_type=biz&bk_scope_id=1&id=1 ``` -------------------------------- ### GET Request for File Source Detail Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_file_source_detail.md This example demonstrates how to make a GET request to the API to retrieve the details of a file source. Ensure you provide the correct scope type, scope ID, and file source code in the query parameters. ```bash GET /api/v3/get_file_source_detail?bk_scope_type=biz&bk_scope_id=2&code=bkrepo-1 ``` -------------------------------- ### Get Account List Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/get_account_list.md This is an example of a request payload for the Get Account List API. It includes common parameters like `bk_app_code`, `bk_app_secret`, and `bk_token`, along with specific parameters for filtering accounts such as `bk_scope_type`, `bk_scope_id`, `category`, `account`, `alias`, `start`, and `length`. ```json { "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", "bk_scope_type": "biz", "bk_scope_id": "1", "category": 1, "account": "aaa", "alias": "aaa", "start": 0, "length": 1 } ``` -------------------------------- ### Response Example for Get Public Script List Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_public_script_list.md This JSON object shows a successful response from the Get Public Script List API. It includes the `result`, `code`, and `message` fields, along with a `data` object containing the list of scripts, pagination information (`start`, `length`), and the `total` count. ```json { "result": true, "code": 0, "message": "success", "data": { "data": [ { "id": "000dbdddc06c453baf1f2decddf00c69", "name": "a.sh", "script_language": 1, "online_script_version_id": 100, "creator": "admin", "create_time": 1600746078520, "last_modify_user": "admin", "last_modify_time": 1600746078520 } ], "start": 0, "length": 10, "total": 1 } } ``` -------------------------------- ### POST Request Example for Pushing Configuration File Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/push_config_file.md This example demonstrates how to structure a POST request to push a configuration file. It includes details for specifying the scope, account, target path, file content (Base64 encoded), and target servers via dynamic groups, host IDs, or topology nodes. ```json { "bk_scope_type": "biz", "bk_scope_id": "1", "account_alias": "root", "file_target_path": "/tmp/", "file_list": [ { "file_name": "a.txt", "content": "aGVsbG8gd29ybGQh" } ], "target_server": { "dynamic_group_list": [ { "id": "blo8gojho0skft7pr5q0" } ], "host_id_list": [ 101, 102 ], "topo_node_list": [ { "id": 1000, "node_type": "module" } ] }, "job_request_id": "xxx" } ``` -------------------------------- ### Response Example for Get Latest Service Version Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_latest_service_version.md This is an example of a successful response from the Get Latest Service Version API, indicating the current latest version of the service. ```json { "result": true, "code": 0, "data": { "version": "3.6.4" }, "job_request_id": "xxx" } ``` -------------------------------- ### Setup Virtual Environment Source: https://github.com/tencentblueking/bk-job/blob/master/ai_agent/op/skills/task-duration-analysis/SKILL.md Automates the creation of a Python virtual environment and installation of dependencies. Run this script before using any Python scripts in the skill. ```bash ./setup_venv.sh ``` -------------------------------- ### Get Job Instance Status Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_job_instance_status.md Example of a GET request to query the status of a job instance. Ensure to replace placeholder values with actual IDs and scope information. ```http GET /api/v3/get_job_instance_status?bk_scope_type=biz&bk_scope_id=1&job_instance_id=100&return_ip_result=true ``` -------------------------------- ### Run BK-Job API Gateway Client Help Source: https://github.com/tencentblueking/bk-job/blob/master/ai_agent/user/skills/bk-job/SKILL.md Execute this command to view the help information for the `job_apigw_client.py` script. Ensure your current directory is the skill's root or provide the script's absolute path. ```bash cd /path/to/bk-job python scripts/job_apigw_client.py --help ``` -------------------------------- ### POST Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/batch_get_job_instance_ip_log.md This example demonstrates how to construct a POST request to retrieve job instance logs. Ensure you include the necessary authorization headers and body parameters. ```json { "bk_scope_type": "biz", "bk_scope_id": "1", "job_instance_id": 100, "step_instance_id": 200, "host_id_list": [ 101, 102 ] } ``` -------------------------------- ### Get Cron Detail Response Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_cron_detail.md This is an example of a successful response from the Get Cron Detail API. It includes details about the job's scope, schedule, global variables, and metadata. ```json { "result": true, "code": 0, "data": { "bk_scope_type": "biz", "bk_scope_id": "1", "job_plan_id": 100, "id": 1, "name": "test", "status": 1, "expression": "0/5 * * * ?", "execute_time_zone": "Asia/Shanghai", "global_var_list": [ { "id": 436, "name": "ip", "server": { "dynamic_group_list": [ { "id": "blo8gojho0skft7pr5q0" }, { "id": "blo8gojho0sabc7priuy" } ], "ip_list": [ { "bk_host_id": 101, "bk_cloud_id": 0, "ip": "127.0.0.1" }, { "bk_host_id": 102, "bk_cloud_id": 0, "ip": "127.0.0.2" } ], "topo_node_list": [ { "id": 1000, "node_type": "module" } ] } }, { "id": 437, "name": "text", "value": "new String value" } ], "creator": "admin", "create_time": 1546272000000, "last_modify_user": "admin", "last_modify_time": 1577807999999 }, "job_request_id": "xxx" } ``` -------------------------------- ### Create System Account Response Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/esb/jobv3-confapis/apidocs/zh_hans/create_account.md This JSON object shows a successful response after creating a system account. It includes the account details and creation metadata. ```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" } ``` -------------------------------- ### Request Example for Get Public Script List Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/esb/jobv3-confapis/apidocs/en/get_public_script_list.md This JSON object demonstrates how to structure a request to query the public script list. It includes common parameters like `bk_app_code` and `bk_token`, along with specific filters such as `name` and `script_language`, and pagination controls `start` and `length`. ```json { "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", "name": "a.sh", "script_language": 1, "start": 0, "length": 10 } ``` -------------------------------- ### Initialize Personal Repository Source: https://github.com/tencentblueking/bk-job/blob/master/docs/specification/git-workflow.md Steps to fork the main repository, clone your personal fork, and add the upstream remote for synchronization. ```shell # 1. 在 GitHub 上 Fork bk-job 主仓库到个人账号 # 访问 https://github.com/TencentBlueKing/bk-job,点击右上角 Fork 按钮 # 2. 克隆个人仓库到本地 git clone https://github.com/<你的GitHub用户名>/bk-job.git cd bk-job # 3. 添加主仓库(upstream)为远程仓库 git remote add upstream https://github.com/TencentBlueKing/bk-job.git # 4. 验证远程仓库配置 git remote -v # origin https://github.com/<你的GitHub用户名>/bk-job.git (fetch) # origin https://github.com/<你的GitHub用户名>/bk-job.git (push) # upstream https://github.com/TencentBlueKing/bk-job.git (fetch) # upstream https://github.com/TencentBlueKing/bk-job.git (push) ``` -------------------------------- ### Get Public Script List Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_public_script_list.md This example demonstrates how to construct a GET request to retrieve a list of public scripts. You can filter by script name, language, and specify pagination parameters. ```bash /api/v3/get_public_script_list?name=script1&script_language=1&start=0&length=10 ``` -------------------------------- ### Get Step Instance Status Response Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_step_instance_status.md Example of a successful response from the Get Step Instance Status API. It details the status of the step instance, including results grouped by type and host. ```json { "result": true, "code": 0, "data": { "step_instance_id": 75, "execute_count": 0, "name": "API Quick execution scriptxxx", "type": 1, "status": 4, "create_time": 1605064271000, "start_time": 1605064271000, "end_time": 1605064272000, "total_time": 1000, "step_result_group_list": [ { "result_type": 9, "result_type_desc": "执行成功", "tag": "tag1", "host_size": 2, "host_result_list": [ { "bk_host_id": 101, "ip": "127.0.0.1", "ipv6": null, "bk_agent_id": null, "bk_cloud_id": 0, "bk_cloud_name": "Default Area", "status": 9, "status_desc": "执行成功", "tag": "tag1", "exit_code": 0, "start_time": 1605064271000, "end_time": 1605064272000, "total_time": 1000 } ] }, { "result_type": 9, "result_type_desc": "执行成功", "tag": "tag2", "host_size": 2, "host_result_list": [ { "bk_host_id": 102, "ip": "127.0.0.2", "ipv6": null, "bk_agent_id": null, "bk_cloud_id": 0, "bk_cloud_name": "Default Area", "status": 9, "status_desc": "执行成功", "tag": "tag2", "exit_code": 0, "start_time": 1605064271000, "end_time": 1605064272000, "total_time": 1000 } ] } ] }, "job_request_id": "xxx" } ``` -------------------------------- ### Response Example for Operating Step Instance Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/operate_step_instance.md This is a sample successful response when operating a step instance. It confirms the operation and returns the relevant job and step instance IDs. ```json { "result": true, "code": 0, "data": { "step_instance_id": 200, "job_instance_id": 100 }, "job_request_id": "xxx" } ``` -------------------------------- ### Get Step Instance Status Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_step_instance_status.md Example of a GET request to retrieve the status of a step instance. Ensure all parameters like bk_scope_type, bk_scope_id, job_instance_id, step_instance_id, and execute_count are correctly provided. ```json /api/v3/get_step_instance_status?bk_scope_type=biz&bk_scope_id=1&job_instance_id=100&step_instance_id=100&execute_count=0&batch=0&max_host_num_per_group=1&keyword=aaa&search_ip=&status=9&tag= ``` -------------------------------- ### Start Local HTTPS Development Server Source: https://github.com/tencentblueking/bk-job/blob/master/src/frontend/readme.md Execute this command in the frontend directory to launch a local HTTPS development server. A `.env.external` file with the appropriate AJAX URL prefix is required. ```bash npm run dev-external ``` -------------------------------- ### Get Script Version List Response Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_script_version_list.md This is an example of a successful response from the Get Script Version List API. It includes details about the script versions, pagination information, and the total number of records. ```json { "result": true, "code": 0, "data": { "data": [ { "id": 1, "bk_scope_type": "biz", "bk_scope_id": "1", "script_id": "000dbdddc06c453baf1f2decddf00c69", "version": "V1.0", "content": "#!/bin/bash", "status": 1, "version_desc": "版本描述", "creator": "admin", "create_time": 1600746078520, "last_modify_user": "admin", "last_modify_time": 1600746078520, "script_language": 1, "public_script": false, "description": "脚本描述" } ], "start": 0, "length": 10, "total": 1 }, "job_request_id": "xxx" } ``` -------------------------------- ### Example User Response Format Source: https://github.com/tencentblueking/bk-job/blob/master/ai_agent/op/rules/回答用户时带上日志平台查询链接.md This example shows the complete response format for a user query, including task information, analysis report, and the log platform query link. ```Markdown --- ### 任务信息 - **request_id**: `b02df4aec7bd263a9b4f727eb605fad9` ### 分析报告 (根据日志内容提供的分析...) - 任务执行时间:xxx - 执行结果:xxx - 异常/错误信息:xxx(如有) ### 日志平台查询链接 如需查看完整的链路日志,请访问以下链接: 🔗 [点击查看完整日志](&start_time=now-7d&end_time=now&interval=auto&search_mode=sql&keyword=request_id%253A%2520%2522b02df4aec7bd263a9b4f727eb605fad9%2522) --- ``` -------------------------------- ### Create File Source Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/esb/jobv3-confapis/apidocs/en/create_file_source.md This JSON object demonstrates the parameters required to create a new BlueKing Repository file source. Ensure all required fields like scope, code, alias, type, and access parameters are correctly populated. ```json { "bk_app_code": "esb_test", "bk_app_secret": "xxx", "bk_token": "xxx", "bk_scope_type": "biz", "bk_scope_id": "1", "code": "sopsArtifactory", "alias": "SOPS BK-REPO File Source ", "type": "BLUEKING_ARTIFACTORY", "access_params": { "base_url": "https://bkrepo.com" }, "credential_id": "06644309e10e4068b3c7b32799668210", "file_prefix": "" } ``` -------------------------------- ### Get Cron Detail Request Example Source: https://github.com/tencentblueking/bk-job/blob/master/docs/apidoc/bk-api-gateway/v3/zh/get_cron_detail.md This example demonstrates how to construct a GET request to retrieve the details of a specific scheduled job. Ensure you provide the correct scope type, scope ID, and job ID. ```http /api/v3/get_cron_detail?bk_scope_type=biz&bk_scope_id=1&id=1 ```