文档

DescribeDeployedApi - 查询API在指定环境中的定义

更新时间:

查询指定API在指定环境中正在运行的定义,是真正在指定环境中生效的定义,可能跟正在编辑中的定义不同。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
apigateway:DescribeDeployedApiRead
  • 全部资源
    *

请求参数

名称类型必填描述示例值
GroupIdstring

API 分组 ID,系统生成,全局唯一

81750604ccff48c48f34d6c0165e09db
ApiIdstring

指定 API 编号

ab7c95a01a7e42f28718f34497bbf47c
StageNamestring

指定要操作 API 的环境。

  • RELEASE: 线上
  • PRE: 预发
  • TEST: 测试
RELEASE

返回参数

名称类型描述示例值
object
ApiIdstring

API 编号

4eed13a57d4e42fbb51316be8a5329ff
ResultTypestring

后端服务返回应答的格式,目前可以设置为:JSON、TEXT、BINARY、XML、HTML。默认为 JSON。

HTML
DisableInternetboolean
  • 设置 DisableInternet 为 true, 仅支持内网调用 API。
  • 设置 DisableInternet 为 false, 则不限制调用。
说明 修改 API 时,不设置则不修改原来的取值。
true
ResultBodyModelstring

api 的返回结果

ResultSamplestring

后端服务返回应答的示例

{code: 200, message:'success', data: ''}
AllowSignatureMethodstring

API 的客户端请求签名方法,可选值:

  • HmacSHA256
  • HmacSHA1,HmacSHA256
HmacSHA256
RegionIdstring

分组所在区域

cn-beijing
ForceNonceCheckboolean
  • 设置 ForceNonceChecktrue, 请求时强制检查 X-Ca-Nonce,这个是请求的唯一标识,一般使用 UUID 来标识。API 网关收到这个参数后会校验这个参数的有效性,同样的值,15 分内只能被使用一次。可以有效防止 API 的重放攻击。

  • 设置 ForceNonceCheckfalse,则不检查。创建 API 时默认为 false。

true
Visibilitystring

API 是否公开,可以取值:

  • PUBLIC:公开,如选择此类型,该 API 的线上环境定义,会在所有用户的控制台“发现 API”页面可见。
  • PRIVATE:不公开,如选择此类型,当该组 API 在云市场上架时,私有类型的 API 不会上架。
PUBLIC
FailResultSamplestring

后端服务失败返回应答的示例

{"errorCode":"fail","errorMessage":"param invalid"}
AuthTypestring

API 安全认证类型,目前可以取值:

  • APP:只允许已授权的 APP 调用
  • ANONYMOUS:允许匿名调用,设置为允许匿名调用需要注意:
    • 任何能够获取该 API 服务信息的人,都将能够调用该 API。网关不会对调用者做身份认证,也无法设置按用户的流量控制,若开放该 API 请设置好按 API 的流量控制。
APP
RequestIdstring

本次请求的 ID。

EF924FE4-2EDD-4CD3-89EC-34E4708574E7
Descriptionstring

描述信息

Api description
GroupNamestring

API 分组名称

Weather
GroupIdstring

分组编号

bc77f5b49c974437a9912ea3755cd834
DeployedTimestring

部署时间,格式为 yyyy-mm-ddhh:mm:ss

2022-07-25T17:47:51Z
StageNamestring

指定要操作 API 的环境。

  • RELEASE: 线上
  • PRE: 预发
  • TEST: 测试
RELEASE
ApiNamestring

API 名称

weather
RequestConfigobject

Consumer 向网关发送 API 请求的相关配置项。

更多信息,请参见 RequestConfig

BodyModelstring

body 模型

RequestPathstring

API path,比如 API 的完全地址为http://api.a.com:8080/object/add?key1=value1&key2=value2,path 是指/object/add这一部分。

/api/billing/test/[type]
RequestHttpMethodstring

HTTP Method,取值为:GET、POST、DELETE、PUT、HEADER、TRACE、PATCH、CONNECT、OPTIONS。

POST
BodyFormatstring

RequestMode 值为 MAPPING 时有效。

POST/PUT 请求时,表示数据以何种方式传递给服务器,取值为:FORMSTREAM,分别表示表单形式(k-v 对应)、字节流形式。

STREAM
RequestModestring

入参请求的模式,取值为:

  • MAPPING:入参映射(过滤未知参数)

  • PASSTHROUGH:入参透传

  • MAPPING_PASSTHROUGH:入参映射(透传未知参数)

MAPPING
PostBodyDescriptionstring

请求 body 描述

