Lattice Hub 文档
HTTP OpenAPI

命名空间

环境维度的 Namespace CRUD。

环境维度的 Namespace CRUD。

默认 Base URL:http://127.0.0.1:8090。管理面接口需 Authorization(登录返回的 token)。

命名空间

Namespace = 运行环境,不是租户。写接口 body 为 Namespace 数组。

GET/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" }]
}
POST/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
}
PUT/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
}
POST/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
}
GET/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
}

On this page