Help Center> ServiceStage> API Reference> Git Repository Access APIs> Obtaining Repository Information Based on the Clone URL

Obtaining Repository Information Based on the Clone URL

Function

This API is used to obtain repository information based on the clone URL.

The request header parameter X-Repo-Auth needs to be added for this API. Its value is the name of the OAuth authorization created in Creating OAuth Authorization.

URI

GET /v1/{project_id}/git/repos/project-info

Table 1 describes the parameters.

Table 1 Path parameter

Parameter

Type

Mandatory

Description

project_id

String

Yes

Tenant's project ID.

Table 2 Query parameter

Parameter

Type

Mandatory

Description

clone_url

String

Yes

Clone URL of a repository.

Request

Request parameters

None

Response

Response parameters

Table 3 Response parameters

Parameter

Type

Description

namespace_id

String

Namespace ID.

namespace

String

Namespace.

project_id

String

Repository project ID.

project

String

Repository project.

Example

Example request

https://Endpoint/v1/7c6a62ddb2bf45a3920d8053d3cb8fbf/git/repos/project-info?clone_url=http://xxx.gitlab.com:8090/xxx/springcloud-xxbbon.git

Example response

{
  "project": "string"
  "namespace_id": "string",
  "namespace": "string",
  "project_id": "string",
  }

Status Code

Table 4 Status codes

HTTP Status Code

Description

200

OK

400

Bad Request

Error code must be in the format of SVCSTG.REPO.[Error_ID]. Example: SVCSTG.REPO.0401. See ServiceStage Error Codes.