ListSearchRepository

Updated at:

Searches for code repository data based on query conditions.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /search/repo HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

organizationId

string

Yes

The enterprise identifier, also known as the enterprise ID. It is a string that can be obtained from the Yunxiao access link, such as https://devops.aliyun.com/organization/[OrganizationId].

61e54b0e0bb300d827e1ae27

body

object

Yes

The request body.

keyword

string

Yes

The search keyword.

test

aliyunPk

string

No

The Alibaba Cloud account ID of the creator. Only single-user filtering is supported.

1840004904455497

visibilityLevel

integer

No

The visibility of the code repository. Valid values:

  • 0: Private.

  • 10: Visible to the enterprise.

0

page

integer

No

The page number. Default value: 1. The pages start from page 1.

1

pageSize

integer

No

The number of entries per page. Default value: 20. Valid values: 1 to 100.

10

sort

string

No

The sort order. Default value: desc. Valid values:

  • desc: Descending order.

  • asc: Ascending order.

desc

order

string

No

The sort field. Default value: default. Valid values:

  • default: Default sort order, which is comprehensive sorting.

  • created_at: Creation time.

  • updated_at: Update time.

  • star: Number of favorites.

  • like: Number of likes.

  • comment: Number of comments.

  • reply: Number of replies.

default

scope

string

No

The search scope. Default value: all. Valid values:

  • all: Global scope, including public repositories and private repositories that you have permissions to access.

  • mine: Repositories where you are a repository or group member and have read permissions.

all

repoPath

object

No

The query conditions for the code repository.

value

string

No

The full path of the code repository, such as organization/group/repo. If multiple full paths are specified, separate them with commas (,).

orgId/test-group/spring-boot-demo

operatorType

string

No

The type of the query condition. Valid values:

  • equal: Equal to.

  • unequal: Not equal to.

  • and: AND.

  • or: OR.

  • not: NOT.

equal

matchType

string

No

The match type of the query. Valid values:

  • term: Exact match.

  • regex: Regular expression match.

  • phrase: Phrase match. This is the default match type.

  • wildcard: Fuzzy match.

term

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

The request ID.

F7B85D1B-D1C2-140F-A039-341859F130B9

errorCode

string

The error code.

Openapi.RequestError

errorMessage

string

The error message.

""

success

boolean

Indicates whether the request is successful.

true

total

integer

The total number of records.

30

result

array<object>

The returned list.

array<object>

The returned repository data.

docId

string

The document ID.

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

highlightTextMap

object

The highlighted text information.

organizationId

string

The highlighted enterprise ID.

60de7a6852743a5162b5f957

creatorUserId

string

The user ID of the creator, which is the Yunxiao ID of the user.

xxx

repoPath

string

The full path of the code repository, including the full group path.

codeup/test-repo

repoNameWithNamespace

string

The full name of the code repository, including the full group name.

codeup/test-repo

readMe

string

The highlighted information of the README file.

xx

description

string

The description of the code repository.

Description content

source

object

The source information returned by Elasticsearch.

repoName

string

The name of the code repository.

test-repo

repoPath

string

The full path of the code repository, including the full group path.

codeup/test-repo

description

string

The description of the code repository.

Description content

visibilityLevel

integer

The visibility. Valid values:

  • 0: Private. Visible only to members of the code repository.

  • 10: Public within the enterprise. Visible to members of the enterprise.

0

createTime

string

The creation time.

2022-10-10 10:10:10

lastActivityTime

string

The time of the last activity.

2022-11-11 11:11:11

readMe

string

The content of the README file.

xxx

organizationId

string

The enterprise identifier, also known as the enterprise ID. It is a string that can be obtained from the Yunxiao access link, such as https://devops.aliyun.com/organization/[OrganizationId].

62a94a8611fc0f0c9e2a7bc1

Examples

Success response

JSON format

{
  "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"
      }
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

403 Forbidden.AccessDenied The user is not authorized to perform the operation. The user is not authorized to perform the operation.
403 Forbidden.UserNotInCurrentOrganization The user is not in the organization and is not authorized to perform the operation.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.