查询模板详情(V3)
功能介绍
获取指定模板详情,包括模板id、名称、描述、作者、标签、上架时间等信息。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
GET /v3/templates/{template_id}
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
template_id |
是 |
String |
模板ID,通过查询模板列表接口可获取相应的模板ID。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Language |
否 |
String |
语言类型,缺省值为“zh-cn”。 枚举值:
|
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
模板id。 |
title |
String |
模板名称。 |
description |
String |
模板描述。 |
creator_id |
String |
模板创建者id。 |
creator |
String |
模板创建者,有别名返回别名。 |
nickname |
String |
模板创建者,有别名返回别名。 |
score |
Integer |
模板评分(点赞数)。 |
status |
Integer |
模板状态:
|
view_count |
Integer |
访问量。 |
usage_count |
Integer |
引用量。 |
created_at |
String |
创建时间。 |
updated_at |
String |
更新时间。 |
published_at |
String |
上架时间。 |
favorite_state |
Integer |
点赞状态:
|
maintainers |
Array of strings |
模板相关联的所有维护人账号名称。 |
platform_source |
Integer |
平台来源:
|
properties |
Object |
模板自定义参数列表。 |
dependencies |
Array of objects |
dependency信息。 |
dependency_type |
String |
dependency类型:
|
store |
Integer |
代码存储位置:
|
store_info |
String |
获取代码模版所需的信息。 |
file_size |
Integer |
模板文件解压缩之后的大小(单位:KB)。 |
deployment |
Object |
部署信息。 |
is_static |
Integer |
动、静态代码模板标识:
|
update_id |
String |
模板关联更新态Id。 |
topic |
Array of TopicCategory objects |
模板标签。 |
tags |
Array of TagInfo objects |
自定义标签。 |
dependents |
Array of Dependent objects |
模板部署支持方式信息 |
请求示例
GET https://{endpoint}/v3/templates/0633650ed8a7e69212eed4c348eb6b8d
响应示例
状态码: 200
OK
{
"id" : "12345678901234567890123456789012",
"title" : "CodeArts Demo1",
"description" : "软件开发云演示项目",
"creator" : "someone",
"nickname" : "小黑",
"score" : 9999,
"status" : 1,
"view_count" : 1432,
"usage_count" : 256,
"created_at" : "2019-09-20T18:20:30Z",
"updated_at" : "2019-11-20T13:22:30Z",
"published_at" : "2019-11-20T13:26:39Z",
"favorite_state" : 0,
"maintainers" : [ "devstar_s12345" ],
"properties" : [ {
"key" : "projectName",
"defaultValue" : "angular",
"label" : "Project Name",
"type" : "text",
"helpText" : "Name of the Project.",
"readOnly" : false,
"required" : false,
"regType" : "reg",
"regPattern" : "^[a-z0-9-_@/]{1,64}$",
"regTip" : "请输入1-64位数字、小写字母、中划线、下划线、斜线、@",
"options" : [ ],
"eventOnchange" : [ ],
"show" : true,
"projectName" : false,
"isShow" : true,
"isProjectName" : false
} ],
"dependencies" : [ {
"description" : "",
"groupName" : "Developer Tools",
"id" : "",
"items" : [ {
"description" : "Provides fast application restarts, LiveReload, and configurations for enhanced development experience.",
"id" : "devtools",
"name" : "Spring Boot DevTools",
"recommended" : false,
"versionProperty" : "",
"versionRange" : ""
} ],
"name" : "",
"recommended" : false,
"versionProperty" : "",
"versionRange" : ""
} ],
"dependency_type" : "1",
"store" : 2,
"store_info" : {
"relativePath" : "00a25b276a54490db1258cdb32635db8/1596107175142",
"hasRootDir" : false,
"rootDir" : null
},
"dependents" : [ {
"name" : "functiongraph",
"dependent_services" : [ {
"name" : "OBS",
"description" : "对象存储服务",
"home_link" : "https://www.huaweicloud.com/product/obs.html",
"subscribe_link" : "https://www.huaweicloud.com/product/obs.html",
"subscribe_guide" : "请跳转服务页面点击开通服务",
"type" : "存储",
"reference_price" : null,
"price_details_link" : "https://support.huaweicloud.com/productdesc-obs/obs_03_0211.html",
"specifications" : [ {
"cpu" : "0.5"
}, {
"ram" : "1GB"
} ]
} ]
} ]
}
状态码: 400
Bad Request
{
"error_code" : "DEVSTAR.1001",
"error_msg" : "id : 非法参数"
}
状态码: 404
Not Found
{
"error_code" : "DEVSTAR.1037",
"error_msg" : "该模板不存在"
}
状态码
状态码 |
描述 |
---|---|
200 |
OK |
400 |
Bad Request |
404 |
Not Found |
错误码
请参见错误码。