更新时间:2025-10-29 GMT+08:00
分享

查询插件模板列表

功能介绍

查询插件模板列表接口用于获取插件模板的基本信息列表。该接口适用于以下场景:当需要浏览或管理插件模板时,用户可通过此接口查询所有可用的插件模板信息,以便选择或进一步操作。使用该接口的前提条件是用户具有访问插件模板的权限,且插件模板服务处于正常运行状态。查询操作完成后,用户将获得插件模板的列表信息,包括模板名称、类型、版本等,便于后续的插件开发或管理。若用户无权限访问、插件模板服务不可用或请求参数无效,接口将返回相应的错误信息。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v2/{project_id}/plugintemplates

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

参数解释:用户项目ID。获取方法请参见获取项目ID和名称

约束限制:1 - 64字符,字母、数字和中划线。

取值范围:不涉及。

默认取值:不涉及。

表2 Query参数

参数

是否必选

参数类型

描述

templateName

String

参数解释:指定的插件名称,填写则查询指定名称的插件。

约束限制:不涉及

取值范围:不涉及。

默认取值:不涉及。

poolName

String

参数解释:指定的资源池名称,填写则查询符合资源池安装条件的插件列表。

约束限制:不涉及

取值范围:不涉及。

默认取值:不涉及。

请求参数

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

apiVersion

String

参数解释:API版本。

取值范围:可选值如下:

  • v1。

kind

String

参数解释:API类型。

取值范围:可选值如下:

  • PluginTemplateList:插件模板列表。

items

Array of PluginTemplateV2 objects

参数解释:插件模板列表。

表4 PluginTemplateV2

参数

参数类型

描述

apiVersion

String

参数解释:API版本。

取值范围:可选值如下:

  • v2

kind

String

参数解释:资源类型。

取值范围:可选值如下:

  • PluginTemplate:插件模板

metadata

PluginTemplateMetadata object

参数解释:插件模板的metadata信息。

spec

PluginTemplateSpecV2 object

参数解释:插件模板的具体信息,如版本列表。

表5 PluginTemplateMetadata

参数

参数类型

描述

name

String

参数解释:插件模板的名称。

取值范围:不涉及。

annotations

Map<String,String>

参数解释:插件模板注解,由key/value组成。

表6 PluginTemplateSpecV2

参数

参数类型

描述

optional

Boolean

参数解释:是否为必安装插件。

取值范围

  • true:是

  • false:否

type

String

参数解释:插件模板类型。

取值范围:可选值如下:

  • helm:helm类型

  • ccePlugin:CCE类型

logoURL

String

参数解释:Logo图片地址。

取值范围:不涉及。

description

String

参数解释:插件模板描述。

取值范围:不涉及。

versions

Array of PluginTemplateVersionV2 objects

参数解释:插件模板版本的详细信息。

表7 PluginTemplateVersionV2

参数

参数类型

描述

version

String

参数解释:插件模板的版本号。

取值范围:不涉及。

creationtimestamp

String

参数解释:创建时间。

取值范围:不涉及。

inputs

Object

参数解释:插件安装参数。

translate

Object

参数解释:供界面使用的翻译信息。

description

String

参数解释:版本描述信息。

取值范围:不涉及。

detail

String

参数解释:版本描述信息。

取值范围:不涉及。

状态码:404

表8 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:ModelArts错误码。

取值范围:不涉及。

error_msg

String

参数解释:具体错误信息。

取值范围:不涉及。

请求示例

查询node-local-dns插件模板详情。

GET /v2/{projectId}/plugintemplates?templateName=node-local-dns

