Skip to content

Commit

Permalink
Merge pull request #600 from alex-smile/update_esb_apis_1019
Browse files Browse the repository at this point in the history
esb 更新 data 组件
  • Loading branch information
MrLYC authored Oct 19, 2021
2 parents bdd6a5a + 4bc458a commit c8204ac
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 2 deletions.
2 changes: 1 addition & 1 deletion paas2/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.12.27
2.12.28
3 changes: 2 additions & 1 deletion paas2/esb/components/bk/apisv2/cc/search_business.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ class Form(BaseComponentForm):
bk_supplier_account = forms.CharField(label="bk supplier account", required=False)
fields = TypeCheckField(label="fields", promise_type=list, required=False)
condition = TypeCheckField(label="condition", promise_type=dict, required=False)
biz_property_filter = TypeCheckField(label="biz_property_filter", promise_type=dict, required=False)
page = TypeCheckField(label="page", promise_type=dict, required=False)

def clean(self):
data = self.get_cleaned_data_when_exist(keys=["bk_supplier_account"])
data.setdefault("bk_supplier_account", configs.DEFAULT_BK_SUPPLIER_ACCOUNT)
data["data"] = self.get_cleaned_data_when_exist(keys=["fields", "condition", "page"])
data["data"] = self.get_cleaned_data_when_exist(keys=["fields", "condition", "page", "biz_property_filter"])
return data

def handle(self):
Expand Down
27 changes: 27 additions & 0 deletions paas2/esb/components/confapis/data/v3_storekit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,30 @@
dest_path: /v3/storekit/result_tables/{result_table_id}/schema_and_sql/
dest_http_method: GET
is_hidden: true

- path: /data/v3/storekit/{cluster_type}/{result_table_id}/prepare/
name: v3_storekit__cluster_type__result_table_id__prepare
label: rt存储准备
method: GET
comp_codename: generic.data.datav3_component
dest_path: /v3/storekit/{cluster_type}/{result_table_id}/prepare/
dest_http_method: GET
is_hidden: true

- path: /data/v3/storekit/result_tables/{result_table_id}/{cluster_type}/
name: v3_storekit_result_tables__result_table_id__cluster_type__patch
label: 更新rt存储配置
method: PATCH
comp_codename: generic.data.datav3_component
dest_path: /v3/storekit/result_tables/{result_table_id}/{cluster_type}/
dest_http_method: PATCH
is_hidden: true

- path: /data/v3/storekit/es/route/
name: v3_storekit_es_route
label: es 接口路由
method: GET
comp_codename: generic.data.datav3_component
dest_path: /v3/storekit/es/route/
dest_http_method: GET
is_hidden: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
### 功能描述

生成本地文件上传URL。

### 请求参数

{{ common_args_desc }}

#### 接口参数

| 字段 | 类型 | 必选 | 描述 |
|----------------------------|------------|--------|------------|
| bk_biz_id | long || 业务 ID |
| file_name_list | string[] || 要上传的文件名列表 |


### 请求参数示例

```json
{
"bk_app_code": "esb_test",
"bk_app_secret": "xxx",
"bk_token": "xxx",
"bk_biz_id": 1,
"file_name_list": ["file1.txt","file2.txt"]
}
```

### 返回结果示例

```json
{
"result": true,
"code": 0,
"message": "success",
"data": {
"url_map": {
"file1.txt":{
"upload_url": "http://bkrepo.com/generic/temporary/upload/bkjob/localupload/1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file1.txt?token=30adf862fdce4b02b909e6a1a1c762c6",
"path": "1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file1.txt"
},
"file2.txt":{
"upload_url": "http://bkrepo.com/generic/temporary/upload/bkjob/localupload/1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file2.txt?token=30adf862fdce4b02b909e6a1a1c762c6",
"path": "1/008f821f-259b-4f62-bd84-1e89d6f05f0d/admin/file2.txt"
}
}
}
}
```

### 返回结果参数说明

#### data

| 字段 | 类型 |字段是否一定存在 | 描述 |
|-----------|----------|---------------|---------|
| url_map | map || key:传入的文件名,value:upload_url为带凭据的文件上传地址,path为分发该文件时要传给文件分发接口的路径 |
11 changes: 11 additions & 0 deletions paas2/esb/components/confapis/jobv3/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,14 @@
dest_path: /api/job/v3/job-file-gateway/update_file_source/
dest_http_method: POST
is_hidden: True

- path: /v2/jobv3/generate_local_file_upload_url/
name: generate_local_file_upload_url
label: 生成本地文件上传URL
label_en: Generate local file upload url
suggest_method: POST
api_type: operate
comp_codename: generic.v2.jobv3.job_component
dest_path: /api/job/v3/job-manage/generate_local_file_upload_url/
dest_http_method: POST
is_hidden: True
1 change: 1 addition & 0 deletions paas2/esb/conf/settings_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
DATAV3_MODELAPI_HOST = env.str("BK_DATA_V3_MODELAPI_URL", "")
DATAV3_DATACUBEAPI_HOST = env.str("BK_DATA_V3_DATACUBEAPI_URL", "")
DATAV3_ALGORITHMAPI_HOST = env.str("BK_DATA_V3_ALGORITHMAPI_URL", "")
DATAV3_RESOURCECENTERAPI_HOST = env.str("BK_DATA_V3_RESOURCECENTERAPI_URL", "")

# host for fta, default 80 for http/8443 for https
HOST_FTA = env.str("BK_FTA_URL", "")
Expand Down
5 changes: 5 additions & 0 deletions paas2/release.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Release Log
===============================
# 2.12.28
- update: esb update data v3_storekit confapis
- update: esb jobv3 add api generate_local_file_upload_url
- update: esb cc search_business add parameter biz_property_filter

# 2.12.27
- update: esb update data/jobv3/sops confapis
- update: esb add data module RESOURCECENTERAPI
Expand Down

0 comments on commit c8204ac

Please sign in to comment.