命名空间
环境维度的 Namespace CRUD。
环境维度的 Namespace CRUD。
默认 Base URL:http://127.0.0.1:8090。管理面接口需 Authorization(登录返回的 token)。
命名空间
Namespace = 运行环境,不是租户。写接口 body 为 Namespace 数组。
/core/v1/namespaces需要鉴权查询命名空间
列出命名空间。
参数
- Authorizationheader · string必填
登录返回的 token。
- namequery · string可选
按名称过滤(Enrich 标为必填,实际可空表示全部)。
- offsetquery · integer可选
偏移,默认 0。
- limitquery · integer可选
分页大小,最大 100。
curl -sS 'http://127.0.0.1:8090/core/v1/namespaces?limit=20' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success",
"namespaces": [{ "name": "default" }, { "name": "pole-system" }]
}/core/v1/namespaces需要鉴权创建命名空间
写接口 body 多为 protobuf 消息数组;下列为单条对象字段(见 specification)。
参数
- Authorizationheader · string必填
登录返回的 token。
- (body)body · Namespace[]必填
请求体为 Namespace 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。
- idbody · string可选
id
- namebody · string必填
name
- commentbody · string可选
comment
- ownersbody · string可选
owners
- tokenbody · string可选
token
- service_export_tobody · string[]可选
service_export_to
- metadatabody · map<string,string>可选
metadata
响应字段
- codebody · uint32必填
业务码,成功多为 200000。
- infobody · string可选
提示信息。
- namespacebody · Namespace可选
返回中的 Namespace 实体字段(批量接口在 responses[] 内)。
- idbody · string可选
id
- namebody · string可选
name
- commentbody · string可选
comment
- ownersbody · string可选
owners
- tokenbody · string可选
token
- ctimebody · string可选
ctime
- mtimebody · string可选
mtime
- service_export_tobody · string[]可选
service_export_to
- metadatabody · map<string,string>可选
metadata
- total_service_countbody · uint32可选
total_service_count
- total_health_instance_countbody · uint32可选
total_health_instance_count
- total_instance_countbody · uint32可选
total_instance_count
- total_config_file_countbody · uint32可选
total_config_file_count
- editablebody · bool可选
editable
- deleteablebody · bool可选
deleteable
curl -sS -X POST 'http://127.0.0.1:8090/core/v1/namespaces' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[{"name":"staging","comment":"pre-prod"}]'{
"code": 200000,
"info": "execute success",
"amount": 1
}/core/v1/namespaces需要鉴权更新命名空间
更新命名空间;body 为数组。
参数
- Authorizationheader · string必填
登录返回的 token。
- (body)body · Namespace[]必填
请求体为 Namespace 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。
- idbody · string可选
id
- namebody · string可选
name
- commentbody · string可选
comment
- ownersbody · string可选
owners
- tokenbody · string可选
token
- service_export_tobody · string[]可选
service_export_to
- metadatabody · map<string,string>可选
metadata
响应字段
- codebody · uint32必填
业务码,成功多为 200000。
- infobody · string可选
提示信息。
- namespacebody · Namespace可选
返回中的 Namespace 实体字段(批量接口在 responses[] 内)。
- idbody · string可选
id
- namebody · string可选
name
- commentbody · string可选
comment
- ownersbody · string可选
owners
- tokenbody · string可选
token
- ctimebody · string可选
ctime
- mtimebody · string可选
mtime
- service_export_tobody · string[]可选
service_export_to
- metadatabody · map<string,string>可选
metadata
- total_service_countbody · uint32可选
total_service_count
- total_health_instance_countbody · uint32可选
total_health_instance_count
- total_instance_countbody · uint32可选
total_instance_count
- total_config_file_countbody · uint32可选
total_config_file_count
- editablebody · bool可选
editable
- deleteablebody · bool可选
deleteable
curl -sS -X PUT 'http://127.0.0.1:8090/core/v1/namespaces' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[{"name":"staging","comment":"updated"}]'{
"code": 200000,
"info": "execute success",
"amount": 1
}/core/v1/namespaces/delete需要鉴权删除命名空间
删除命名空间;body 为含 name 的数组。
参数
- Authorizationheader · string必填
登录返回的 token。
- (body)body · Namespace[]必填
请求体为 Namespace 的 JSON 数组:[{...}, ...]。下列字段为数组中单条对象的完整字段(含嵌套)。
- idbody · string可选
id
- namebody · string可选
name
- commentbody · string可选
comment
- ownersbody · string可选
owners
- tokenbody · string可选
token
- service_export_tobody · string[]可选
service_export_to
- metadatabody · map<string,string>可选
metadata
响应字段
- codebody · uint32必填
业务码,成功多为 200000。
- infobody · string可选
提示信息。
- namespacebody · Namespace可选
返回中的 Namespace 实体字段(批量接口在 responses[] 内)。
- idbody · string可选
id
- namebody · string可选
name
- commentbody · string可选
comment
- ownersbody · string可选
owners
- tokenbody · string可选
token
- ctimebody · string可选
ctime
- mtimebody · string可选
mtime
- service_export_tobody · string[]可选
service_export_to
- metadatabody · map<string,string>可选
metadata
- total_service_countbody · uint32可选
total_service_count
- total_health_instance_countbody · uint32可选
total_health_instance_count
- total_instance_countbody · uint32可选
total_instance_count
- total_config_file_countbody · uint32可选
total_config_file_count
- editablebody · bool可选
editable
- deleteablebody · bool可选
deleteable
curl -sS -X POST 'http://127.0.0.1:8090/core/v1/namespaces/delete' \
-H "Authorization: $TOKEN" \
-H 'Content-Type: application/json' \
-d '[{"name":"staging"}]'{
"code": 200000,
"info": "execute success",
"amount": 1
}/core/v1/clients需要鉴权查询客户端列表
列出已上报客户端。
参数
- Authorizationheader · string必填
登录返回的 token。
- limitquery · integer可选
分页大小。
curl -sS 'http://127.0.0.1:8090/core/v1/clients?limit=20' \
-H "Authorization: $TOKEN"{
"code": 200000,
"info": "execute success",
"amount": 1
}