{
  "kind" : "PluginTemplateList",
  "apiVersion" : "v2",
  "items" : [ {
    "kind" : "PluginTemplate",
    "apiVersion" : "v2",
    "metadata" : {
      "name" : "node-local-dns",
      "annotations" : {
        "os.modelarts.plugin/release.name" : "NodeLocal DNSCache"
      }
    },
    "spec" : {
      "optional" : true,
      "versions" : [ {
        "version" : "1.6.63",
        "description" : "NodeLocal DNSCache improves Cluster DNS performance by running a dns caching agent on cluster nodes as a DaemonSet.",
        "creationTimestamp" : "2023-05-20T08:50:31Z",
        "inputs" : {
          "parameters" : {
            "custom" : {
              "annotations" : { },
              "enable_dnsconfig_admission" : true,
              "enable_namespace_admission" : true,
              "image" : {
                "args" : {
                  "healthPort" : 8080,
                  "interfaceName" : "nodelocaldns",
                  "setupIptables" : false,
                  "skipTeardown" : true,
                  "skipteardown" : true,
                  "syncInterval" : "1ns",
                  "upstreamSvc" : "coredns"
                },
                "name" : "node-cache",
                "pullPolicy" : "Always"
              },
              "multiAZBalance" : false,
              "multiAZEnabled" : false,
              "nameserver" : "",
              "ndots" : "5",
              "node_match_expressions" : [ ],
              "search" : "",
              "tolerations" : [ {
                "effect" : "NoExecute",
                "key" : "node.kubernetes.io/not-ready",
                "operator" : "Exists",
                "tolerationSeconds" : 60
              }, {
                "effect" : "NoExecute",
                "key" : "node.kubernetes.io/unreachable",
                "operator" : "Exists",
                "tolerationSeconds" : 60
              } ],
              "zones" : [ {
                "plugins" : {
                  "cache" : {
                    "denial" : { },
                    "parameters" : 30,
                    "prefetch" : { },
                    "server_stale" : false,
                    "success" : { }
                  },
                  "debug" : false,
                  "errors" : true,
                  "forward" : {
                    "expire" : "",
                    "force_tcp" : false,
                    "health_check" : "",
                    "max_fails" : "",
                    "parameters" : "__PILLAR__UPSTREAM__SERVERS__",
                    "policy" : "",
                    "prefer_udp" : false
                  },
                  "log" : {
                    "classes" : "all",
                    "format" : "combined"
                  },
                  "prometheus" : true,
                  "reload" : true
                },
                "zone" : ".:53"
              }, {
                "plugins" : {
                  "cache" : {
                    "parameters" : 30
                  },
                  "debug" : false,
                  "errors" : true,
                  "forward" : {
                    "force_tcp" : true,
                    "parameters" : "__PILLAR__CLUSTER__DNS__"
                  },
                  "log" : {
                    "classes" : "all",
                    "format" : "combined"
                  },
                  "prometheus" : true,
                  "reload" : true
                },
                "zone" : "ip6.arpa:53"
              }, {
                "plugins" : {
                  "cache" : {
                    "parameters" : 30
                  },
                  "debug" : false,
                  "errors" : true,
                  "forward" : {
                    "force_tcp" : true,
                    "parameters" : "__PILLAR__CLUSTER__DNS__"
                  },
                  "log" : {
                    "classes" : "all",
                    "format" : "combined"
                  },
                  "prometheus" : true,
                  "reload" : true
                },
                "zone" : "in-addr.arpa:53"
              }, {
                "plugins" : {
                  "cache" : {
                    "denial" : {
                      "size" : 9984,
                      "ttl" : 5
                    },
                    "parameters" : 30,
                    "prefetch" : { },
                    "success" : {
                      "size" : 9984,
                      "ttl" : 30
                    }
                  },
                  "debug" : false,
                  "errors" : true,
                  "forward" : {
                    "force_tcp" : true,
                    "parameters" : "__PILLAR__CLUSTER__DNS__"
                  },
                  "health" : {
                    "port" : 8080
                  },
                  "log" : {
                    "classes" : "all",
                    "format" : "combined"
                  },
                  "prometheus" : true,
                  "reload" : true
                },
                "zone" : "cluster.local:53"
              } ]
            },
            "flavor1" : {
              "description" : "High available",
              "is_default" : true,
              "name" : "HA",
              "replicas" : 2,
              "resources" : [ {
                "limitsCpu" : "250m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-admission-controller",
                "replicas" : 2,
                "requestsCpu" : "250m",
                "requestsMem" : "512Mi"
              }, {
                "limitsCpu" : "500m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-cache",
                "requestsCpu" : "25m",
                "requestsMem" : "5Mi"
              } ],
              "size" : "large"
            },
            "flavor2" : {
              "description" : "Has only one instance",
              "name" : "Single",
              "replicas" : 1,
              "resources" : [ {
                "limitsCpu" : "250m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-admission-controller",
                "replicas" : 1,
                "requestsCpu" : "250m",
                "requestsMem" : "512Mi"
              }, {
                "limitsCpu" : "500m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-cache",
                "requestsCpu" : "25m",
                "requestsMem" : "5Mi"
              } ],
              "size" : "small"
            },
            "flavor3" : {
              "description" : "custom resources",
              "name" : "custom-resources",
              "replicas" : 2,
              "resources" : [ {
                "limitsCpu" : "250m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-admission-controller",
                "replicas" : 2,
                "requestsCpu" : "250m",
                "requestsMem" : "512Mi"
              }, {
                "limitsCpu" : "500m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-cache",
                "requestsCpu" : "25m",
                "requestsMem" : "5Mi"
              } ],
              "size" : "custom"
            }
          }
        },
        "translate" : {
          "zh_CN" : {
            "description" : {
              "Parameters" : {
                "flavor1" : {
                  "description" : "负责DNSConfig自动注入的控制器双副本部署,提升插件可靠性",
                  "name" : "高可用"
                },
                "flavor2" : {
                  "description" : "负责DNSConfig自动注入的控制器单副本部署,资源消耗低",
                  "name" : "单实例"
                },
                "flavor3" : {
                  "description" : "自定义规格",
                  "name" : "自定义规格"
                }
              },
              "Parameters.flavor1.description" : "双实例部署,具有高可用能力,需占用更多的计算资源。",
              "Parameters.flavor1.name" : "高可用",
              "Parameters.flavor2.description" : "单实例部署.",
              "Parameters.flavor2.name" : "单实例",
              "Parameters.flavor3.description" : "自定义资源规格部署",
              "Parameters.flavor3.name" : "自定义"
            },
            "key" : null,
            "plugintemplate" : {
              "changeLog" : "支持Kubernetes v1.31; 更新admission-controller组件日志输出为容器标准输出; node-local-dns支持自定义健康检查端口",
              "components" : {
                "node-local-dns-admission-controller" : {
                  "description" : "为Pod提供自动注入DNSConfig功能,会将node-local-dns-cache的地址注入到容器的/etc/resolv.conf中,容器业务解析DNS域名会优先使用本地域名解析的缓存服务",
                  "kind" : "Deployment"
                },
                "node-local-dns-cache" : {
                  "description" : "为集群中每个节点上部署DNS缓存代理提高集群DNS性能",
                  "kind" : "DaemonSet"
                }
              },
              "description" : "NodeLocal DNSCache是运行在集群节点上的守护程序集,通过DNS缓存代理,提高集群DNS性能。"
            }
          }
        }
      } ],
      "logoURL" : "https://obs.com/plugintemplates/node-local-dnslogo.svg"
    }
  } ]
}

