更新时间:2023-11-30 GMT+08:00

查询插件详情

功能介绍

查询插件详情。

调用方法

请参见如何调用API

URI

GET /v2/{project_id}/apigw/instances/{instance_id}/plugins/{plugin_id}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,获取方式请参见获取项目ID

instance_id

String

实例ID,在API网关控制台的“实例信息”中获取。

plugin_id

String

插件编号

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

plugin_id

String

插件编码。

plugin_name

String

插件名称。支持汉字,英文,数字,中划线,下划线,且只能以英文和汉字开头,3-255字符。

说明:

中文字符必须为UTF-8或者unicode编码。

plugin_type

String

插件类型

  • cors:跨域资源共享

  • set_resp_headers:HTTP响应头管理

  • kafka_log:Kafka日志推送

  • breaker:断路器

  • rate_limit: 流量控制

  • third_auth: 第三方认证

枚举值:

  • cors

  • set_resp_headers

  • kafka_log

  • breaker

  • rate_limit

  • third_auth

plugin_scope

String

插件可见范围。global:全局可见;

枚举值:

  • global

plugin_content

String

插件定义内容,支持json。参考提供的具体模型定义

CorsPluginContent:跨域资源共享 定义内容 SetRespHeadersContent:HTTP响应头管理 定义内容 KafkaLogContent:Kafka日志推送 定义内容 BreakerContent:断路器 定义内容 RateLimitContent 流量控制 定义内容 ThirdAuthContent: 第三方认证 定义内容

最大长度:65535

remark

String

插件描述,255字符。

说明:

中文字符必须为UTF-8或者unicode编码。

最大长度:255

create_time

String

创建时间。

update_time

String

更新时间。

状态码: 400

表4 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 401

表5 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 403

表6 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 404

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

状态码: 500

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误描述

请求示例

响应示例

状态码: 200

OK

{
  "plugin_id" : "5b729aa252764739b3s237ef0d66dc63",
  "plugin_name" : "跨域插件",
  "plugin_type" : "cors",
  "plugin_scope" : "global",
  "plugin_content" : "{\"allow_origin\": \"*\",\"allow_methods\": \"GET,POST,PUT\",\"allow_headers\": \"Content-Type,Accept,Accept-Ranges,Cache-Control\",\"expose_headers\": \"X-Request-Id,X-Apig-Latency\",\"max_age\": 172800,\"allow_credentials\": true}",
  "remark" : "CORS跨域资源访问",
  "create_time" : "2022-11-02T12:31:23.353Z",
  "update_time" : "2022-11-02T12:31:23.353Z"
}

状态码: 400

Bad Request

{
  "error_code" : "APIG.2012",
  "error_msg" : "Invalid parameter value,parameterName:instance_id. Please refer to the support documentation"
}

状态码: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

状态码: 403

Forbidden

{
  "error_code" : "APIG.1005",
  "error_msg" : "No permissions to request this method"
}

状态码: 404

Not Found

{
  "error_code" : "APIG.3068",
  "error_msg" : "Plugin b294018ee0554156a875b3513e02e5b9 does not exist"
}

状态码: 500

Internal Server Error

{
  "error_code" : "APIG.9999",
  "error_msg" : "System error"
}

状态码

状态码

描述

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

错误码

请参见错误码