更新时间:2024-08-22 GMT+08:00
分享

查询微服务列表

功能介绍

查询微服务列表

调用方法

请参见如何调用API

URI

POST /v2/{cloudProjectId}/component/list/query

表1 路径参数

参数

是否必选

参数类型

描述

cloudProjectId

String

项目ID

请求参数

表2 请求Body参数

参数

是否必选

参数类型

描述

offset

Integer

偏移

limit

Integer

大小

name

String

微服务名称

sort_dir

String

排序方向

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

data

Array of ComponentVO objects

数据

total

Integer

记录总数

表4 ComponentVO

参数

参数类型

描述

id

String

微服务ID

name

String

微服务名称

type

String

类型

description

String

描述

status

String

状态

parent_id

String

父ID

cloud_project_id

String

项目ID

repos

Array of ComponentRepoVO objects

微服务代码仓

is_followed

Boolean

组件是否被收藏

creator_id

String

创建人ID

creator_name

String

创建人名称

create_time

String

创建时间

updater_id

String

更新人ID

updater_name

String

更新人名称

update_time

String

更新时间

表5 ComponentRepoVO

参数

参数类型

描述

type

String

类型

repo_id

String

Repo仓库ID

http_url

String

仓库HTTP地址

git_url

String

仓库GIT地址

branch

String

分支

language

String

语言

endpoint_id

String

端点ID

请求示例

GET https://{endpoint}/v2/2d09f712e9504b61b034cc8f40e475a8/component/list/query

{
  "offset" : 0,
  "limit" : 10,
  "name" : "",
  "sort_dir" : ""
}

响应示例

状态码: 200

查询微服务列表响应体

{
  "data" : [ {
    "id" : "f7ced2341b204d2b82c607c6f0de5b4a",
    "name" : "11",
    "type" : "microservice",
    "description" : null,
    "status" : "active",
    "parent_id" : null,
    "cloud_project_id" : "2d09f712e9504b61b034cc8f40e475a8",
    "repos" : null,
    "is_followed" : true,
    "creator_id" : "05d8ca972f114765a8984795a8aa4d41",
    "creator_name" : "north-5",
    "create_time" : "1709260209",
    "updater_id" : "05d8ca972f114765a8984795a8aa4d41",
    "updater_name" : "north-5",
    "update_time" : "1719319144"
  } ],
  "total" : 1
}

状态码

状态码

描述

200

查询微服务列表响应体

错误码

请参见错误码

相关文档