配置文件
配置文件读写与搜索。
配置文件读写与搜索。
默认 Base URL:http://127.0.0.1:8090。管理面接口需 Authorization(登录返回的 token)。
配置文件
配置文件读写与搜索。发布见「配置灰度」。写接口 body 多为 ConfigFile 数组。
/config/v1/files/detail需要鉴权读取配置文件
管理面读取配置文件详情。
参数
- Authorizationheader · string必填
登录返回的 token。
- namespacequery · string必填
命名空间。
- groupquery · string必填
分组。
- namequery · string必填
文件名。
curl -sS 'http://127.0.0.1:8090/config/v1/files/detail?namespace=default&group=docs-multi-gray&name=app.yaml' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success",
"configFile": { "name": "app.yaml", "content": "mode: baseline" }
}/config/v1/files/search需要鉴权搜索配置文件
按条件搜索配置文件。
参数
- Authorizationheader · string必填
登录返回的 token。
- namespacequery · string可选
命名空间。
- groupquery · string可选
分组。
- namequery · string可选
文件名。
- tagsquery · string可选
标签,形如 key1,value1,key2,value2。
- offsetquery · integer可选
偏移。
- limitquery · integer必填
分页大小,默认 100。
curl -sS 'http://127.0.0.1:8090/config/v1/files/search?namespace=default&group=docs-multi-gray&limit=20' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success",
"amount": 1
}/config/v1/files需要鉴权创建配置文件
写接口 body 多为 protobuf 消息数组;下列为单条对象字段(见 specification)。
参数
- Authorizationheader · string必填
登录返回的 token。
- (body)body · ConfigFile[]必填
请求体为 ConfigFile 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。
- idbody · string可选
id
- namebody · string必填
name
- namespacebody · string必填
namespace
- groupbody · string可选
group
- contentbody · string可选
content
- formatbody · string可选
format
- commentbody · string可选
comment
- labelsbody · map<string,string>可选
labels
- encryptedbody · bool可选
是否为加密配置文件
- encrypt_algobody · string可选
加密算法
- supported_clientbody · enum(ConfigFileSupportedClient)可选
supported_client 枚举:CLIENT_SDK | CLIENT_AGENT | CLIENT_ALL
- persistentbody · ConfigFilePersistent可选
persistent
- encodingbody · string可选
encoding
- pathbody · string可选
path
- post_cmdbody · string可选
post_cmd
- config_typebody · enum(ConfigFileType)可选
config_type 枚举:CONFIG_FILE | CONFIG_TEMPLATE
- placeholder_value_mapbody · map<string,PlaceholderValue>可选
placeholder_value_map
- placeholderbody · string可选
占位符名称
- valuesbody · MatchString[]可选
values
- typebody · enum(MatchStringType)可选
type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE
- valuebody · string可选
value
- value_typebody · enum(ValueType)可选
value_type 枚举:TEXT | PARAMETER
响应字段
- codebody · uint32必填
业务码,成功多为 200000。
- infobody · string可选
提示信息。
- configFilebody · ConfigFile可选
返回中的 ConfigFile 实体字段(批量接口在 responses[] 内)。
- idbody · string可选
id
- namebody · string可选
name
- namespacebody · string可选
namespace
- groupbody · string可选
group
- contentbody · string可选
content
- formatbody · string可选
format
- commentbody · string可选
comment
- statusbody · string可选
status
- labelsbody · map<string,string>可选
labels
- ctimebody · string可选
ctime
- mtimebody · string可选
mtime
- rtimebody · string可选
rtime
- encryptedbody · bool可选
是否为加密配置文件
- encrypt_algobody · string可选
加密算法
- supported_clientbody · enum(ConfigFileSupportedClient)可选
supported_client 枚举:CLIENT_SDK | CLIENT_AGENT | CLIENT_ALL
- persistentbody · ConfigFilePersistent可选
persistent
- encodingbody · string可选
encoding
- pathbody · string可选
path
- post_cmdbody · string可选
post_cmd
- config_typebody · enum(ConfigFileType)可选
config_type 枚举:CONFIG_FILE | CONFIG_TEMPLATE
- placeholder_value_mapbody · map<string,PlaceholderValue>可选
placeholder_value_map
- placeholderbody · string可选
占位符名称
- valuesbody · MatchString[]可选
values
- typebody · enum(MatchStringType)可选
type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE
- valuebody · string可选
value
- value_typebody · enum(ValueType)可选
value_type 枚举:TEXT | PARAMETER
curl -sS -X POST 'http://127.0.0.1:8090/config/v1/files' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[{"namespace":"default","group":"docs-multi-gray","name":"app.yaml","content":"mode: baseline\n","format":"yaml"}]'{
"code": 200000,
"info": "execute success",
"amount": 1
}/config/v1/files需要鉴权更新配置文件
更新草稿内容;body 为数组。
参数
- Authorizationheader · string必填
登录返回的 token。
- (body)body · ConfigFile[]必填
请求体为 ConfigFile 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。
- idbody · string可选
id
- namebody · string可选
name
- namespacebody · string可选
namespace
- groupbody · string可选
group
- contentbody · string可选
content
- formatbody · string可选
format
- commentbody · string可选
comment
- labelsbody · map<string,string>可选
labels
- encryptedbody · bool可选
是否为加密配置文件
- encrypt_algobody · string可选
加密算法
- supported_clientbody · enum(ConfigFileSupportedClient)可选
supported_client 枚举:CLIENT_SDK | CLIENT_AGENT | CLIENT_ALL
- persistentbody · ConfigFilePersistent可选
persistent
- encodingbody · string可选
encoding
- pathbody · string可选
path
- post_cmdbody · string可选
post_cmd
- config_typebody · enum(ConfigFileType)可选
config_type 枚举:CONFIG_FILE | CONFIG_TEMPLATE
- placeholder_value_mapbody · map<string,PlaceholderValue>可选
placeholder_value_map
- placeholderbody · string可选
占位符名称
- valuesbody · MatchString[]可选
values
- typebody · enum(MatchStringType)可选
type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE
- valuebody · string可选
value
- value_typebody · enum(ValueType)可选
value_type 枚举:TEXT | PARAMETER
响应字段
- codebody · uint32必填
业务码,成功多为 200000。
- infobody · string可选
提示信息。
- configFilebody · ConfigFile可选
返回中的 ConfigFile 实体字段(批量接口在 responses[] 内)。
- idbody · string可选
id
- namebody · string可选
name
- namespacebody · string可选
namespace
- groupbody · string可选
group
- contentbody · string可选
content
- formatbody · string可选
format
- commentbody · string可选
comment
- statusbody · string可选
status
- labelsbody · map<string,string>可选
labels
- ctimebody · string可选
ctime
- mtimebody · string可选
mtime
- rtimebody · string可选
rtime
- encryptedbody · bool可选
是否为加密配置文件
- encrypt_algobody · string可选
加密算法
- supported_clientbody · enum(ConfigFileSupportedClient)可选
supported_client 枚举:CLIENT_SDK | CLIENT_AGENT | CLIENT_ALL
- persistentbody · ConfigFilePersistent可选
persistent
- encodingbody · string可选
encoding
- pathbody · string可选
path
- post_cmdbody · string可选
post_cmd
- config_typebody · enum(ConfigFileType)可选
config_type 枚举:CONFIG_FILE | CONFIG_TEMPLATE
- placeholder_value_mapbody · map<string,PlaceholderValue>可选
placeholder_value_map
- placeholderbody · string可选
占位符名称
- valuesbody · MatchString[]可选
values
- typebody · enum(MatchStringType)可选
type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE
- valuebody · string可选
value
- value_typebody · enum(ValueType)可选
value_type 枚举:TEXT | PARAMETER
curl -sS -X PUT 'http://127.0.0.1:8090/config/v1/files' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[{"namespace":"default","group":"docs-multi-gray","name":"app.yaml","content":"mode: next\n"}]'{
"code": 200000,
"info": "execute success",
"amount": 1
}/config/v1/files/delete需要鉴权删除配置文件
删除文件;handler 使用 body 数组(Enrich 文档有时写成 query)。
参数
- Authorizationheader · string必填
登录返回的 token。
- (body)body · ConfigFile[]必填
请求体为 ConfigFile 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。
- idbody · string可选
id
- namebody · string可选
name
- namespacebody · string可选
namespace
- groupbody · string可选
group
- contentbody · string可选
content
- formatbody · string可选
format
- commentbody · string可选
comment
- labelsbody · map<string,string>可选
labels
- encryptedbody · bool可选
是否为加密配置文件
- encrypt_algobody · string可选
加密算法
- supported_clientbody · enum(ConfigFileSupportedClient)可选
supported_client 枚举:CLIENT_SDK | CLIENT_AGENT | CLIENT_ALL
- persistentbody · ConfigFilePersistent可选
persistent
- encodingbody · string可选
encoding
- pathbody · string可选
path
- post_cmdbody · string可选
post_cmd
- config_typebody · enum(ConfigFileType)可选
config_type 枚举:CONFIG_FILE | CONFIG_TEMPLATE
- placeholder_value_mapbody · map<string,PlaceholderValue>可选
placeholder_value_map
- placeholderbody · string可选
占位符名称
- valuesbody · MatchString[]可选
values
- typebody · enum(MatchStringType)可选
type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE
- valuebody · string可选
value
- value_typebody · enum(ValueType)可选
value_type 枚举:TEXT | PARAMETER
响应字段
- codebody · uint32必填
业务码,成功多为 200000。
- infobody · string可选
提示信息。
- configFilebody · ConfigFile可选
返回中的 ConfigFile 实体字段(批量接口在 responses[] 内)。
- idbody · string可选
id
- namebody · string可选
name
- namespacebody · string可选
namespace
- groupbody · string可选
group
- contentbody · string可选
content
- formatbody · string可选
format
- commentbody · string可选
comment
- statusbody · string可选
status
- labelsbody · map<string,string>可选
labels
- ctimebody · string可选
ctime
- mtimebody · string可选
mtime
- rtimebody · string可选
rtime
- encryptedbody · bool可选
是否为加密配置文件
- encrypt_algobody · string可选
加密算法
- supported_clientbody · enum(ConfigFileSupportedClient)可选
supported_client 枚举:CLIENT_SDK | CLIENT_AGENT | CLIENT_ALL
- persistentbody · ConfigFilePersistent可选
persistent
- encodingbody · string可选
encoding
- pathbody · string可选
path
- post_cmdbody · string可选
post_cmd
- config_typebody · enum(ConfigFileType)可选
config_type 枚举:CONFIG_FILE | CONFIG_TEMPLATE
- placeholder_value_mapbody · map<string,PlaceholderValue>可选
placeholder_value_map
- placeholderbody · string可选
占位符名称
- valuesbody · MatchString[]可选
values
- typebody · enum(MatchStringType)可选
type 枚举:EXACT | REGEX | NOT_EQUALS | IN | NOT_IN | RANGE
- valuebody · string可选
value
- value_typebody · enum(ValueType)可选
value_type 枚举:TEXT | PARAMETER
curl -sS -X POST 'http://127.0.0.1:8090/config/v1/files/delete' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[{"namespace":"default","group":"docs-multi-gray","name":"app.yaml"}]'{
"code": 200000,
"info": "execute success",
"amount": 1
}/config/v1/files/export需要鉴权导出配置文件
导出配置文件。
参数
- Authorizationheader · string必填
登录返回的 token。
- namespacebody · string可选
namespace
- groupsbody · string[]可选
groups
- namesbody · string[]可选
names
- idsbody · uint64[]可选
ids
响应字段
- codebody · uint32必填
业务码。
- infobody · string可选
提示信息。
- ConfigFileExportRequestbody · ConfigFileExportRequest可选
实体字段。
- namespacebody · string可选
namespace
- groupsbody · string[]可选
groups
- namesbody · string[]可选
names
- idsbody · uint64[]可选
ids
curl -sS -X POST 'http://127.0.0.1:8090/config/v1/files/export' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[]'{
"code": 200000,
"info": "execute success"
}/config/v1/files/import需要鉴权导入配置文件
multipart/form-data 上传。
参数
- Authorizationheader · string必填
登录返回的 token。
- namespacequery · string可选
namespace
- groupquery · string可选
group
curl -sS -X POST 'http://127.0.0.1:8090/config/v1/files/import' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success"
}/config/v1/files/encrypt/algorithms需要鉴权加密算法列表
加密算法列表。
参数
- Authorizationheader · string必填
登录返回的 token。
curl -sS -X GET 'http://127.0.0.1:8090/config/v1/files/encrypt/algorithms' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success"
}/config/v1/files/subscribers需要鉴权配置订阅者
配置订阅者。
参数
- Authorizationheader · string必填
登录返回的 token。
- namespacequery · string可选
namespace
- groupquery · string可选
group
curl -sS -X GET 'http://127.0.0.1:8090/config/v1/files/subscribers' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success"
}/config/v1/files/client/subscription需要鉴权客户端订阅
客户端订阅。
参数
- Authorizationheader · string必填
登录返回的 token。
- namespacequery · string可选
namespace
- groupquery · string可选
group
curl -sS -X GET 'http://127.0.0.1:8090/config/v1/files/client/subscription' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success"
}/config/v1/file需要鉴权读取配置文件(兼容路径)
default-read 兼容路径,等同 /files/detail。
参数
- Authorizationheader · string必填
登录返回的 token。
- namespacequery · string必填
namespace
- groupquery · string必填
group
- namequery · string必填
name
curl -sS -X GET 'http://127.0.0.1:8090/config/v1/file' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success"
}/config/v1/files/encryptalgorithm需要鉴权加密算法(兼容路径)
等同 /files/encrypt/algorithms。
参数
- Authorizationheader · string必填
登录返回的 token。
curl -sS -X GET 'http://127.0.0.1:8090/config/v1/files/encryptalgorithm' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success"
}