更新时间:2024-02-28 GMT+08:00
分享

修改http转rpc方法

功能介绍

修改http转rpc方法。

调试

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

URI

PUT /v2/{project_id}/enginemgr/gateways/{gateway_id}/http2Rpcs/{http2Rpc_id}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目id

gateway_id

String

网关实例id

http2Rpc_id

String

http2Rpc id

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

IAM-Token

Accept

String

该字段内容填为 "application/json"

表3 请求Body参数

参数

是否必选

参数类型

描述

gatewayId

String

网关的ID。

pluginConfig

Object

传递给插件的配置。

name

String

routeName

String

路由的名称。

routeDestinationName

String

目标路由的名称。

dubbo

Dubbo object

dubbo 服务的信息。

表4 Dubbo

参数

是否必选

参数类型

描述

service

String

服务名。

version

String

版本号。

group

String

分组。

methods

Array of DubboMethod objects

dubbo方法列表。

表5 DubboMethod

参数

是否必选

参数类型

描述

serviceMethod

String

服务方法。

headersAttach

String

附加请求头。

httpMethods

Array of strings

http 方法。

httpPath

String

http 路径。

params

Array of DubboMethodParam objects

dubbo 方法参数。

表6 DubboMethodParam

参数

是否必选

参数类型

描述

paramKey

String

参数键。

paramSource

String

参数来源。

paramType

String

参数类型。

响应参数

状态码: 200

表7 响应Body参数

参数

参数类型

描述

gatewayId

String

网关的ID。

pluginConfig

Object

传递给插件的配置。

name

String

routeName

String

路由的名称。

routeDestinationName

String

目标路由的名称。

dubbo

Dubbo object

dubbo 服务的信息。

表8 Dubbo

参数

参数类型

描述

service

String

服务名。

version

String

版本号。

group

String

分组。

methods

Array of DubboMethod objects

dubbo方法列表。

表9 DubboMethod

参数

参数类型

描述

serviceMethod

String

服务方法。

headersAttach

String

附加请求头。

httpMethods

Array of strings

http 方法。

httpPath

String

http 路径。

params

Array of DubboMethodParam objects

dubbo 方法参数。

表10 DubboMethodParam

参数

参数类型

描述

paramKey

String

参数键。

paramSource

String

参数来源。

paramType

String

参数类型。

状态码: 400

表11 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误信息。

detail

String

详细定位信息。

请求示例

PUT https://{endpoint}/v2/{project_id}/enginemgr/gateways/{gateway_id}/http2Rpcs/{http2Rpc_id}

{
  "pluginConfig" : { },
  "name" : "string",
  "routeName" : "string",
  "routeDestinationName" : "string",
  "dubbo" : {
    "service" : "string",
    "version" : "string",
    "group" : "string",
    "methods" : [ {
      "serviceMethod" : "string",
      "headersAttach" : "string",
      "httpMethods" : [ "string" ],
      "httpPath" : "string",
      "params" : [ {
        "paramKey" : "string",
        "paramSource" : "string",
        "paramType" : "string"
      } ]
    } ]
  }
}

响应示例

状态码: 200

创建成功

{
  "gatewayId" : "string",
  "pluginConfig" : { },
  "name" : "string",
  "routeName" : "string",
  "routeDestinationName" : "string",
  "dubbo" : {
    "service" : "string",
    "version" : "string",
    "group" : "string",
    "methods" : [ {
      "serviceMethod" : "string",
      "headersAttach" : "string",
      "httpMethods" : [ "string" ],
      "httpPath" : "string",
      "params" : [ {
        "paramKey" : "string",
        "paramSource" : "string",
        "paramType" : "string"
      } ]
    } ]
  }
}

状态码

状态码

描述

200

创建成功

400

创建失败

错误码

请参见错误码

分享:

    相关文档

    相关产品