forked from TencentBlueKing/bk-bcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 配置示例更新:1.键值型新增http示例;2.p2p集群id从下拉框变更为输入框--story:118652507
- Loading branch information
1 parent
373b0c4
commit e4df0e9
Showing
12 changed files
with
409 additions
and
83 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
bcs-services/bcs-bscp/ui/src/assets/example-data/kv-http-python.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
import requests | ||
|
||
# 设置参数 | ||
biz_id = {{ .Bk_Bscp_Variable_BkBizId }}; | ||
key_name = {{ .Bk_Bscp_Variable_KeyName }}; | ||
service_name = "{{ .Bk_Bscp_Variable_ServiceName }}" | ||
token = {{ .Bk_Bscp_Variable_ClientKey }}; | ||
{{ .Bk_Bscp_Variable_Start_Leabels }}{{ .Bk_Bscp_Variable_Leabels }} | ||
|
||
# 使用参数构建URL | ||
url = f"http://feed.sit.bktencent.com:8080/api/v1/feed/biz/{biz_id}/kvs/data/{key_name}" | ||
|
||
# 设置请求头,包括Authorization token | ||
headers = { | ||
"Authorization": f"Bearer {token}", | ||
} | ||
|
||
# 设置请求数据 | ||
data = { | ||
"app_meta": { | ||
"app": service_name, | ||
"labels": labels, | ||
} | ||
} | ||
|
||
# 发送POST请求 | ||
response = requests.post(url, headers=headers, json=data) | ||
|
||
# 打印响应内容 | ||
print("Response content:", response.text) |
23 changes: 23 additions & 0 deletions
23
bcs-services/bcs-bscp/ui/src/assets/example-data/kv-http-shell.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# 设置参数 | ||
biz_id={{ .Bk_Bscp_Variable_BkBizId }}; | ||
key_name={{ .Bk_Bscp_Variable_KeyName }}; | ||
service_name="{{ .Bk_Bscp_Variable_ServiceName }}" | ||
token={{ .Bk_Bscp_Variable_ClientKey }}; | ||
{{ .Bk_Bscp_Variable_Start_Leabels }}{{ .Bk_Bscp_Variable_Leabels }} | ||
|
||
# 使用参数构建URL | ||
url="http://feed.sit.bktencent.com:8080/api/v1/feed/biz/${biz_id}/kvs/data/${key_name}" | ||
|
||
# 设置请求头,包括Authorization token | ||
auth_header="Authorization: Bearer ${token}" | ||
|
||
# 设置请求数据 | ||
data="{\"app_meta\": {\"app\": \"${service_name}\", \"labels\": ${labels}}}" | ||
|
||
# 发送POST请求并保存响应 | ||
response=$(curl -s -X POST -H "${auth_header}" -d "${data}" "${url}") | ||
|
||
# 打印响应内容 | ||
echo "Response content: ${response}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.