Obtaining the List of Public Sample Templates (Deprecated)
Function
Obtain the list of public sample templates.
URI
GET /v1/repositories/repository_templates
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| platform | No | String | Template platform type |
| language | No | String | Language |
| pipeline | No | String | Whether pipelines are supported |
| entertype | No | String | Template tag |
| search | No | String | Template name |
| dateorder | No | String | Sort templates by date |
| usedtimeorder | No | String | Sort template by reference times |
| type | No | String | Explanation: Template visibility Range:
|
| region | No | String | Region name |
| page_no | Yes | Integer | Page number |
| page_size | Yes | Integer | Number of data records on each page |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. The user token can be obtained by calling the corresponding IAM API. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| error | Error object | Response error |
| result | TemplateRepositoryList object | Response result |
| status | String | Explanation: Response status Range:
|
| Parameter | Type | Description |
|---|---|---|
| projects | Array of TemplateRepository objects | Template list |
| total | Integer | Total number of template |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Template unique ID |
| name | String | Template name |
| template_name | String | Name of the repository associated with the template |
| tags | Array of strings | Template tag |
| description | String | Template description |
| brief_introduction | String | Template overview |
| auto_pending_pipelines | Integer | Whether to automatically create a pipeline |
| language | String | Template language category |
| created_at | String | Template creation time |
| used_times | Integer | Reference time |
| liked_times | Integer | Likes |
| creator_name | String | Template creator |
| https_url | String | Template HTTPS link |
Request Example
GET https://{endpoint}/v1/repositories/repository_templates Response Example
Status code: 200
OK
{
"result" : {
"projects" : [ {
"id" : 453613,
"name" : "javaMavenDemo",
"template_name" : "javaMavenDemo",
"tags": ["UnsupportedPipeline", "OTHERS", " Kunpeng ARM64"],
"description" : "javaMavenDemo",
"brief_introduction" : "javaMavenDemo",
"auto_pending_pipelines" : 0,
"language" : "OTHERS",
"created_at" : "Sep 25, 2019 4:03:31 PM",
"used_times" : 58,
"liked_times" : 1,
"creator_name" : "Codehub",
"https_url" : "https://codehub.alpha.devcloud.intest.com/chentest00001/javaMavenDemo.git"
} ],
"total" : 100
},
"status" : "success"
} Status Codes
| Status Codes | Description |
|---|---|
| 200 | OK |
Error Codes
See error codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
