Consulta a definição de uma API especificada.
Descrição da operação
Esta operação é destinada a usuários que publicam APIs.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
apigateway:DescribeApi |
get |
*ApiGroup
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| GroupId |
string |
Não |
O ID do grupo que contém a API. |
123 |
| ApiId |
string |
Sim |
O ID da API. |
8afff6c8c4c6447abb035812e4d66b65 |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
|||
| ApiId |
string |
O ID da API. |
8afff6c8c4c6447abb035812e4d66b65 |
| ResultType |
string |
O formato da resposta retornada pelo serviço de backend. Valores válidos: JSON, TEXT, BINARY, XML e HTML. |
JSON |
| WebSocketApiType |
string |
O tipo de API de comunicação bidirecional:
|
COMMON |
| DisableInternet |
boolean |
Especifica se a API suporta apenas chamadas de rede interna. Valores válidos:
|
false |
| ResultBodyModel |
string |
O corpo da resposta da API. |
{} |
| ResultSample |
string |
O exemplo de resposta retornada pelo serviço de backend. |
200 |
| AppCodeAuthType |
string |
Válido apenas quando AuthType está definido como APP. Valores válidos:
|
HEADER |
| AllowSignatureMethod |
string |
Obrigatório quando AuthType está definido como APP. Especifica o algoritmo de assinatura. Valores válidos: HmacSHA256 e HmacSHA1,HmacSHA256. Padrão: HmacSHA256.
|
HmacSHA256 |
| RegionId |
string |
O ID da região onde a API reside. |
cn-qingdao |
| ForceNonceCheck |
boolean |
Especifica se o cabeçalho de solicitação X-Ca-Nonce é obrigatório. Este cabeçalho é o ID exclusivo da solicitação, normalmente um UUID. O API Gateway valida este cabeçalho para evitar ataques de repetição. Cada valor pode ser usado apenas uma vez dentro de 15 minutos. Valores válidos:
|
true |
| Visibility |
string |
Especifica se a API é pública. Valores válidos:
|
PUBLIC |
| FailResultSample |
string |
O exemplo de resposta de erro retornada pelo serviço de backend. |
400 |
| AuthType |
string |
O tipo de autenticação de segurança para a API. Valores válidos:
|
APP |
| ModifiedTime |
string |
A hora em que a API foi modificada pela última vez. |
2016-07-28T13:13:12Z |
| RequestId |
string |
O ID da solicitação. |
D0FF585F-7966-40CF-BC60-75DB070B23D5< |
| Description |
string |
A descrição da API. |
Api description |
| GroupName |
string |
O nome do grupo que contém a API. |
ApiTest |
| GroupId |
string |
O ID do grupo que contém a API. |
08ae4aa0f95e4321849ee57f4e0b3077 |
| Mock |
string |
Especifica se o modo mock está ativado. Valores válidos:
|
CLOSED |
| MockResult |
string |
A resposta mock. |
test result |
| CreatedTime |
string |
A hora em que a API foi criada. |
2016-07-28T09:50:43Z |
| ApiName |
string |
O nome da API. Deve ser exclusivo dentro do grupo. |
ApiName |
| BackendEnable |
boolean |
Especifica se o serviço de backend está ativado. |
true |
| BackendConfig |
object |
A configuração do backend. |
|
| BackendId |
string |
O ID do serviço de backend. |
0038e00c3dca44fcba3a94015d8f5bbf |
| BackendType |
string |
O tipo do serviço de backend. |
HTTP |
| BackendName |
string |
O nome do serviço de backend. |
testoss |
| RequestConfig |
object |
A configuração para solicitações enviadas dos consumidores para o API Gateway. |
|
| BodyModel |
string |
O modelo do corpo. |
https://apigateway.aliyun.com/models/3a240a127dcc4afd9ab1bf7e947b4095/9e2df550e85b4121a79ec33e2619eaab |
| RequestPath |
string |
O caminho da API. Por exemplo, se a URL completa for |
/api/billing/test/[type] |
| RequestHttpMethod |
string |
O método HTTP. Valores válidos: GET, POST, DELETE, PUT, HEAD, TRACE, PATCH, CONNECT e OPTIONS. |
POST |
| BodyFormat |
string |
Válido apenas quando RequestMode é MAPPING. Especifica como os dados são enviados para o servidor em solicitações POST ou PUT. Valores válidos: FORM (pares chave-valor) e STREAM (fluxo de bytes). Ao enviar uma solicitação POST ou PUT, este parâmetro especifica como os dados são enviados para o servidor. Os valores válidos são FORM e STREAM, que representam o formato de formulário (pares chave-valor) e o formato de fluxo de bytes, respectivamente. |
STREAM |
| RequestMode |
string |
O modo de mapeamento de solicitação. Valores válidos: MAPPING (mapeia parâmetros de entrada) e PASSTHROUGH (passa os parâmetros de entrada inalterados). |
MAPPING |
| PostBodyDescription |
string |
A descrição do corpo da solicitação. |
fwefwef |
| RequestProtocol |
string |
Os protocolos suportados para a API. Vários valores são separados por vírgula, como HTTP,HTTPS. Valores válidos: HTTP e HTTPS. |
HTTP |
| EscapePathParam |
boolean |
Especifica se deve escapar os parâmetros de caminho. Se verdadeiro, parâmetros como [param] no caminho são tratados como caracteres literais. |
true |
| ServiceConfig |
object |
A configuração para solicitações enviadas do API Gateway para o serviço de backend. |
|
| AoneAppName |
string |
O nome do aplicativo Aone. |
ib-blank |
| MockStatusCode |
integer |
O código de status retornado pelas respostas mock. |
200 |
| ContentTypeValue |
string |
O valor do cabeçalho Content-Type quando ContentTypeCatagory é DEFAULT ou CUSTOM. |
application/x-www-form-urlencoded; charset=UTF-8 |
| ServiceProtocol |
string |
O protocolo usado para conectar ao serviço de backend. Valores válidos: HTTP e HTTPS. |
HTTP |
| ServicePath |
string |
O caminho usado para chamar o serviço de backend. Por exemplo, se a URL completa for |
/object/add |
| ContentTypeCatagory |
string |
A estratégia para definir o cabeçalho Content-Type ao chamar um serviço de backend HTTP:
|
CUSTOM |
| ServiceAddress |
string |
O endpoint usado para chamar o serviço de backend. Por exemplo, se a URL completa for |
http://api.a.com:8080 |
| Mock |
string |
Especifica se o modo mock está ativado. Valores válidos:
|
TRUE |
| ServiceVpcEnable |
string |
Especifica se o canal VPC está ativado. Valores válidos:
|
TRUE |
| MockResult |
string |
A resposta retornada quando o modo mock está ativado. |
test result |
| ServiceHttpMethod |
string |
O método HTTP usado para chamar o serviço de backend. Valores válidos: GET, POST, DELETE, PUT, HEAD, TRACE, PATCH, CONNECT e OPTIONS. |
POST |
| ServiceTimeout |
integer |
O período de tempo limite para o serviço de backend, em milissegundos. |
1000 |
| MockHeaders |
object |
||
| MockHeader |
array<object> |
Mock headers. |
|
|
object |
|||
| HeaderValue |
string |
Value of the HTTP header parameter. |
86400 |
| HeaderName |
string |
Name of the HTTP header parameter. |
Content-Length |
| VpcConfig |
object |
A configuração do canal VPC. |
|
| VpcId |
string |
ID of the VPC. |
vpc-2zeafsc3fygk1*** |
| VpcScheme |
string |
VPC protocol. |
HTTP |
| InstanceId |
string |
ID of the instance (ECS or Server Load Balancer) in the VPC. |
i-bp1h497hkijewv2*** |
| Port |
integer |
Port number of the instance. |
8080 |
| Name |
string |
Name of the VPC authorization. |
glmall-app-test |
| FunctionComputeConfig |
object |
A configuração de backend para o Function Compute. |
|
| FcType |
string |
Function Compute service type. |
HttpTrigger |
| RoleArn |
string |
ARN of the RAM role that grants API Gateway permission to access Function Compute. |
acs:ram::111***:role/aliyunserviceroleforsas |
| Method |
string |
HTTP method. |
GET |
| FcBaseUrl |
string |
Root path of the Function Compute service. |
https://1227****64334133.ap-southeast-1-int***al.fc.aliyuncs.com/201****-15/proxy/test****ice.LATEST/testHttp/ |
| ContentTypeValue |
string |
Value of the Content-Type header when ContentTypeCatagory is DEFAULT or CUSTOM. |
application/x-www-form-urlencoded; charset=UTF-8 |
| RegionId |
string |
Region where Function Compute resides. |
cn-qingdao |
| OnlyBusinessPath |
boolean |
Specifies whether only the business path is passed to the backend. |
false |
| FunctionName |
string |
Name of the Function Compute function. |
edge_function |
| ContentTypeCatagory |
string |
Strategy for setting the Content-Type header when calling a Function Compute backend service:
|
DEFAULT |
| Path |
string |
API request path. |
/api/offline/cacheData |
| ServiceName |
string |
Name of the Function Compute service. |
fcservicename |
| Qualifier |
string |
Alias of the function. |
2 |
| TriggerName |
string |
The name of the trigger. You can specify the TriggerName or TriggerUrl parameter. The TriggerName parameter is optional. |
|
| FcVersion |
string |
||
| OssConfig |
object |
A configuração de backend do OSS. |
|
| Key |
string |
Path to the object or folder in OSS. |
/folder/test.json |
| Action |
string |
OSS operation. Valid values:
|
GetObject |
| OssRegionId |
string |
Region ID of the OSS service. |
cn-hangzhou |
| BucketName |
string |
OSS bucket name. |
cbg-db |
| EventBridgeConfig |
object |
A configuração do EventBridge. |
|
| EventBus |
string |
Event bus. |
testBus |
| EventSource |
string |
Event source. |
baas_driver |
| EventBridgeRegionId |
string |
Region ID of the EventBridge service. |
cn-beijing |
| RoleArn |
string |
ARN of the RAM role that grants EventBridge permission. |
acs:ram::1933122015759***:role/adminoidcaliyun |
| OpenIdConnectConfig |
object |
A configuração do OpenID Connect para autenticação de conta de terceiros. |
|
| OpenIdApiType |
string |
O modo OpenID Connect. Valores válidos:
|
IDTOKEN |
| IdTokenParamName |
string |
O nome do parâmetro de token. |
xxx |
| PublicKeyId |
string |
O ID da chave pública. |
88483727556929326703309904351185815489 |
| PublicKey |
string |
A chave pública. |
EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92 |
| ErrorCodeSamples |
object |
||
| ErrorCodeSample |
array<object> |
Os exemplos de códigos de erro retornados pelo serviço de backend. |
|
|
object |
|||
| Code |
string |
Error code. |
400 |
| Model |
string |
Model. |
[\"*\"] |
| Message |
string |
Error message. |
Missing the parameter UserId |
| Description |
string |
Description. |
Missing parameter UserId |
| SystemParameters |
object |
||
| SystemParameter |
array<object> |
Os parâmetros do sistema enviados do API Gateway para o serviço de backend. |
|
|
object |
|||
| DemoValue |
string |
Example value. |
192.168.1.1 |
| Description |
string |
Description of the parameter. |
Client IP |
| ParameterName |
string |
Name of the system parameter. Valid values: CaClientIp, CaDomain, CaRequestHandleTime, CaAppId, CaRequestId, CaHttpSchema, and CaProxy. |
CaClientIp |
| Location |
string |
Location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
Name of the corresponding backend parameter. |
clientIp |
| CustomSystemParameters |
object |
||
| CustomSystemParameter |
array<object> |
A lista de parâmetros de sistema personalizados. |
|
|
object |
|||
| DemoValue |
string |
Example value. |
192.168.1.1 |
| Description |
string |
Description of the parameter. |
客户端IP |
| ParameterName |
string |
Name of the system parameter. Valid values: CaClientIp, CaDomain, CaRequestHandleTime, CaAppId, CaRequestId, CaHttpSchema, and CaProxy. |
CaClientIp |
| Location |
string |
Location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
Name of the corresponding backend parameter. |
clientIp |
| ConstantParameters |
object |
||
| ConstantParameter |
array<object> |
Os parâmetros constantes enviados do API Gateway para o serviço de backend. |
|
|
object |
|||
| Description |
string |
Description of the parameter. |
constance |
| Location |
string |
Location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameterName |
string |
Name of the backend parameter. |
constance |
| ConstantValue |
string |
Value of the constant parameter. |
constance |
| RequestParameters |
object |
||
| RequestParameter |
array<object> |
Os parâmetros enviados dos consumidores para o API Gateway. |
|
|
object |
|||
| JsonScheme |
string |
JSON schema validation. Valid only when ParameterType is String. |
JSON |
| MaxValue |
integer |
Maximum value. Valid only when ParameterType is Int, Long, Float, or Double. |
123456 |
| ArrayItemsType |
string |
Type of the array element. |
String |
| MinValue |
integer |
Minimum value. Valid only when ParameterType is Int, Long, Float, or Double. |
123456 |
| DocShow |
string |
Visibility in the documentation. Valid values: PUBLIC and PRIVATE. |
PUBLIC |
| MaxLength |
integer |
Maximum length of the parameter. Valid only when ParameterType is String. |
123456 |
| DefaultValue |
string |
Default value. |
20 |
| ApiParameterName |
string |
Parameter name. |
age |
| EnumValue |
string |
Allowed discrete values. Valid only when ParameterType is Int, Long, Float, Double, or String. Separate multiple values with commas, such as 1,2,3,4,9 or A,B,C,E,F. |
boy,girl |
| DemoValue |
string |
Example value. |
20 |
| Required |
string |
Specifies whether the parameter is required. Valid values: REQUIRED and OPTIONAL. |
OPTIONAL |
| Description |
string |
Description of the parameter. |
age |
| ParameterType |
string |
Type of the parameter. Valid values: String, Int, Long, Float, Double, and Boolean. |
String |
| RegularExpression |
string |
Regular expression for parameter validation. Valid only when ParameterType is String. |
xxx |
| MinLength |
integer |
Minimum length of the parameter. Valid only when ParameterType is String. |
123456 |
| DocOrder |
integer |
Order in the documentation. |
0 |
| Location |
string |
Location of the parameter. Valid values: BODY, HEAD, QUERY, and PATH. |
HEAD |
| ServiceParameters |
object |
||
| ServiceParameter |
array<object> |
Os parâmetros que o gateway envia para o serviço de backend em uma solicitação de API. |
|
|
object |
|||
| Location |
string |
The location of the parameter. Valid values: BODY, HEAD, QUERY, PATH. |
HEAD |
| ParameterType |
string |
Backend parameter data type. Values can be STRING, NUMBER, or BOOLEAN, representing character, number, and Boolean respectively. |
String |
| ServiceParameterName |
string |
The name of the backend parameter. |
clientIp |
| ServiceParametersMap |
object |
||
| ServiceParameterMap |
array<object> |
O mapeamento entre os parâmetros que o consumidor envia para o gateway e os parâmetros que o gateway envia para o serviço de backend. |
|
|
object |
|||
| RequestParameterName |
string |
Corresponds to the frontend request parameter name. This value must exist in RequestParametersObject and match RequestParam.ApiParameterName. |
name |
| ServiceParameterName |
string |
Backend parameter name |
name |
| DeployedInfos |
object |
||
| DeployedInfo |
array<object> |
O status de publicação da API. |
|
|
object |
|||
| StageName |
string |
The environment name can be RELEASE or TEST. |
RELEASE |
| EffectiveVersion |
string |
The effective version. |
xxx |
| DeployedStatus |
string |
The deployment status. Valid values: DEPLOYED and NONDEPLOYED. DEPLOYED indicates that the API is deployed. NONDEPLOYED indicates that the API is not deployed. |
DEPLOYED |
| TagList |
object |
||
| Tag |
array<object> |
A lista de tags. |
|
|
object |
|||
| TagKey |
string |
Tag key |
APP |
| TagValue |
string |
Tag value |
value3 |
Exemplos
Resposta de sucesso
JSON formato
{
"ApiId": "8afff6c8c4c6447abb035812e4d66b65",
"ResultType": "JSON",
"WebSocketApiType": "COMMON",
"DisableInternet": false,
"ResultBodyModel": "{}",
"ResultSample": "200",
"AppCodeAuthType": "HEADER",
"AllowSignatureMethod": "HmacSHA256",
"RegionId": "cn-qingdao",
"ForceNonceCheck": true,
"Visibility": "PUBLIC",
"FailResultSample": "400",
"AuthType": "APP",
"ModifiedTime": "2016-07-28T13:13:12Z",
"RequestId": "D0FF585F-7966-40CF-BC60-75DB070B23D5<",
"Description": "Api description",
"GroupName": "ApiTest",
"GroupId": "08ae4aa0f95e4321849ee57f4e0b3077",
"Mock": "CLOSED",
"MockResult": "test result",
"CreatedTime": "2016-07-28T09:50:43Z",
"ApiName": "ApiName",
"BackendEnable": true,
"BackendConfig": {
"BackendId": "0038e00c3dca44fcba3a94015d8f5bbf",
"BackendType": "HTTP",
"BackendName": "testoss"
},
"RequestConfig": {
"BodyModel": "https://apigateway.aliyun.com/models/3a240a127dcc4afd9ab1bf7e947b4095/9e2df550e85b4121a79ec33e2619eaab",
"RequestPath": "/api/billing/test/[type]",
"RequestHttpMethod": "POST",
"BodyFormat": "STREAM",
"RequestMode": "MAPPING",
"PostBodyDescription": "fwefwef",
"RequestProtocol": "HTTP",
"EscapePathParam": true
},
"ServiceConfig": {
"AoneAppName": "ib-blank",
"MockStatusCode": 200,
"ContentTypeValue": "application/x-www-form-urlencoded; charset=UTF-8",
"ServiceProtocol": "HTTP",
"ServicePath": "/object/add",
"ContentTypeCatagory": "CUSTOM",
"ServiceAddress": "http://api.a.com:8080",
"Mock": "TRUE",
"ServiceVpcEnable": "TRUE",
"MockResult": "test result",
"ServiceHttpMethod": "POST",
"ServiceTimeout": 1000,
"MockHeaders": {
"MockHeader": [
{
"HeaderValue": "86400",
"HeaderName": "Content-Length"
}
]
},
"VpcConfig": {
"VpcId": "vpc-2zeafsc3fygk1***",
"VpcScheme": "HTTP",
"InstanceId": "i-bp1h497hkijewv2***",
"Port": 8080,
"Name": "glmall-app-test"
},
"FunctionComputeConfig": {
"FcType": "HttpTrigger",
"RoleArn": "acs:ram::111***:role/aliyunserviceroleforsas",
"Method": "GET",
"FcBaseUrl": "https://1227****64334133.ap-southeast-1-int***al.fc.aliyuncs.com/201****-15/proxy/test****ice.LATEST/testHttp/",
"ContentTypeValue": "application/x-www-form-urlencoded; charset=UTF-8",
"RegionId": "cn-qingdao",
"OnlyBusinessPath": false,
"FunctionName": "edge_function",
"ContentTypeCatagory": "DEFAULT",
"Path": "/api/offline/cacheData",
"ServiceName": "fcservicename",
"Qualifier": "2",
"TriggerName": "",
"FcVersion": ""
},
"OssConfig": {
"Key": "/folder/test.json",
"Action": "GetObject",
"OssRegionId": "cn-hangzhou",
"BucketName": "cbg-db"
},
"EventBridgeConfig": {
"EventBus": "testBus",
"EventSource": "baas_driver",
"EventBridgeRegionId": "cn-beijing",
"RoleArn": "acs:ram::1933122015759***:role/adminoidcaliyun"
}
},
"OpenIdConnectConfig": {
"OpenIdApiType": "IDTOKEN",
"IdTokenParamName": "xxx",
"PublicKeyId": "88483727556929326703309904351185815489",
"PublicKey": "EB1837F8693CCED0BF750B3AD48467BEB569E780A14591CF92"
},
"ErrorCodeSamples": {
"ErrorCodeSample": [
{
"Code": "400",
"Model": "[\\\"*\\\"]",
"Message": "Missing the parameter UserId",
"Description": "Missing parameter UserId"
}
]
},
"SystemParameters": {
"SystemParameter": [
{
"DemoValue": "192.168.1.1",
"Description": "Client IP",
"ParameterName": "CaClientIp",
"Location": "HEAD",
"ServiceParameterName": "clientIp"
}
]
},
"CustomSystemParameters": {
"CustomSystemParameter": [
{
"DemoValue": "192.168.1.1",
"Description": "客户端IP",
"ParameterName": "CaClientIp",
"Location": "HEAD",
"ServiceParameterName": "clientIp"
}
]
},
"ConstantParameters": {
"ConstantParameter": [
{
"Description": "constance",
"Location": "HEAD",
"ServiceParameterName": "constance",
"ConstantValue": "constance"
}
]
},
"RequestParameters": {
"RequestParameter": [
{
"JsonScheme": "JSON",
"MaxValue": 123456,
"ArrayItemsType": "String",
"MinValue": 123456,
"DocShow": "PUBLIC",
"MaxLength": 123456,
"DefaultValue": "20",
"ApiParameterName": "age",
"EnumValue": "boy,girl",
"DemoValue": "20",
"Required": "OPTIONAL",
"Description": "age",
"ParameterType": "String",
"RegularExpression": "xxx",
"MinLength": 123456,
"DocOrder": 0,
"Location": "HEAD"
}
]
},
"ServiceParameters": {
"ServiceParameter": [
{
"Location": "HEAD",
"ParameterType": "String",
"ServiceParameterName": "clientIp"
}
]
},
"ServiceParametersMap": {
"ServiceParameterMap": [
{
"RequestParameterName": "name",
"ServiceParameterName": "name"
}
]
},
"DeployedInfos": {
"DeployedInfo": [
{
"StageName": "RELEASE",
"EffectiveVersion": "xxx",
"DeployedStatus": "DEPLOYED"
}
]
},
"TagList": {
"Tag": [
{
"TagKey": "APP",
"TagValue": "value3"
}
]
}
}
Códigos de erro
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.