fwefwef
RequestProtocolstring

API 支持的协议类型,可以多选,多选情况下以英文逗号隔开,如:"HTTP,HTTPS",取值为:HTTP、HTTPS、WebSocket

HTTP
ServiceConfigobject

网关向后端服务发送 API 请求的相关配置项。

更多信息,请参见 ServiceConfig

VpcIdstring

专有网络 ID。

vpc-uf6kg9x8sx2tbxxxx
MockStatusCodeinteger

Mock 返回状态码

200
ServicePathstring

调用后端服务 path,比如后端服务完全地址为http://api.a.com:8080/object/add?key1=value1&key2=value2ServicePath 是指/object/add这一部分。

/object/add
Mockstring

是否采取 Mock 模式,目前可以取值:

  • TRUE:启用 Mock 模式
  • FALSE:不启用 Mock 模式
TRUE
ServiceAddressstring

调用后端服务地址,比如后端服务完全地址为http://api.a.com:8080/object/add?key1=value1&key2=value2ServiceAddress 是指http://api.a.com:8080这一部分。

http://api.a.com:8080
ServiceVpcEnablestring

是否启用 VPC 通道,目前可以取值:

  • TRUE:启用 VPC 通道,必须先添加 VPC 授权成功后才能启用
  • FALSE:不启用 VPC 通
TRUE
MockResultstring

如果启用 Mock 模式,返回的结果

test result
ServiceHttpMethodstring

调用后端服务 HTTP 协议时的 Method,取值为:GET、POST、DELETE、PUT、HEADER、TRACE、PATCH、CONNECT、OPTIONS。

POST
ServiceProtocolstring

后端服务协议类型,目前只支持 HTTP/HTTPS/FunctionCompute

HTTP
ServiceTimeoutinteger

后端服务超时时间,单位:毫秒

1000
MockHeadersobject []

模拟 Headers

HeaderValuestring

HTTP 头参数值

86400
HeaderNamestring

HTTP 头参数名

Content-Type
VpcConfigobject

VPC 通道相关配置项

VpcIdstring

专用网络 ID

vpc-2zeafsc3fygk1***
InstanceIdstring

专用网络中的实例 ID(Ecs/负载均衡)

i-bp1h497hkijewv2***
Portinteger

实例对应的端口号

8080
Namestring

VPC 授权名称

glmall-app-test
FunctionComputeConfigobject

后端为函数计算时的后端配置项

FcTypestring

函数计算服务类型

HttpTrigger
RoleArnstring

Ram 授权给 API 网关访问函数计算的 arn

acs:ram::111***:role/aliyunserviceroleforsas
Methodstring

请求方法

GET
FcBaseUrlstring

函数计算服务根路径

https://122xxxxxxx.fc.aliyun.com/2016xxxx/proxy/testSxxx.xxx/testHttp/
ContentTypeValuestring

调用后端服务 HTTP 服务,ContentTypeCatagory 的值为 DEFAULT 或者 CUSTOM 时,ContentType 头的取值。

application/x-www-form-urlencoded; charset=UTF-8
RegionIdstring

所在的 region

cn-beijing
OnlyBusinessPathboolean

后端只接收业务 path

false
FunctionNamestring

函数计算定义的 FunctionName

domain_business_control
ContentTypeCatagorystring

调用后端服务 HTTP 服务时,ContentType 头的取值策略:

  • DEFAULT:使用 API 网关默认的值
  • CUSTOM:自定义
  • CLIENT:使用客户端上行的 ContentType 的头
DEFAULT
Pathstring

API 请求路径

/api/offline/cacheData
ServiceNamestring

函数计算定义的 ServiceName

fcservicename
Qualifierstring

函数别名

2
OpenIdConnectConfigobject

第三方账号认证 OpenID Connect 相关配置项

OpenIdApiTypestring

OpenID Connect 模式,目前可以取值:

  • IDTOKEN:获取授权 API,颁发 Token,当设置此项时,参数 PublicKeyId 和 PublicKey 为必传。
  • BUSINESS:业务 API,Token 验证,当设置此项时,参数 IdTokenParamName 为必传。
IDTOKEN
IdTokenParamNamestring

Token 对应的参数名称

xxx
PublicKeyIdstring

公钥 ID

88483727556929326703309904351185815489
PublicKeystring

api 公钥

EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92
ErrorCodeSamplesobject []

后端服务返回的错误码示例。

更多信息,请参见 ErrorCodeSample

Codestring

错误码

Error
Messagestring

错误信息。

error message
Descriptionstring

描述信息

