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.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| project_id | String | Yes | Tenant's project ID. |
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| clone_url | String | Yes | Clone URL of a repository. |
Request
Request parameters
None
Response
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
| 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.
Last Article: Obtaining a Repository Namespace
Next Article: Obtaining All Projects in a Namespace
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.