Obtaining a Public Template List
Function
This API is used to obtain a public template list.
URI
GET /v2/repositories/repository-templates
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
platform |
No |
String |
Template platform type. |
|
language |
No |
String |
Language. |
|
pipeline |
No |
String |
Whether pipelines are supported. |
|
enter_type |
No |
String |
Template category. |
|
search |
No |
String |
Template name. |
|
date_order |
No |
String |
Templates date order. |
|
used_time_order |
No |
String |
Template reference time. |
|
type |
No |
String |
Template visibility. |
|
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 |
Explanation: User token. It can be obtained by calling the corresponding IAM API. The value of X-Subject-Token in the response header is the user token. Constraints: Mandatory Range: 1–100,000 characters. Default value: None |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
Error object |
Response error. |
|
result |
TemplateRepositoryList object |
Response result. |
|
status |
String |
Response status. |
|
Parameter |
Type |
Description |
|---|---|---|
|
projects |
Array of TemplateRepository objects |
Template list. |
|
total |
Integer |
Total number of templates. |
|
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 |
Template reference time. |
|
liked_times |
Integer |
Likes. |
|
creator_name |
String |
Template creator. |
|
https_url |
String |
Template HTTPS link. |
Example Requests
GET https://{endpoint}/v2/repositories/repository-templates?page_no=1&page_size=10
Example Responses
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" : "repo",
"https_url" : "https://repo.alpha.devcloud.inhuawei.com/chentest00001/javaMavenDemo.git"
} ],
"total" : 100
},
"status" : "success"
}
Status Codes
|
Status Code |
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.