文档

ListSearchRepository - 搜索代码仓库数据

根据查询条件搜索代码仓库数据。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求语法

POST /search/repo

请求参数

名称类型必填描述示例值
organizationIdstring

企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】

61e54b0e0bb300d827e1ae27
bodyobject

请求 Body

keywordstring

搜索关键字

test
aliyunPkstring

创建人的阿里云账号 ID,仅支持单人筛选

1840004904455497
visibilityLevelinteger

代码库的可见性

  • 0:私有
  • 10:企业可见
0
pageinteger

页码 默认值为 1,从第 1 页开始

1
pageSizeinteger

每页大小 默认值为 20,取值范围【1,100】

10
sortstring

排序方式,默认为 desc

  • desc:降序
  • asc:升序
desc
orderstring

排序字段,默认为 default

  • default:默认排序,即综合排序
  • created_at:创建时间
  • updated_at:更新时间
  • star:收藏数
  • like:点赞数
  • comment:评论数
  • reply:回复数
default
scopestring

搜索范围,默认为 all

  • all:全局范围,公开库以及有权限的 private 库
  • mine:只作为库或组成员,并且有读权限
all
repoPathobject

代码仓库查询条件

valuestring

代码库的全路径,例如:organization/group/repo

说明 若有多个代码库全路径,使用英文逗号","隔开
orgId/test-group/spring-boot-demo
operatorTypestring

查询条件类型

  • equal:等于
  • unequal:不等于
  • and:与
  • or:或
  • not:非
equal
matchTypestring

查询匹配类型

  • term:精确匹配
  • regex:正则匹配
  • phrase:短语匹配,默认方式
  • wildcard:模糊匹配
term

返回参数

名称类型描述示例值
object

Schema of Response

requestIdstring

请求 ID

F7B85D1B-D1C2-140F-A039-341859F130B9
errorCodestring

错误码

Openapi.RequestError
errorMessagestring

错误信息

""
successboolean

请求是否成功

true
totallong

总记录数

30
resultobject []

返回列表

docIdstring

文档 ID

60d54f3daccf2bbd6659f3ad/gitlabhq/master/config/environments/test.rb
highlightTextMapobject

高亮文本信息

organizationIdstring

高亮企业 ID

60de7a6852743a5162b5f957
creatorUserIdstring

创建人的 userId,此处为用户的云效 ID

xxx
repoPathstring

代码库完整路径(含完整组路径)

codeup/test-repo
repoNameWithNamespacestring

代码库完整名称(带完整组名称)

codeup/test-repo
readMestring

readme 文件高亮信息

xx
descriptionstring

代码库描述

描述内容
sourceobject

ES 返回的源信息

repoNamestring

代码库名称

test-repo
repoPathstring

代码库完整路径(含完整组路径)

codeup/test-repo
descriptionstring

代码库描述信息

描述内容
visibilityLevelinteger

可见性

  • 0:私有,仅代码库成员可见
  • 10:企业内公开,企业成员可见
0
createTimestring

创建时间

2022-10-10 10:10:10
lastActivityTimestring

最近一次活跃的时间

2022-11-11 11:11:11
readMestring

readme 文件的内容

xxx
organizationIdstring

企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】

62a94a8611fc0f0c9e2a7bc1

示例

正常返回示例

JSON格式

{
  "requestId": "F7B85D1B-D1C2-140F-A039-341859F130B9",
  "errorCode": "Openapi.RequestError",
  "errorMessage": "\"\"",
  "success": true,
  "total": 30,
  "result": [
    {
      "docId": "\t\n60d54f3daccf2bbd6659f3ad/gitlabhq/master/config/environments/test.rb",
      "highlightTextMap": {
        "organizationId": "60de7a6852743a5162b5f957",
        "creatorUserId": "xxx",
        "repoPath": "codeup/test-repo",
        "repoNameWithNamespace": "codeup/test-repo",
        "readMe": "xx",
        "description": "描述内容"
      },
      "source": {
        "repoName": "test-repo",
        "repoPath": "codeup/test-repo",
        "description": "描述内容",
        "visibilityLevel": 0,
        "createTime": "2022-10-10 10:10:10",
        "lastActivityTime": "2022-11-11 11:11:11",
        "readMe": "xxx",
        "organizationId": "62a94a8611fc0f0c9e2a7bc1"
      }
    }
  ]
}

错误码

HTTP status code错误码错误信息描述
403Forbidden.AccessDeniedThe user is not authorized to perform the operation.用户无权限执行相关操作
403Forbidden.UserNotInCurrentOrganizationThe user is not in the organization and is not authorized to perform the operation.当前用户不在该企业中,无权进行操作。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
暂无变更历史
  • 本页导读 (0)
文档反馈