API网关 APIG-查询API运行时定义:响应消息

时间:2025-02-12 15:04:33

响应消息

表4 参数说明

参数

类型

说明

id

String

API编号

name

String

API名称

group_id

String

API所属分组的编号

group_name

String

API所属分组的名称

type

Integer

API类型

version

String

API版本

req_protocol

String

API访问协议

req_method

String

API请求方式

req_uri

String

API访问地址

auth_type

String

API认证方式

auth_opt

字段数据类型

API认证方式参数

authorizer_id

String

前端自定义认证对象的ID

match_mode

String

API匹配方式

remark

String

API描述

bakend_type

String

后端类型

run_env_name

String

发布的环境名

run_env_id

String

发布的环境id

publish_id

String

发布记录的编号

tag

String

服务名称标签,待废弃字段

tags

[]String

标签

cors

Bool

是否支持跨域访问

body_remark

String

API请求体描述,可以是请求体示例、媒体类型、参数等信息

result_normal_sample

String

正常响应示例,描述API的正常返回信息

result_failure_sample

String

失败返回示例,描述API的异常返回信息

sl_domain

String

分组的二级 域名

req_params

字典数据类型

API的请求参数列表

表5 req_params参数说明

参数

类型

说明

id

String

参数编号

name

String

参数名称

type

String

参数类型

location

String

参数位置

default_value

String

参数默认值

sample_value

String

参数示例值

required

Integer

是否必须

valid_enable

Integer

是否开启校验

remark

String

描述

enumerations

String

参数枚举值

min_num

Integer

参数最小值(参数类型为NUMBER时有效)

max_num

Integer

参数最大值(参数类型为NUMBER时有效)

min_size

Integer

参数最小长度

max_size

Integer

参数最大长度

regular

String

正则校验规则

json_schema

String

JSON校验规则

表6 auth_opt参数说明

参数

类型

说明

app_code_auth_type

String

AppCode简易认证类型

响应消息样例:

{  "name": "market_api01",  "type": 1,  "version": "V0.0.1",  "req_protocol": "HTTPS",  "req_method": "GET",  "req_uri": "/test01",  "auth_type": "APP",  "auth_opt": {    "app_code_auth_type": "HEADER"  },  "tags": ["APIG-SN-test", "test"],  "cors": true,  "match_mode": "NORMAL",  "backend_type": "MOCK",  "remark": "market_api01",  "group_id": "7f848adc971749cda9c6aff3877cfc3e",  "body_remark": "market_api01",  "result_normal_sample": "success",  "result_failure_sample": "",  "id": "0e51b689e0784bc884f43756bbf34fa5",  "group_name": "market_group01",  "run_env_id": "DEFAULT_ENVIRONMENT_RELEASE_ID",  "run_env_name": "RELEASE",  "publish_id": "f07eb9f5e5ba4bbfbe89326f5cae99c7",  "sl_domain": "61297835ff1e4905b6f635dbcdf1777e.apigw.example.com",  "req_params": [    {      "name": "project_id",      "type": "STRING",      "location": "PATH",      "default_value": "",      "sample_value": "",      "required": 1,      "valid_enable": 2,      "remark": "",      "enumerations": "",      "min_num": 0,      "max_num": 0,      "min_size": 0,      "max_size": 0,      "regular": "",      "json_schema": "",      "id": "2a61905ea2304186a9422faba2940735"    }  ]}
support.huaweicloud.com/api-apig/apig-phapi-180911219.html