### Create Template Request Parameters Example (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/create_template.md This JSON snippet provides an example of the required and optional parameters for creating a template. It includes essential application credentials (`bk_app_code`, `bk_app_secret`), user identification (`bk_username` or `bk_token`), and the mandatory `name` field for the new template. ```json { "bk_app_code": "xxxx", "bk_app_secret": "xxxx", "bk_username or bk_token": "xxxx", "name": "模板名" } ``` -------------------------------- ### Example Response for Get Flow Details API (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/get_template_detail.md This JSON object represents a successful response from the API to retrieve flow details. It includes the overall result status, a unique trace ID, and the `data` field containing the detailed flow information, such as `id`, `name`, `pipeline_tree` (which describes the flow's structure with start/end events, activities, and flows), and other metadata. The `pipeline_tree` specifically shows how a flow is constructed with components like `example_component`. ```json { "result": true, "data": { "id": 3, "space_id": 2, "name": "测试模板", "desc": null, "notify_config": {}, "scope_type": null, "scope_value": null, "pipeline_tree": { "id": "p92c20c7854104dd3975f46a1d8664417", "start_event": { "incoming": "", "outgoing": "f06a78d1dcbe64fb79136b07eb7e71309", "type": "EmptyStartEvent", "id": "ec628b28ea1c74e11b92b6be3bdc0e1b6", "name": null }, "end_event": { "incoming": [ "f5b91a6141a504b1b86f932d7e6c021f0" ], "outgoing": "", "type": "EmptyEndEvent", "id": "e7533e78a1a724b51942fcdf63fa23a60", "name": null }, "activities": { "e2945819d402e41a9b9f8252a1b806f1c": { "incoming": [ "f06a78d1dcbe64fb79136b07eb7e71309" ], "outgoing": "f5b91a6141a504b1b86f932d7e6c021f0", "type": "ServiceActivity", "id": "e2945819d402e41a9b9f8252a1b806f1c", "name": null, "error_ignorable": false, "timeout": null, "skippable": true, "retryable": true, "component": { "code": "example_component", "inputs": {} }, "optional": false } }, "gateways": {}, "flows": { "f06a78d1dcbe64fb79136b07eb7e71309": { "is_default": false, "source": "ec628b28ea1c74e11b92b6be3bdc0e1b6", "target": "e2945819d402e41a9b9f8252a1b806f1c", "id": "f06a78d1dcbe64fb79136b07eb7e71309" }, "f5b91a6141a504b1b86f932d7e6c021f0": { "is_default": false, "source": "e2945819d402e41a9b9f8252a1b806f1c", "target": "e7533e78a1a724b51942fcdf63fa23a60", "id": "f5b91a6141a504b1b86f932d7e6c021f0" } }, "data": { "inputs": {}, "outputs": [] } }, "source": null, "version": "", "is_enabled": true, "extra_info": {} }, "code": 0, "trace_id": "xxxxxxxxx" } ``` -------------------------------- ### Example Request Parameters for Batch Task Status Query - JSON Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/get_tasks_states.md This JSON object illustrates the required parameters for querying multiple task statuses. It includes application authentication details (bk_app_code, bk_app_secret), user authentication (bk_username or bk_token), and a list of task IDs to be queried. ```json { "bk_app_code": "xxxx", "bk_app_secret": "xxxx", "bk_username or bk_token": "xxxx", "task_ids": [1, 2, 3, 4] } ``` -------------------------------- ### Successful Task Creation Response Example (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/create_task.md This JSON snippet provides an example of a successful response after creating a task. It includes the task's unique ID, instance ID, template ID, creation time, and various status flags indicating its current state. ```json { "result": true, "data": { "id": 10, "space_id": 1, "scope_type": null, "scope_value": null, "instance_id": "6e15e7cf27ab3129878cdd9b95fff006", "template_id": 4, "name": "default_taskflow_instance", "creator": "", "create_time": "2023-04-23T21:10:06.826644+08:00", "executor": "", "start_time": null, "finish_time": null, "description": "", "is_started": false, "is_finished": false, "is_revoked": false, "is_deleted": false, "is_expired": false, "snapshot_id": 3, "execution_snapshot_id": 8, "tree_info_id": null, "extra_info": {} }, "code": "0", "message": "" } ``` -------------------------------- ### Requesting Application Token - JSON Example Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/apply_token.md This JSON object illustrates the required parameters for requesting an application token. It includes `bk_app_code` and `bk_app_secret` for authentication, and `resource_type`, `resource_id`, `permission_type` to specify the resource and desired access. ```json { "bk_app_code": "xxxx", "bk_app_secret": "xxxx", "resource_type": "TEMPLATE", "resource_id": "1", "permission_type": "VIEW" } ``` -------------------------------- ### Example Pipeline Tree Request Body - JSON Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/validate_pipeline_tree.md This JSON snippet provides a comprehensive example of the request parameters required to create or update a pipeline tree. It defines a workflow with a 'ServiceActivity' (bk_display), including its component details, error handling, retry configurations, and visual layout. Key parameters include 'bk_app_code', 'bk_app_secret', and 'bk_username or bk_token' for authentication, along with the 'pipeline_tree' object containing the workflow definition. ```json { "bk_app_code": "xxxx", "bk_app_secret": "xxxx", "bk_username or bk_token": "xxxx", "pipeline_tree": { "name": "test", "activities": { "nf834705dbbb37c59ad114aa37314975": { "component": { "code": "bk_display", "data": { "bk_display_message": { "hook": false, "need_render": true, "value": "" } }, "version": "v1.0" }, "error_ignorable": false, "id": "nf834705dbbb37c59ad114aa37314975", "incoming": [ "lee4ca362c673536958aa656cb36efda" ], "loop": null, "name": "消息展示", "optional": true, "outgoing": "l2e819009a9a3714ab108ad5c594bb73", "stage_name": "", "type": "ServiceActivity", "retryable": true, "skippable": true, "auto_retry": { "enable": false, "interval": 0, "times": 1 }, "timeout_config": { "enable": false, "seconds": 10, "action": "forced_fail" }, "labels": [] } }, "end_event": { "id": "n2dfd1233f633cdf864fc3681eb2b0b3", "incoming": [ "l2e819009a9a3714ab108ad5c594bb73" ], "name": "", "outgoing": "", "type": "EmptyEndEvent", "labels": [] }, "flows": { "lee4ca362c673536958aa656cb36efda": { "id": "lee4ca362c673536958aa656cb36efda", "is_default": false, "source": "n1df1598dba137aba81094851379435a", "target": "nf834705dbbb37c59ad114aa37314975" }, "l2e819009a9a3714ab108ad5c594bb73": { "id": "l2e819009a9a3714ab108ad5c594bb73", "is_default": false, "source": "nf834705dbbb37c59ad114aa37314975", "target": "n2dfd1233f633cdf864fc3681eb2b0b3" } }, "gateways": {}, "line": [ { "id": "lee4ca362c673536958aa656cb36efda", "source": { "arrow": "Right", "id": "n1df1598dba137aba81094851379435a" }, "target": { "arrow": "Left", "id": "nf834705dbbb37c59ad114aa37314975" } }, { "id": "l2e819009a9a3714ab108ad5c594bb73", "source": { "arrow": "Right", "id": "nf834705dbbb37c59ad114aa3 ``` -------------------------------- ### Request Body Example for Creating Task (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/create_task.md This JSON snippet illustrates the required and optional parameters for creating a task. It shows how to specify the task name, template ID, and creator for a task creation request. ```json { "name": "空间名", "template_id": 4, "creator": "创建者" } ``` -------------------------------- ### Example Response for Getting Flow Mock Data (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/get_template_mock_data.md This JSON snippet illustrates the expected successful response structure when querying for flow mock data. It includes a 'result' boolean indicating success, a 'code' for status, a 'message' for errors, and a 'data' array containing mock data objects with details like ID, name, associated space/template/node IDs, and timestamps. ```json { "result": true, "data": [ { "id": 1, "name": "Mock 数据方案1", "space_id": 1, "template_id": 1, "node_id": "nd64fbd5440932ee9658d47029751f46", "data": { "callback_data": { "abc": "123" } }, "is_default": true, "extra_info": null, "operator": "admin", "create_at": "2024-09-14T15:24:39.075179+08:00", "update_at": "2024-09-14T15:24:39.075289+08:00" } ], "code": 0, "message": "" } ``` -------------------------------- ### Example Response for Get Task Node Details API (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/get_task_node_detail.md This JSON object illustrates a successful response from the API for retrieving task node details. It includes the node's name, error ignorable status, current state, input parameters, and an empty list for outputs, along with execution data. ```json { "result": true, "data": { "name": "定时", "error_ignorable": false, "state": "READY", "inputs": { "bk_timing": "30", "force_check": true }, "outputs": [], "ex_data": "" }, "message": "" } ``` -------------------------------- ### Example Request Body for Creating Space (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/create_space.md Illustrates a sample JSON request body for the 'Create Space' API. It includes required authentication parameters (bk_app_code, bk_app_secret, bk_username or bk_token) and space-specific details such as name, platform_url, an optional description, the binding app_code, and an optional config object for advanced settings. ```JSON { "bk_app_code": "xxxx", "bk_app_secret": "xxxx", "bk_username or bk_token": "xxxx", "name": "空间名", "platform_url": "http://www.tencent.com", "desc": "这是一段默认描述", "app_code": "bksops", "config": {} } ``` -------------------------------- ### Example Request Body for Updating Template (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/update_template.md This JSON snippet provides an example of the request body required to update a template, including common authentication parameters ('bk_app_code', 'bk_app_secret', 'bk_username or bk_token') and the template's 'name'. ```json { "bk_app_code": "xxxx", "bk_app_secret": "xxxx", "bk_username or bk_token": "xxxx", "name": "模板名" } ``` -------------------------------- ### Example Response for Batch Task Status Query - JSON Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/get_tasks_states.md This JSON object demonstrates the expected successful response when querying multiple task statuses. It includes a boolean result, a status code, a message, and a 'data' dictionary containing the state of each queried task, indexed by task ID. ```json { "result": true, "data": { "3": { "state": "FINISHED" }, "2": { "state": "FINISHED" }, "1": { "state": "FINISHED" } }, "code": "0", "message": "" } ``` -------------------------------- ### Example JSON Response for Get Task List API Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/get_task_list.md This JSON object illustrates a successful response from the 'Get Task List' API. It includes a boolean 'result' indicating success, a 'code' for the status, a 'message' for errors, and a 'data' object containing pagination details ('count', 'next', 'previous') and an array of 'results', where each item represents a task with its ID, creation time, status, and other relevant metadata. ```json { "result": true, "data": { "count": 1, "next": null, "previous": null, "results": [ { "id": 1671, "create_time": "2024-07-31 17:56:23+0800", "start_time": "2024-07-31 17:56:26+0800", "finish_time": "2024-07-31 17:59:14+0800", "space_id": 1, "scope_type": null, "scope_value": null, "instance_id": "n2d1ef9ff5193d39b2d13bb2faa5418c", "template_id": 616, "name": "default_taskflow_instance", "creator": "", "create_method": "API", "executor": "", "description": "", "is_started": true, "is_finished": true, "is_revoked": false, "is_deleted": false, "is_expired": false, "snapshot_id": 1671, "execution_snapshot_id": 1671, "tree_info_id": 1539, "extra_info": {} } ] }, "code": "0", "message": "" } ``` -------------------------------- ### Initializing Menu Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the menu widget on the element with the ID 'menu'. It transforms a list of links into a hierarchical menu, providing navigation capabilities. ```JavaScript $("#menu").menu(); ``` -------------------------------- ### Initializing Tooltip Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the tooltip widget on the element with the ID 'tooltip'. It displays custom content in a tooltip when the user hovers over the element. ```JavaScript $("#tooltip").tooltip(); ``` -------------------------------- ### Example Notification Configuration Structure (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/update_template.md This JSON snippet illustrates the structure for the 'notify_config' parameter, defining notification types for success and failure events, and specifying receiver groups and additional receivers. ```json { "notify_type": { "success": [ "weixin", "wecom_robot", "sms" ], "fail": [ "mail", "voice", "weixin", "wecom_robot" ] }, "notify_receivers": { "receiver_group": [], "more_receiver": "" } } ``` -------------------------------- ### Create Template Success Response Example (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/create_template.md This JSON snippet shows a successful response structure for the template creation API. It includes the newly created template's `id`, `space_id`, `name`, and a detailed `pipeline_tree` representing the workflow. The `pipeline_tree` contains definitions for start/end events, activities (like `ServiceActivity` with `example_component`), gateways, and flows, along with data inputs and outputs. ```json { "result": true, "data": { "id": 4, "space_id": "2", "name": "模板名", "desc": null, "notify_config": {}, "scope_type": null, "scope_value": null, "pipeline_tree": { "id": "pd0980c284042448380d29e046bf348fc", "start_event": { "incoming": "", "outgoing": "f22d707b4e7704868b51fbc504107da27", "type": "EmptyStartEvent", "id": "e39ce14ef5df644ccaa5236b50a9c44ca", "name": null }, "end_event": { "incoming": [ "f520808740b9945f8b01fa1dd889945d9" ], "outgoing": "", "type": "EmptyEndEvent", "id": "e17aef95ed6934a428215b2a7a3fa4184", "name": null }, "activities": { "e36e8026b07b5448299b52f91a9d265af": { "incoming": [ "f22d707b4e7704868b51fbc504107da27" ], "outgoing": "f520808740b9945f8b01fa1dd889945d9", "type": "ServiceActivity", "id": "e36e8026b07b5448299b52f91a9d265af", "name": null, "error_ignorable": false, "timeout": null, "skippable": true, "retryable": true, "component": { "code": "example_component", "inputs": {} }, "optional": false } }, "gateways": {}, "flows": { "f22d707b4e7704868b51fbc504107da27": { "is_default": false, "source": "e39ce14ef5df644ccaa5236b50a9c44ca", "target": "e36e8026b07b5448299b52f91a9d265af", "id": "f22d707b4e7704868b51fbc504107da27" }, "f520808740b9945f8b01fa1dd889945d9": { "is_default": false, "source": "e36e8026b07b5448299b52f91a9d265af", "target": "e17aef95ed6934a428215b2a7a3fa4184", "id": "f520808740b9945d9" } }, "data": { "inputs": {}, "outputs": [] } }, "source": null, "version": "", "is_enabled": true, "extra_info": {}, "creator": "", "create_at": "2024-08-02T08:53:20.173Z", "update_at": "2024-08-02T08:53:20.173Z", "updated_by": "" }, "code": 0 } ``` -------------------------------- ### API Response Example for Taskflow Instance (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/create_task_without_template.md This JSON snippet illustrates a successful API response for a taskflow instance operation. It includes a `result` boolean indicating success, a `code` for the status, a `message` for error details, and a `data` object containing comprehensive details about the taskflow instance, such as its ID, space ID, name, creator, timestamps, and execution status flags. ```json { "result": true, "data": { "id": 93, "space_id": 1, "scope_type": null, "scope_value": null, "instance_id": "nb2bf870164336798522536f036a4da7", "template_id": null, "name": "default_taskflow_instance", "creator": "创建者", "create_time": "2023-10-16T17:24:07.859339+08:00", "executor": "", "start_time": null, "finish_time": null, "description": "", "is_started": false, "is_finished": false, "is_revoked": false, "is_deleted": false, "is_expired": false, "snapshot_id": 80, "execution_snapshot_id": 77, "tree_info_id": null, "extra_info": { "notify_config": { "notify_type": { "fail": [], "success": [] }, "notify_receivers": { "more_receiver": "", "receiver_group": [] } } } }, "code": "0", "message": "" } ``` -------------------------------- ### Example API Response for Webhook Configuration (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/apply_webhook_configs.md This JSON object represents a typical successful response from the webhook configuration API. It includes a 'result' boolean indicating success, a 'message' string for details, a 'code' integer for the status, and an empty 'data' dictionary for any returned data. ```JSON { "result": true, "message": "success", "data": {}, "code": 0 } ``` -------------------------------- ### Initializing Progressbar Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the progressbar widget on the element with the ID 'progressbar'. It displays a visual representation of progress, with an initial value set to 20%. ```JavaScript $("#progressbar").progressbar({ value: 20 }); ``` -------------------------------- ### Receiving Application Token - JSON Example Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/apply_token.md This JSON object represents a successful response from the application token creation API. It includes a `result` status, a `code`, and a `data` object containing the generated `token`, `space_id`, `resource_type`, `resource_id`, `user`, `permission_type`, and `expired_time`. ```json { "result": true, "data": { "space_id": 3, "resource_type": "TEMPLATE", "resource_id": "1", "user": "admin", "token": "8ce9f640f76f3fcbb4e22726bb726cd6", "permission_type": "VIEW", "expired_time": "2023-04-22 11:11:11" }, "code": 0 } ``` -------------------------------- ### Example Successful Response for Creating Space (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/create_space.md Shows a typical successful JSON response after creating a space. It includes a 'result' boolean indicating success, a 'code' of 0 for successful operations, and a 'data' object containing the details of the newly created space, such as its ID, name, description, platform URL, associated app code, and creation type. ```JSON { "result": true, "data": { "id": 3, "name": "空间名", "desc": "这是一段默认描述", "platform_url": "http://www.tencent.com", "app_code": "bksops", "create_type": "API" }, "code": 0 } ``` -------------------------------- ### Example Request Body for Task Operations API (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/operate_task.md This JSON object illustrates the required parameters for making a request to the task operations API. It includes authentication credentials (bk_app_code, bk_app_secret, bk_username or bk_token) and the operator's identifier. ```JSON { "bk_app_code": "xxxx", "bk_app_secret": "xxxx", "bk_username or bk_token": "xxxx", "operator": "操作人" } ``` -------------------------------- ### Example Successful Response Body for Task Node Operations (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/operate_task_node.md This JSON object illustrates a successful response from the task node operations API. It contains a result boolean indicating success, a data field (null in this example), a message string, and a trace_id for request tracking. ```JSON { "result": true, "data": null, "message": "success", "trace_id": "3f16e62e57c543a9be6cff9556e48d07" } ``` -------------------------------- ### Example Request Payload for Webhook Configuration (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/apply_webhook_configs.md This JSON object illustrates the structure for configuring webhooks. It contains a 'webhooks' list, where each element defines a unique webhook with a 'code', 'name', 'endpoint', and a list of 'events' it subscribes to. This payload is used to overwrite existing webhook configurations for the current application space. ```JSON { "webhooks": [ { "code": "webhook1", "name": "webhook1", "endpoint": "http://webhook1.com", "events": ["template_update", "template_create"] }, { "code": "webhook2", "name": "webhook2", "endpoint": "http://webhook2.com", "events": ["task_failed", "task_finished"] } ] } ``` -------------------------------- ### Notification Configuration Example (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/create_template.md This JSON snippet illustrates the structure for the `notify_config` parameter, specifying notification types for success and failure events (e.g., weixin, mail, sms) and receiver groups. It defines channels like 'weixin', 'wecom_robot', 'sms' for success and 'mail', 'voice', 'weixin', 'wecom_robot' for failure, along with placeholders for receiver groups. ```json { "notify_type": { "success": [ "weixin", "wecom_robot", "sms" ], "fail": [ "mail", "voice", "weixin", "wecom_robot" ] }, "notify_receivers": { "receiver_group": [], "more_receiver": "" } } ``` -------------------------------- ### Initializing Buttonset Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the buttonset widget on the element with the ID 'radioset'. It groups a set of radio buttons or checkboxes, applying consistent styling and behavior to them. ```JavaScript $("#radioset").buttonset(); ``` -------------------------------- ### Initializing Button Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the button widget on the element with the ID 'button'. It enhances a standard HTML button or anchor element with jQuery UI styling and behavior. ```JavaScript $("#button").button(); ``` -------------------------------- ### Initializing Selectmenu Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the selectmenu widget on the element with the ID 'selectmenu'. It enhances a standard HTML select element with custom styling and improved accessibility. ```JavaScript $("#selectmenu").selectmenu(); ``` -------------------------------- ### Initializing Tabs Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the tabs widget on the element with the ID 'tabs'. It transforms a set of content panels into a tabbed interface, allowing users to switch between different sections of content. ```JavaScript $("#tabs").tabs(); ``` -------------------------------- ### Example Request Body for Task Node Operations (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/operate_task_node.md This JSON object demonstrates the structure of a typical request body for task node operations. It includes essential authentication credentials (bk_app_code, bk_app_secret), user identification (bk_username or bk_token), and the operator field indicating who initiated the action. ```JSON { "bk_app_code": "xxxx", "bk_app_secret": "xxxx", "bk_username or bk_token": "xxxx", "operator": "操作人" } ``` -------------------------------- ### Example Request Parameters for Template Update (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/delete_template.md This JSON snippet illustrates the required parameters for updating a template. It includes authentication credentials (`bk_app_code`, `bk_app_secret`) and user identification (`bk_username` or `bk_token`). These parameters are essential for successful API calls. ```JSON { "bk_app_code": "xxxx", "bk_app_secret": "xxxx", "bk_username or bk_token": "xxxx" } ``` -------------------------------- ### Initializing Autocomplete Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet defines an array of programming languages and then initializes the autocomplete widget on the element with the ID 'autocomplete'. The 'source' option is set to the 'availableTags' array, providing the suggestions for the autocomplete input field. ```JavaScript var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme" ]; $("#autocomplete").autocomplete({ source: availableTags }); ``` -------------------------------- ### Basic Styling for jQuery UI Elements - CSS Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This CSS snippet provides foundational styling for a jQuery UI demonstration page. It defines global font settings, margins, and specific styles for UI elements like dialog links, icons, and list items, ensuring a consistent visual presentation across the page. ```CSS body { font: 62.5% \"Trebuchet MS\", sans-serif; margin: 50px; } .demoHeaders { margin-top: 2em; } #dialog-link { padding: .4em 1em .4em 20px; text-decoration: none; position: relative; } #dialog-link span.ui-icon { margin: 0 5px 0 0; position: absolute; left: .2em; top: 50%; margin-top: -8px; } #icons { margin: 0; padding: 0; } #icons li { margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left; list-style: none; } #icons span.ui-icon { float: left; margin: 0 4px; } .fakewindowcontain .ui-widget-overlay { position: absolute; } select { width: 200px; } ``` -------------------------------- ### Initializing Accordion Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the accordion widget on the element with the ID 'accordion'. It transforms a set of collapsible content panels into an accordion, allowing only one panel to be open at a time. ```JavaScript $("#accordion").accordion(); ``` -------------------------------- ### Example Response for Template Update (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/delete_template.md This JSON snippet shows a typical successful response after updating a template. It includes a `result` boolean indicating success, a `data` object with a `count`, a `code` for the operation status, and a `trace_id` for tracking. ```JSON { "result": true, "data": { "count": 2 }, "code": 0, "trace_id": "3b9bc1fa61cb498ea6fb74fc0f444159" } ``` -------------------------------- ### Initializing Dialog Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the dialog widget on the element with the ID 'dialog'. It is configured not to open automatically and includes 'Ok' and 'Cancel' buttons, both of which close the dialog when clicked. ```JavaScript $("#dialog").dialog({ autoOpen: false, width: 400, buttons: [ { text: "Ok", click: function () { $(this).dialog("close"); } }, { text: "Cancel", click: function () { $(this).dialog("close"); } } ] }); ``` -------------------------------- ### Request Parameters Example (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/renew_space_config.md This JSON object illustrates the structure for sending a request to update space configurations. It includes the 'bk_app_code' and 'bk_app_secret' for authentication, and a 'config' object specifying the 'token_auto_renewal' setting. ```json { "bk_app_code": "xxxx", "bk_app_secret": "xxxx", "config": { "token_auto_renewal": "true" } } ``` -------------------------------- ### Example Successful Response for Granting API Gateway Permissions (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/grant_apigw_permission_to_app.md This JSON snippet demonstrates a successful response after granting API Gateway permissions. It indicates success with `"result": true`, provides a success message in `"data"`, a success code `"0"`, and an empty `"message"` field. ```json { "result": true, "data": "permission granted", "code": "0", "message": "" } ``` -------------------------------- ### Example JSON Response for Task Details API Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/get_template_list.md This JSON object represents a successful response from the API for retrieving task details. It includes a 'result' flag, a 'data' array containing task objects, a 'count' of total items, and a 'code' indicating success. Each item in the 'data' array provides comprehensive details about a specific task, such as its ID, name, creation/update timestamps, and other configurations. ```json { "result": true, "data": [ { "id": 618, "space_id": 1, "name": "测试模板", "desc": null, "notify_config": {}, "scope_type": null, "scope_value": null, "source": null, "version": "", "is_enabled": true, "extra_info": {}, "creator": "", "create_at": "2024-07-30T06:27:52.642Z", "update_at": "2024-07-30T07:30:28.005Z", "updated_by": "" } ], "count": 10, "code": 0 } ``` -------------------------------- ### Defining System Taskflow Variables (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/create_task_without_template.md This JSON snippet defines a set of system-level variables used within a taskflow, including task name, ID, start time, and operator. Each variable includes metadata such as its key, display name, index, visibility (`show_type`), source type, and validation rules. These variables are typically hidden and provided by the system. ```json { "${_system.task_name}": { "key": "${_system.task_name}", "name": "任务名称", "index": -1, "desc": "", "show_type": "hide", "source_type": "system", "source_tag": "", "source_info": {}, "custom_type": "", "value": "", "hook": false, "validation": "" }, "${_system.task_id}": { "key": "${_system.task_id}", "index": -2, "name": "任务ID", "desc": "", "show_type": "hide", "source_type": "system", "source_tag": "", "source_info": {}, "custom_type": "", "value": "", "hook": false, "validation": "" }, "${_system.task_start_time}": { "key": "${_system.task_start_time}", "name": "任务开始时间", "index": -3, "desc": "", "show_type": "hide", "source_type": "system", "source_tag": "", "source_info": {}, "custom_type": "", "value": "", "hook": false, "validation": "" }, "${_system.operator}": { "key": "${_system.operator}", "name": "任务的执行人(点击开始执行的人员)", "index": -4, "desc": "", "show_type": "hide", "source_type": "system", "source_tag": "", "source_info": {}, "custom_type": "", "value": "", "hook": false, "validation": "" } } ``` -------------------------------- ### Initializing Spinner Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the spinner widget on the element with the ID 'spinner'. It enhances a numeric input field, allowing users to increment or decrement values using small arrow buttons. ```JavaScript $("#spinner").spinner(); ``` -------------------------------- ### Return Result Example (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/renew_space_config.md This JSON object shows a successful response after updating space configurations. It includes the 'result' status, 'data' containing the 'space_id' and the updated 'config' list, a 'code' for the operation status, and a 'trace_id'. ```json { "result": true, "data": { "space_id": 2, "config": [ { "key": "token_auto_renewal", "value": "true" }, { "key": "token_expiration", "value": "1h" } ] }, "code": 0, "trace_id": "ecb0dd8707194245a5a88b7f0e3b3c16" } ``` -------------------------------- ### Initializing Datepicker Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the datepicker widget on the element with the ID 'datepicker'. The 'inline' option is set to true, causing the datepicker to be displayed directly within the page rather than as a popup. ```JavaScript $("#datepicker").datepicker({ inline: true }); ``` -------------------------------- ### Example Successful Response from Task Operations API (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/operate_task.md This JSON object demonstrates a typical successful response from the task operations API. It indicates success with 'result: true', a null 'data' field for this specific operation, a 'message' of 'success', and a unique 'trace_id' for tracking. ```JSON { "result": true, "data": null, "message": "success", "trace_id": "3f16e62e57c543a9be6cff9556e48d07" } ``` -------------------------------- ### Example Request Body for Granting API Gateway Permissions (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/grant_apigw_permission_to_app.md This JSON snippet illustrates the structure of the request body required to grant API Gateway permissions. It includes the application's authentication credentials (`bk_app_code`, `bk_app_secret`), a list of target application codes (`apps`), and a list of specific permissions (`permissions`) to be granted. ```json { "bk_app_code": "xxxx", "bk_app_secret": "xxxx", "apps": ["xxx"], "permissions": ["create_space"] } ``` -------------------------------- ### Initializing Slider Widget - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet initializes the slider widget on the element with the ID 'slider'. It is configured as a range slider with initial values set between 17 and 67, allowing users to select a range of values. ```JavaScript $("#slider").slider({ range: true, values: [17, 67] }); ``` -------------------------------- ### Opening Dialog Widget on Click - jQuery UI - JavaScript Source: https://github.com/tencentblueking/bkflow/blob/master/static/remote/v3/assets/jquery-ui-1.11.0.custom/index.html This snippet attaches a click event handler to the element with the ID 'dialog-link'. When clicked, it opens the dialog widget associated with the ID 'dialog' and prevents the default link behavior. ```JavaScript // Link to open the dialog $("#dialog-link").click(function (event) { $("#dialog").dialog("open"); event.preventDefault(); }); ``` -------------------------------- ### Example Successful Response Body for Updating Template (JSON) Source: https://github.com/tencentblueking/bkflow/blob/master/bkflow/apigw/docs/zh/update_template.md This JSON snippet demonstrates a successful response from the template update API, including the 'result' status, 'code', and a detailed 'data' object containing the updated template's properties like ID, name, pipeline tree, and timestamps. ```json { "result": true, "data": { "id": 4, "space_id": "2", "name": "模板名", "desc": null, "notify_config": {}, "scope_type": null, "scope_value": null, "pipeline_tree": { "id": "pd0980c284042448380d29e046bf348fc", "start_event": { "incoming": "", "outgoing": "f22d707b4e7704868b51fbc504107da27", "type": "EmptyStartEvent", "id": "e39ce14ef5df644ccaa5236b50a9c44ca", "name": null }, "end_event": { "incoming": [ "f520808740b9945f8b01fa1dd889945d9" ], "outgoing": "", "type": "EmptyEndEvent", "id": "e17aef95ed6934a428215b2a7a3fa4184", "name": null }, "activities": { "e36e8026b07b5448299b52f91a9d265af": { "incoming": [ "f22d707b4e7704868b51fbc504107da27" ], "outgoing": "f520808740b9945f8b01fa1dd889945d9", "type": "ServiceActivity", "id": "e36e8026b07b5448299b52f91a9d265af", "name": null, "error_ignorable": false, "timeout": null, "skippable": true, "retryable": true, "component": { "code": "example_component", "inputs": {} }, "optional": false } }, "gateways": {}, "flows": { "f22d707b4e7704868b51fbc504107da27": { "is_default": false, "source": "e39ce14ef5df644ccaa5236b50a9c44ca", "target": "e36e8026b07b5448299b52f91a9d265af", "id": "f22d707b4e7704868b51fbc504107da27" }, "f520808740b9945f8b01fa1dd889945d9": { "is_default": false, "source": "e36e8026b07b5448299b52f91a9d265af", "target": "e17aef95ed6934a428215b2a7a3fa4184", "id": "f520808740b9945f8b01fa1dd889945d9" } }, "data": { "inputs": {}, "outputs": [] } }, "source": null, "version": "", "is_enabled": true, "extra_info": {}, "creator": "", "create_at": "2024-08-02T08:53:20.173Z", "update_at": "2024-08-02T08:53:20.173Z", "updated_by": "" }, "code": 0 } ```