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

更新微服务代码仓

功能介绍

更新微服务代码仓

调用方法

请参见如何调用API

URI

PUT /v2/{cloudProjectId}/component/{componentId}/repo/update

表1 路径参数

参数

是否必选

参数类型

描述

cloudProjectId

String

项目ID

componentId

String

微服务ID

请求参数

表2 请求Body参数

参数

是否必选

参数类型

描述

[数组元素]

Array of ComponentRepoVO objects

微服务代码仓

表3 ComponentRepoVO

参数

是否必选

参数类型

描述

type

String

类型

repo_id

String

Repo仓库ID

http_url

String

仓库HTTP地址

git_url

String

仓库GIT地址

branch

String

分支

language

String

语言

endpoint_id

String

端点ID

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

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

请求示例

PUT https://{endpoint}/v2/2d09f712e9504b61b034cc8f40e475a8/component/f7ced2341b204d2b82c607c6f0de5b4a/repo/update

[ {
  "type" : "codehub",
  "repo_id" : "804934",
  "http_url" : "https://example.com/test00001/maven.git",
  "git_url" : "git@example.com:test00001/maven.git",
  "branch" : "master",
  "language" : "python",
  "endpoint_id" : ""
} ]

响应示例

状态码: 200

更新微服务代码仓响应体

{
  "id" : "f7ced2341b204d2b82c607c6f0de5b4a",
  "name" : "11",
  "type" : "microservice",
  "description" : "112",
  "status" : "active",
  "parent_id" : null,
  "cloud_project_id" : "2d09f712e9504b61b034cc8f40e475a8",
  "repos" : [ {
    "type" : "codehub",
    "repo_id" : "804934",
    "http_url" : "https://example.com/test00001/maven.git",
    "git_url" : "git@example.com:test00001/maven.git",
    "branch" : "master",
    "language" : "python",
    "endpoint_id" : ""
  } ],
  "is_followed" : null,
  "creator_id" : "05d8ca972f114765a8984795a8aa4d41",
  "creator_name" : "p_test5",
  "create_time" : "1709260209",
  "updater_id" : "05d8ca972f114765a8984795a8aa4d41",
  "updater_name" : "p_test5",
  "update_time" : "1719318495"
}

状态码

状态码

描述

200

更新微服务代码仓响应体

错误码

请参见错误码

相关文档