响应示例

状态码:200

OK。

{
  "kind" : "PluginTemplateList",
  "apiVersion" : "v2",
  "items" : [ {
    "kind" : "PluginTemplate",
    "apiVersion" : "v2",
    "metadata" : {
      "name" : "node-local-dns",
      "annotations" : {
        "os.modelarts.plugin/release.name" : "NodeLocal DNSCache"
      }
    },
    "spec" : {
      "optional" : true,
      "versions" : [ {
        "version" : "1.6.63",
        "description" : "NodeLocal DNSCache improves Cluster DNS performance by running a dns caching agent on cluster nodes as a DaemonSet.",
        "creationtimestamp" : "2023-05-20T08:50:31Z",
        "inputs" : {
          "parameters" : {
            "custom" : {
              "annotations" : { },
              "enable_dnsconfig_admission" : true,
              "enable_namespace_admission" : true,
              "image" : {
                "args" : {
                  "healthPort" : 8080,
                  "interfaceName" : "nodelocaldns",
                  "setupIptables" : false,
                  "skipTeardown" : true,
                  "skipteardown" : true,
                  "syncInterval" : "1ns",
                  "upstreamSvc" : "coredns"
                },
                "name" : "node-cache",
                "pullPolicy" : "Always"
              },
              "multiAZBalance" : false,
              "multiAZEnabled" : false,
              "nameserver" : "",
              "ndots" : "5",
              "node_match_expressions" : [ ],
              "search" : "",
              "tolerations" : [ {
                "effect" : "NoExecute",
                "key" : "node.kubernetes.io/not-ready",
                "operator" : "Exists",
                "tolerationSeconds" : 60
              }, {
                "effect" : "NoExecute",
                "key" : "node.kubernetes.io/unreachable",
                "operator" : "Exists",
                "tolerationSeconds" : 60
              } ],
              "zones" : [ {
                "plugins" : {
                  "cache" : {
                    "denial" : { },
                    "parameters" : 30,
                    "prefetch" : { },
                    "server_stale" : false,
                    "success" : { }
                  },
                  "debug" : false,
                  "errors" : true,
                  "forward" : {
                    "expire" : "",
                    "force_tcp" : false,
                    "health_check" : "",
                    "max_fails" : "",
                    "parameters" : "__PILLAR__UPSTREAM__SERVERS__",
                    "policy" : "",
                    "prefer_udp" : false
                  },
                  "log" : {
                    "classes" : "all",
                    "format" : "combined"
                  },
                  "prometheus" : true,
                  "reload" : true
                },
                "zone" : ".:53"
              }, {
                "plugins" : {
                  "cache" : {
                    "parameters" : 30
                  },
                  "debug" : false,
                  "errors" : true,
                  "forward" : {
                    "force_tcp" : true,
                    "parameters" : "__PILLAR__CLUSTER__DNS__"
                  },
                  "log" : {
                    "classes" : "all",
                    "format" : "combined"
                  },
                  "prometheus" : true,
                  "reload" : true
                },
                "zone" : "ip6.arpa:53"
              }, {
                "plugins" : {
                  "cache" : {
                    "parameters" : 30
                  },
                  "debug" : false,
                  "errors" : true,
                  "forward" : {
                    "force_tcp" : true,
                    "parameters" : "__PILLAR__CLUSTER__DNS__"
                  },
                  "log" : {
                    "classes" : "all",
                    "format" : "combined"
                  },
                  "prometheus" : true,
                  "reload" : true
                },
                "zone" : "in-addr.arpa:53"
              }, {
                "plugins" : {
                  "cache" : {
                    "denial" : {
                      "size" : 9984,
                      "ttl" : 5
                    },
                    "parameters" : 30,
                    "prefetch" : { },
                    "success" : {
                      "size" : 9984,
                      "ttl" : 30
                    }
                  },
                  "debug" : false,
                  "errors" : true,
                  "forward" : {
                    "force_tcp" : true,
                    "parameters" : "__PILLAR__CLUSTER__DNS__"
                  },
                  "health" : {
                    "port" : 8080
                  },
                  "log" : {
                    "classes" : "all",
                    "format" : "combined"
                  },
                  "prometheus" : true,
                  "reload" : true
                },
                "zone" : "cluster.local:53"
              } ]
            },
            "flavor1" : {
              "description" : "High available",
              "is_default" : true,
              "name" : "HA",
              "replicas" : 2,
              "resources" : [ {
                "limitsCpu" : "250m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-admission-controller",
                "replicas" : 2,
                "requestsCpu" : "250m",
                "requestsMem" : "512Mi"
              }, {
                "limitsCpu" : "500m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-cache",
                "requestsCpu" : "25m",
                "requestsMem" : "5Mi"
              } ],
              "size" : "large"
            },
            "flavor2" : {
              "description" : "Has only one instance",
              "name" : "Single",
              "replicas" : 1,
              "resources" : [ {
                "limitsCpu" : "250m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-admission-controller",
                "replicas" : 1,
                "requestsCpu" : "250m",
                "requestsMem" : "512Mi"
              }, {
                "limitsCpu" : "500m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-cache",
                "requestsCpu" : "25m",
                "requestsMem" : "5Mi"
              } ],
              "size" : "small"
            },
            "flavor3" : {
              "description" : "custom resources",
              "name" : "custom-resources",
              "replicas" : 2,
              "resources" : [ {
                "limitsCpu" : "250m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-admission-controller",
                "replicas" : 2,
                "requestsCpu" : "250m",
                "requestsMem" : "512Mi"
              }, {
                "limitsCpu" : "500m",
                "limitsMem" : "512Mi",
                "name" : "node-local-dns-cache",
                "requestsCpu" : "25m",
                "requestsMem" : "5Mi"
              } ],
              "size" : "custom"
            }
          }
        },
        "translate" : {
          "zh_CN" : {
            "description" : {
              "Parameters" : {
                "flavor1" : {
                  "description" : "负责DNSConfig自动注入的控制器双副本部署,提升插件可靠性",
                  "name" : "高可用"
                },
                "flavor2" : {
                  "description" : "负责DNSConfig自动注入的控制器单副本部署,资源消耗低",
                  "name" : "单实例"
                },
                "flavor3" : {
                  "description" : "自定义规格",
                  "name" : "自定义规格"
                }
              },
              "Parameters.flavor1.description" : "双实例部署,具有高可用能力,需占用更多的计算资源。",
              "Parameters.flavor1.name" : "高可用",
              "Parameters.flavor2.description" : "单实例部署.",
              "Parameters.flavor2.name" : "单实例",
              "Parameters.flavor3.description" : "自定义资源规格部署",
              "Parameters.flavor3.name" : "自定义"
            },
            "key" : null,
            "plugintemplate" : {
              "changeLog" : "支持Kubernetes v1.31; 更新admission-controller组件日志输出为容器标准输出; node-local-dns支持自定义健康检查端口",
              "components" : {
                "node-local-dns-admission-controller" : {
                  "description" : "为Pod提供自动注入DNSConfig功能,会将node-local-dns-cache的地址注入到容器的/etc/resolv.conf中,容器业务解析DNS域名会优先使用本地域名解析的缓存服务",
                  "kind" : "Deployment"
                },
                "node-local-dns-cache" : {
                  "description" : "为集群中每个节点上部署DNS缓存代理提高集群DNS性能",
                  "kind" : "DaemonSet"
                }
              },
              "description" : "NodeLocal DNSCache是运行在集群节点上的守护程序集,通过DNS缓存代理,提高集群DNS性能。"
            }
          }
        }
      } ],
      "logoURL" : "https://obs.com/plugintemplates/node-local-dnslogo.svg"
    }
  } ]
}

状态码:404

Not Found。

{
  "error_code" : "ModelArts.50005101",
  "error_msg" : "Plugintemplate {name} not found."
}

状态码

状态码

描述

200

OK。

404

Not Found。

错误码

请参见错误码

相关文档