错误描述
ResultDescriptionsobject []

api 的返回说明

Descriptionstring

描述信息

result description
Mandatoryboolean

是否必填。

true
SystemParametersobject []

系统参数列表。

DemoValuestring

示例

192.168.1.1
Descriptionstring

描述信息

QueryParamDTO
ParameterNamestring

系统参数名,取值为:CaClientIp、CaDomain、CaRequestHandleTime、CaAppId、CaRequestId、CaHttpSchema、CaProxy。

CaClientIp
Locationstring

参数位置,取值为:BODY、HEAD、QUERY、PATH

HEAD
ServiceParameterNamestring

对应后端参数名称

clientIp
CustomSystemParametersobject []

自定义系统参数列表

DemoValuestring

示例值

192.168.1.1
Descriptionstring

描述信息

123
ParameterNamestring

自定义系统参数名

appid
Locationstring

参数位置,取值为:BODY、HEAD、QUERY、PATH

HEAD
ServiceParameterNamestring

对应后端参数名称

clientIp
ConstantParametersobject []

常量参数列表

Descriptionstring

描述信息

123
Locationstring

参数位置,取值为:BODY、HEAD、QUERY、PATH

HEAD
ServiceParameterNamestring

后端参数名称

constance
ConstantValuestring

常量值

constance
RequestParametersobject []

Consumer 向网关发送 API 请求的参数描述。

更多信息,请参见 RequestParameter

JsonSchemestring

JSON scheme

{}
MaxValuelong

ParameterType=Int、Long、Float、Double,参数的最大值限定

123456
ArrayItemsTypestring

数组元素的类型

String
MinValuelong

ParameterType=Int、Long、Float、Double,参数的最小值限定

123456
DocShowstring

文档可见,取值为:PUBLICPRIVATE

PUBLIC
MaxLengthlong

ParameterType=String,参数的最大长度限定

123456
DefaultValuestring

默认值

20
ApiParameterNamestring

API 参数名称

age
EnumValuestring

ParameterType=Int、Long、Float、Double 或 String,允许输入的散列值,不同的值用英文的逗号分隔,形如:1,2,3,4,9 或 A,B,C,E,F。

boy,girl
DemoValuestring

示例值

20
Requiredstring

是否必填,取值为:REQUIREDOPTIONAL,分别表示必填、不必填

OPTIONAL
Descriptionstring

参数描述

parameter description
ParameterTypestring

参数类型,取值为:String、Int、Long、Float、Double、Boolean,分别表示字符、整型、长整型、单精度浮点型、双精度浮点型、布尔。

String
RegularExpressionstring

ParameterType=String,参数验证(正则表达式)

xxx
MinLengthlong

ParameterType=String,参数的最小长度限定

123456
DocOrderinteger

文档中顺序

0
Locationstring

参数位置,取值为:BODY、HEAD、QUERY、PATH

HEAD
ServiceParametersobject []

网关向后端服务发送 API 请求的参数描述。

更多信息,请参见 ServiceParameter

Locationstring

参数位置,取值为:BODY、HEAD、QUERY、PATH

HEAD
ParameterTypestring

后端参数数据类型,取值为:STRING、NUMBER、BOOLEAN,分别表示字符、数值、布尔。

String
ServiceParameterNamestring

后端参数名称

clientIp
ServiceParametersMapobject []

Consumer 向网关发送请求的参数和网关向后端服务发送的请求的参数的映射关系。

更多信息,请参见 ServiceParameterMap

RequestParameterNamestring

前端入参名称

sex
ServiceParameterNamestring

后端参数名称

sex

示例

正常返回示例

JSON格式

