更新时间:2022-12-05 GMT+08:00

查询产品模板

功能介绍

查询产品模板

URI

GET /v2/{project_id}/link/instances/{instance_id}/product-templates

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,获取方式请参见API参考的“附录 > 获取项目ID”章节。

最小长度:0

最大长度:32

instance_id

String

实例ID

最小长度:0

最大长度:36

表2 Query参数

参数

是否必选

参数类型

描述

limit

Integer

每页显示条目数量,最大数量999,超过999后只返回999

最小值:0

最大值:999999

缺省值:10

id

Integer

产品模板ID

最小值:1

最大值:99999999999999999

name

String

产品模板名称

最小长度:0

最大长度:10

status

Integer

产品模板状态 0-启用 1-停用

最小值:0

最大值:10

created_user_name

String

创建用户名

最小长度:0

最大长度:64

created_date_start

Long

创建时间起始,格式timestamp(ms),使用UTC时区

最小值:1

最大值:99999999999999999

created_date_end

Long

创建时间截止,格式timestamp(ms),使用UTC时区

最小值:1

最大值:99999999999999999

offset

Integer

偏移量,表示从此偏移量开始查询, offset大于等于0

最小值:0

最大值:999999

缺省值:0

请求参数

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

total

Integer

总数

最小值:1

最大值:99999999

size

Integer

本次返回数量

最小值:1

最大值:9999

items

Array of ProductTemplate objects

产品模板信息

表4 ProductTemplate

参数

参数类型

描述

id

Integer

产品模板ID

最小值:1

最大值:99999999999999999

name

String

产品模板名称

最小长度:0

最大长度:64

description

String

产品模板描述

最小长度:0

最大长度:200

status

Integer

产品模板状态 0-启用 1-停用

最小值:0

最大值:10

created_user

CreatedUser object

创建时的用户

last_updated_user

LastUpdatedUser object

最后更新时的用户

created_datetime

Long

创建时间,timestamp(ms),使用UTC时区

最小值:1

最大值:99999999999999999

last_updated_datetime

Long

最后修改时间,timestamp(ms),使用UTC时区

最小值:1

最大值:99999999999999999

表5 CreatedUser

参数

参数类型

描述

user_id

String

用户ID(保留字段,未使用)

最小长度:0

最大长度:64

user_name

String

用户名

最小长度:0

最大长度:64

表6 LastUpdatedUser

参数

参数类型

描述

user_id

String

用户ID(保留字段,未使用)

最小长度:0

最大长度:64

user_name

String

用户名

最小长度:0

最大长度:64

状态码: 400

表7 响应Body参数

参数

参数类型

描述

error_code

String

系统错误码,针对4xx和5xx类HTTP错误码的详细错误码

最小长度:0

最大长度:64

error_msg

String

错误描述

最小长度:0

最大长度:200

request_id

String

消息ID

最小长度:0

最大长度:64

状态码: 404

表8 响应Body参数

参数

参数类型

描述

error_code

String

系统错误码,针对4xx和5xx类HTTP错误码的详细错误码

最小长度:0

最大长度:64

error_msg

String

错误描述

最小长度:0

最大长度:200

request_id

String

消息ID

最小长度:0

最大长度:64

状态码: 500

表9 响应Body参数

参数

参数类型

描述

error_code

String

系统错误码,针对4xx和5xx类HTTP错误码的详细错误码

最小长度:0

最大长度:64

error_msg

String

错误描述

最小长度:0

最大长度:200

request_id

String

消息ID

最小长度:0

最大长度:64

请求示例

GET /{project_id}/link/instances/{instance_id}/product-templates

响应示例

状态码: 200

OK

{
  "total" : 1,
  "size" : 1,
  "items" : [ {
    "id" : 2235,
    "name" : "template",
    "description" : "description",
    "status" : 0,
    "createdUser" : {
      "user_id" : null,
      "user_name" : "user"
    },
    "lastUpdatedUser" : {
      "user_id" : null,
      "user_name" : "user"
    },
    "created_datetime" : 1607303564596,
    "last_updated_datetime" : 1607571061057
  } ]
}

状态码: 400

Bad Request

{
  "error_code" : "SCB.00000000",
  "error_msg" : "Parameter is not valid for operation [romalink.link-producttemplate.pageQuery]. Parameter is [status]. Processor is [query].",
  "requestId" : "cb39e78a-afd3-4e04-901d-70468b1c23dc-1619602712496-cnnorth7a-P-romalink-service01"
}

状态码: 404

Not Found

{
  "error_code" : "SCB.00000000",
  "error_msg" : "Not Found"
}

状态码: 500

Internal Server Error

{
  "error_code" : "ROMA.00110002",
  "error_msg" : "The instance does not exist. project_id: 397cd10b30544c588b2f4a56d83856c4, instance_id: f3bb386a-23ec-47aa-9943-4c60ac658611",
  "request_id" : "c8c06d0a-be92-4fdf-9d10-bc20131ab158-1619593104919-cnnorth7a-P-romalink-service01"
}

状态码

状态码

描述

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

错误码

请参见错误码