查看运维模板
更新时间:2026-07-16
描述
该接口用于查看运维模版详情。
OpenAPI Explorer
去调试
您可以在 OpenAPI Explorer 中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer 可以自动生成 SDK 代码示例。
请求结构
Plain Text
1GET /v{version}/template?namespace={namespace}&id={id}&name={name}&type={type}&locale={locale}
2Host: oos.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| version | String | 是 | URL参数 | API版本号,当前取值为2 |
| namespace | String | 否 | Query参数 | 名称空间,默认 default |
| id | String | 否 | Query参数 | 运维模板 ID |
| name | String | 否 | Query参数 | 运维模板名称 |
| type | String | 否 | Query参数 | 模板类型 INDIVIDUAL/GLOBAL |
| locale | String | 否 | Query参数 | 语言,默认 zh-cn |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| success | Boolean | 请求是否成功 |
| msg | String | 失败时返回失败原因,成功时为空字符串 |
| code | Integer | 状态码 |
| result | Template |
请求示例
Plain Text
1GET /v{version}/template?namespace={namespace}&id=tpl-Obwxxxxx&name=test_oos_template&type={type}&locale={locale}
2Host: oos.bj.baidubce.com
3Authorization: authorization string
返回示例
Plain Text
1200 Success
2
3{
4 "success" : true,
5 "msg" : "",
6 "code" : 200,
7 "result" : {
8 "id" : "tpl-Obwxxxxx",
9 "name" : "Test",
10 "description" : "这是描述",
11 "linear" : true,
12 "parallelism" : 0,
13 "operators" : [ {
14 "name" : "testCMD",
15 "description" : "exec cmd on agent",
16 "operator" : "BCE::Agent::ExecuteShell",
17 "label" : "",
18 "retries" : 0,
19 "retryInterval" : 60000,
20 "timeout" : 300000,
21 "parallelismRatio" : 0,
22 "parallelismCount" : 0,
23 "parallelismControl" : {
24 "ratio" : 0,
25 "count" : 0
26 },
27 "allowedFailureRatio" : 0,
28 "allowedFailureCount" : 0,
29 "allowedFailureControl" : {
30 "ratio" : 0,
31 "count" : 0
32 },
33 "manually" : false,
34 "scheduleDelayMilli" : 0,
35 "waitOnAgentMilli" : 0,
36 "pauseOnFailure" : false,
37 "triggerRule" : "ALL_SUCCESS",
38 "loopWindowType" : "SLICING",
39 "properties" : {
40 "execUser" : "root",
41 "workDir" : "/",
42 "__workerSelectors__" : {
43 "Ref" : "instanceList"
44 },
45 "content" : "echo 'hello world'"
46 }
47 } ],
48 "properties" : [ {
49 "name" : "instanceList",
50 "required" : true,
51 "type" : "bccInstance",
52 "multiple" : false,
53 "description" : "instance list"
54 } ],
55 "supportedInstanceTypes" : [ "BCC" ]
56 }
57}
评价此篇文章