{
  "ApiId": "4eed13a57d4e42fbb51316be8a5329ff",
  "ResultType": "HTML",
  "DisableInternet": true,
  "ResultBodyModel": "",
  "ResultSample": "{code: 200, message:'success', data: ''}",
  "AllowSignatureMethod": "HmacSHA256",
  "RegionId": "cn-beijing",
  "ForceNonceCheck": true,
  "Visibility": "PUBLIC",
  "FailResultSample": "{\"errorCode\":\"fail\",\"errorMessage\":\"param invalid\"}",
  "AuthType": "APP",
  "RequestId": "EF924FE4-2EDD-4CD3-89EC-34E4708574E7",
  "Description": "Api description",
  "GroupName": "Weather",
  "GroupId": "bc77f5b49c974437a9912ea3755cd834",
  "DeployedTime": "2022-07-25T17:47:51Z",
  "StageName": "RELEASE",
  "ApiName": "weather",
  "RequestConfig": {
    "BodyModel": "",
    "RequestPath": "/api/billing/test/[type]",
    "RequestHttpMethod": "POST",
    "BodyFormat": "STREAM",
    "RequestMode": "MAPPING",
    "PostBodyDescription": "fwefwef",
    "RequestProtocol": "HTTP"
  },
  "ServiceConfig": {
    "VpcId": "vpc-uf6kg9x8sx2tbxxxx",
    "MockStatusCode": 200,
    "ServicePath": "/object/add",
    "Mock": "TRUE",
    "ServiceAddress": "http://api.a.com:8080",
    "ServiceVpcEnable": "TRUE",
    "MockResult": "test result",
    "ServiceHttpMethod": "POST",
    "ServiceProtocol": "HTTP",
    "ServiceTimeout": 1000,
    "MockHeaders": {
      "MockHeader": [
        {
          "HeaderValue": "86400",
          "HeaderName": "Content-Type"
        }
      ]
    },
    "VpcConfig": {
      "VpcId": "vpc-2zeafsc3fygk1***",
      "InstanceId": "i-bp1h497hkijewv2***",
      "Port": 8080,
      "Name": "glmall-app-test"
    },
    "FunctionComputeConfig": {
      "FcType": "HttpTrigger",
      "RoleArn": "acs:ram::111***:role/aliyunserviceroleforsas",
      "Method": "GET",
      "FcBaseUrl": "https://122xxxxxxx.fc.aliyun.com/2016xxxx/proxy/testSxxx.xxx/testHttp/",
      "ContentTypeValue": "application/x-www-form-urlencoded; charset=UTF-8\n",
      "RegionId": "cn-beijing",
      "OnlyBusinessPath": false,
      "FunctionName": "domain_business_control",
      "ContentTypeCatagory": "DEFAULT",
      "Path": "/api/offline/cacheData",
      "ServiceName": "fcservicename",
      "Qualifier": "2"
    }
  },
  "OpenIdConnectConfig": {
    "OpenIdApiType": "IDTOKEN",
    "IdTokenParamName": "xxx",
    "PublicKeyId": "88483727556929326703309904351185815489",
    "PublicKey": "EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92"
  },
  "ErrorCodeSamples": {
    "ErrorCodeSample": [
      {
        "Code": "Error",
        "Message": "error message",
        "Description": "错误描述"
      }
    ]
  },
  "ResultDescriptions": {
    "ResultDescription": [
      {
        "Type": "",
        "Key": "",
        "HasChild": false,
        "Description": "result description",
        "Pid": "",
        "Mandatory": true,
        "Name": "",
        "Id": ""
      }
    ]
  },
  "SystemParameters": {
    "SystemParameter": [
      {
        "DemoValue": "192.168.1.1",
        "Description": "QueryParamDTO",
        "ParameterName": "CaClientIp",
        "Location": "HEAD",
        "ServiceParameterName": "clientIp"
      }
    ]
  },
  "CustomSystemParameters": {
    "CustomSystemParameter": [
      {
        "DemoValue": "192.168.1.1",
        "Description": "123",
        "ParameterName": "appid",
        "Location": "HEAD",
        "ServiceParameterName": "clientIp"
      }
    ]
  },
  "ConstantParameters": {
    "ConstantParameter": [
      {
        "Description": "123",
        "Location": "HEAD",
        "ServiceParameterName": "constance",
        "ConstantValue": "constance"
      }
    ]
  },
  "RequestParameters": {
    "RequestParameter": [
      {
        "JsonScheme": "{}",
        "MaxValue": 123456,
        "ArrayItemsType": "String",
        "MinValue": 123456,
        "DocShow": "PUBLIC",
        "MaxLength": 123456,
        "DefaultValue": "20",
        "ApiParameterName": "age",
        "EnumValue": "boy,girl",
        "DemoValue": "20",
        "Required": "OPTIONAL",
        "Description": "parameter description",
        "ParameterType": "String",
        "RegularExpression": "xxx",
        "MinLength": 123456,
        "DocOrder": 0,
        "Location": "HEAD"
      }
    ]
  },
  "ServiceParameters": {
    "ServiceParameter": [
      {
        "Location": "HEAD",
        "ParameterType": "String",
        "ServiceParameterName": "clientIp"
      }
    ]
  },
  "ServiceParametersMap": {
    "ServiceParameterMap": [
      {
        "RequestParameterName": "sex",
        "ServiceParameterName": "sex"
      }
    ]
  }
}

错误码

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
暂无变更历史
  • 本页导读 (0)
文档反馈