Skip to content

Commit

Permalink
Merge pull request #170 from alex-smile/update_sops_apis
Browse files Browse the repository at this point in the history
update sops apis
  • Loading branch information
alex-smile authored Jan 17, 2020
2 parents f65e133 + ded3916 commit 6c8af4f
Show file tree
Hide file tree
Showing 10 changed files with 671 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ constant value, the type of value should be same with data from API[get_template
}
}
},
"stage_name": "步骤1",
"stage_name": "stage1",
"can_retry": true,
"isSkipped": true,
"type": "ServiceActivity",
Expand All @@ -78,13 +78,13 @@ constant value, the type of value should be same with data from API[get_template
"node880ded556c6c3c269be3cedc64b6": {
"outgoing": "line490caa49d2a03e64829693281032",
"incoming": "lineb83161d6e0593ad68d9ec73a961b",
"name": "暂停",
"name": "pause",
"error_ignorable": false,
"component": {
"code": "pause_node",
"data": {}
},
"stage_name": "步骤1",
"stage_name": "stage1",
"can_retry": true,
"isSkipped": true,
"type": "ServiceActivity",
Expand Down Expand Up @@ -168,8 +168,8 @@ constant value, the type of value should be same with data from API[get_template
"constants": {},
"location": [
{
"stage_name": "步骤1",
"name": "暂停",
"stage_name": "stage1",
"name": "pause",
"y": 135,
"x": 300,
"type": "tasknode",
Expand All @@ -182,7 +182,7 @@ constant value, the type of value should be same with data from API[get_template
"id": "node5c48f37aa9f0351e8b43ab6a2295"
},
{
"stage_name": "步骤1",
"stage_name": "stage",
"name": "timing",
"y": 135,
"x": 595,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
### Functional description

Query common flow template details

### Request Parameters

{{ common_args_desc }}

#### Interface Parameters

| Field | Type | Required | Description |
|---------------|------------|--------|---------------|
| template_id | string | YES | the task ID |

### Request Parameters Example

```
{
"bk_app_code": "esb_test",
"bk_app_secret": "xxx",
"bk_token": "xxx",
"template_id": "30",
}
```

### Return Result Example

```
{
"result": true,
"data": {
"category": "Other",
"edit_time": "2018-04-27 16:24:24 +0800",
"create_time": "2018-04-16 21:43:15 +0800",
"name": "new20180416213944",
"creator": "admin",
"pipeline_tree": {
"activities": {
"631b6576cc5dfbdcaa4f510ce88a7e67": {
"outgoing": "44ab36ebf4cf119edaf2d20401da87e4",
"incoming": "fb2f3a8b533ca5c67e2440b4164f7632",
"name": "node_1",
"error_ignorable": false,
"component": {
"code": "job_fast_execute_script",
"data": {
"account": {
"hook": false,
"value": "root"
},
"ip_list": {
"hook": false,
"value": "127.0.0.1"
},
"script_timeout": {
"hook": true,
"value": "${script_timeout}"
},
"content": {
"hook": false,
"value": "${content}"
},
"script_param": {
"hook": false,
"value": "${params}"
},
"script_type": {
"hook": true,
"value": "${script_type}"
}
}
},
"optional": false,
"type": "ServiceActivity",
"id": "631b6576cc5dfbdcaa4f510ce88a7e67",
"loop": null
}
},
"end_event": {
"type": "EmptyEndEvent",
"outgoing": "",
"incoming": "44ab36ebf4cf119edaf2d20401da87e4",
"id": "60c81e383d048d8a3c574d3436e1b82c",
"name": ""
},
"outputs": [],
"flows": {
"fb2f3a8b533ca5c67e2440b4164f7632": {
"is_default": false,
"source": "48afea1016ab70ee37179fa0eb1e1a14",
"id": "fb2f3a8b533ca5c67e2440b4164f7632",
"target": "631b6576cc5dfbdcaa4f510ce88a7e67"
},
"44ab36ebf4cf119edaf2d20401da87e4": {
"is_default": false,
"source": "631b6576cc5dfbdcaa4f510ce88a7e67",
"id": "44ab36ebf4cf119edaf2d20401da87e4",
"target": "60c81e383d048d8a3c574d3436e1b82c"
}
},
"start_event": {
"type": "EmptyStartEvent",
"outgoing": "fb2f3a8b533ca5c67e2440b4164f7632",
"incoming": "",
"id": "48afea1016ab70ee37179fa0eb1e1a14",
"name": ""
},
"constants": {
"${script_type}": {
"source_tag": "job_fast_execute_script.script_type",
"source_info": {
"631b6576cc5dfbdcaa4f510ce88a7e67": [
"script_type"
]
},
"name": "script_type",
"index": 0,
"custom_type": "radio",
"value": "4",
"show_type": "show",
"source_type": "component_inputs",
"key": "${script_type}",
"validation": "^.*$",
"desc": ""
},
"${content}": {
"source_tag": "",
"source_info": {},
"name": "content",
"index": 2,
"custom_type": "textarea",
"value": "",
"show_type": "show",
"source_type": "custom",
"key": "${content}",
"desc": ""
},
"${script_timeout}": {
"source_tag": "job_fast_execute_script.script_timeout",
"source_info": {
"631b6576cc5dfbdcaa4f510ce88a7e67": [
"script_timeout"
]
},
"name": "script_timeout",
"index": 1,
"custom_type": "input",
"value": "",
"show_type": "show",
"source_type": "component_inputs",
"key": "${script_timeout}",
"validation": "^.*$",
"desc": ""
},
"${params}": {
"source_tag": "",
"source_info": {},
"name": "params",
"index": 3,
"custom_type": "input",
"value": "",
"show_type": "show",
"source_type": "custom",
"key": "${params}",
"desc": ""
}
},
"gateways": {}
},
"id": 30,
"editor": "admin"
},
}
```

### Return Result Description

| Field | Type | Description |
|-----------|----------|-----------|
| result | bool | true or false, indicate success or failure |
| data | dict | data returned when result is true, details are described below |
| message | string | error message returned when result is false |

#### data

| Field | Type | Description |
|-----------|----------|-----------|
| id | int | flow template ID |
| name | string | flow template name |
| category | string | flow type,the value is described below |
| creator | string | person who created this flow template |
| create_time | string | datetime when this flow template created |
| editor | string or null | person who edited this flow template last |
| edit_time | string | datetime when this flow template edited |
| pipeline_tree | dict | template tree info, details are described below |

#### data.category

| Value | Description |
|--------------|----------|
| OpsTools | operation tools |
| MonitorAlarm | monitor alarm |
| ConfManage | configuration management |
| DevTools | development tools |
| EnterpriseIT | enterprise IT |
| OfficeApp | official APPs |
| Other | other |

#### data.pipeline_tree

| Field | Type | Description |
|-----------|----------|-----------|
| start_event | dict | start node |
| end_event | dict | end node |
| activities | dict | task node(atoms or subprocess)info |
| gateways | dict | gateways(parallel gateway、exclusive gateway、exclusive gateway)info |
| flows | dict | sequenceFlow(the line between nodes)info |
| constants | dict | global variables, details are described below |
| outputs | list | outputs info, indicate outputs field of global variables|

#### data.pipeline_tree.constants.KEY

KEY, the format is like ${key}

#### data.pipeline_tree.constants.VALUE

| Field | Type | Description |
|-----------|----------|-----------|
| key | string | same with KEY |
| name | string | name |
| index | int | display order at the front end |
| desc | string | description |
| source_type | string | source of variable, custom mean manual variable, component_inputs means variables comes from task node inputs parameters, component_outputs means variables comes from task node outputs parameters |
| custom_type | string | custom type, which is not empty when source_type is custom, the value is input ,or textarea, or datetime, or int |
| source_tag | string | source tag and atom info, which is not empty when source_type is component_inputs or component_outputs |
| source_info | dict | source info about task node ID |
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
### Functional description

Query common flow templates list

### Request Parameters

{{ common_args_desc }}

#### Interface Parameters

None

### Request Parameters Example

```
{
"bk_app_code": "esb_test",
"bk_app_secret": "xxx",
"bk_token": "xxx",
}
```

### Return Result Example

```
{
"data": [
{
"category": "Other",
"name": "flow2",
"creator": "admin",
"edit_time": "2019-07-15 15:13:22 +0800",
"create_time": "2019-07-15 15:13:22 +0800",
"editor": "admin",
"id": 10014
},
{
"category": "Other",
"name": "flow1",
"creator": "admin",
"edit_time": "2019-07-15 15:13:22 +0800",
"create_time": "2019-07-15 15:13:22 +0800",
"editor": "admin",
"id": 10013
},
],
"result": true
}
```

### Return Result Description

| Field | Type | Description |
|-----------|----------|-----------|
| result | bool | true or false, indicate success or failure |
| data | dict | data returned when result is true, details are described below |
| message | string | error message returned when result is false |

#### data

| Field | Type | Description |
|-----------|----------|-----------|
| id | int | flow template ID |
| name | string | flow template name |
| category | string | template type,the value is described below |
| creator | string | person who created this flow template |
| create_time | string | datetime when this flow template created |
| editor | string or null | person who edited this flow template last |
| edit_time | string | datetime when this flow template edited |

#### data.category

| Value | Description |
|--------------|----------|
| OpsTools | operation tools |
| MonitorAlarm | monitor alarm |
| ConfManage | configuration management |
| DevTools | development tools |
| EnterpriseIT | enterprise IT |
| OfficeApp | official APPs |
| Other | other |
Loading

0 comments on commit 6c8af4f

Please sign in to comment.