ListHttpApiOperations - 获取接口列表

获取接口列表。

调试

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

授权信息

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

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用前面加 * 表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
apig:ListHttpApiOperationslist
*HttpApi
acs:apig:{#regionId}:{#accountId}:httpapi/{#HttpApiId}

请求语法

GET /v1/http-apis/{httpApiId}/operations HTTP/1.1

请求参数

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

目标 HTTP API ID。

api-xxx
methodstring

按 Method 列举接口。

枚举值:
  • TRACETRACE
  • HEADHEAD
  • DELETEDELETE
  • POSTPOST
  • GETGET
  • CONNECTCONNECT
  • OPTIONSOPTIONS
  • PUTPUT
  • PATCHPATCH
GET
pathLikestring

按路径前缀匹配搜索接口。

/v1
nameLikestring

按接口名称前缀搜索接口。

GetUser
pageNumberinteger

分页页码,从 1 开始,不填默认 1。

1
pageSizeinteger

分页大小,有效范围[1, 100],不填默认 10。

10
namestring

按照名称精确搜索。

getUserInfo
withConsumerInEnvironmentIdstring

响应中每个接口信息携带指定环境 ID 下的指定消费者的授权规则列表。需要额外指定 withConsumerInfoById 字段。

env-xxx
withConsumerInfoByIdstring

响应中每个接口信息携带指定环境 ID 下的指定消费者的授权规则列表。需要额外指定 withConsumerInEnvironmentId 字段。

cs-xxx
consumerAuthorizationRuleIdstring

根据特定的消费者授权规则 ID 过滤接口列表,响应中的接口列表仅包含已授权的接口。

cas-xxx
withPluginAttachmentByPluginIdstring

插件 ID,根据此插件 ID 获取插件发布信息。

pl-xxx

返回参数

名称类型描述示例值
object

响应。

requestIdstring

请求 ID。

585657D2-1C20-5B8A-AF17-D727C6490BE4
codestring

响应状态码。

Ok
messagestring

响应消息,

success
dataobject

接口列表。

pageNumberinteger

分页页码。

1
pageSizeinteger

分页大小。

10
totalSizeinteger

总数量。

10
itemsarray

接口列表。

itemHttpApiOperationInfo

接口信息。

示例

正常返回示例

JSON格式

{
  "requestId": "585657D2-1C20-5B8A-AF17-D727C6490BE4",
  "code": "Ok",
  "message": "success",
  "data": {
    "pageNumber": 1,
    "pageSize": 10,
    "totalSize": 10,
    "items": [
      {
        "operationId": "op-xxx",
        "method": "GET",
        "name": "GetUserInfo",
        "path": "/user/123",
        "description": "获取用户信息",
        "response": {
          "contentType": "application/json",
          "items": [
            {
              "code": 200,
              "example": {
                "result": "ok"
              },
              "description": "正常接口响应",
              "jsonSchema": {
                "type": "object",
                "required": [
                  "result"
                ],
                "properties": {
                  "result": {
                    "type": "string",
                    "description": "操作结果,'ok' 表示成功"
                  }
                }
              }
            }
          ]
        },
        "request": {
          "headerParameters": [
            {
              "name": "userId",
              "required": true,
              "type": "String",
              "defaultValue": 123,
              "exampleValue": 123,
              "description": "用户ID"
            }
          ],
          "queryParameters": [
            {
              "name": "userId",
              "required": true,
              "type": "String",
              "defaultValue": 123,
              "exampleValue": 123,
              "description": "用户ID"
            }
          ],
          "pathParameters": [
            {
              "name": "userId",
              "required": true,
              "type": "String",
              "defaultValue": 123,
              "exampleValue": 123,
              "description": "用户ID"
            }
          ],
          "body": {
            "description": "body参数描述",
            "example": {
              "result": "ok"
            },
            "contentType": "application/json",
            "jsonSchema": {
              "type": "object",
              "required": [
                "result"
              ],
              "properties": {
                "result": {
                  "type": "string",
                  "description": "操作结果,'ok' 表示成功"
                }
              }
            }
          }
        },
        "mock": {
          "enable": false,
          "responseCode": 200,
          "responseContent": "Mock测试"
        },
        "createTimestamp": 1719386834548,
        "enableAuth": true,
        "authConfig": {
          "authType": "Jwt",
          "authMode": "NoAuth"
        },
        "status": "Deployed",
        "deployConfigs": [
          {
            "customDomainIds": [
              "d-xxx"
            ],
            "environmentId": "env-xxx",
            "backendScene": "SingleService",
            "serviceConfigs": [
              {
                "serviceId": "svc-xxx",
                "weight": 100,
                "modelNamePattern": "qwen-*",
                "modelName": "qwen-max"
              }
            ],
            "policyConfigs": [
              {
                "type": "AiFallback",
                "enable": true,
                "aiFallbackConfig": {
                  "serviceConfigs": [
                    {
                      "serviceId": "",
                      "targetModelName": ""
                    }
                  ]
                }
              }
            ],
            "autoDeploy": true,
            "gatewayId": "gw-xx",
            "routeBackend": {
              "scene": "Single",
              "services": [
                {
                  "serviceId": "service-cq2bmmdlhtgj***",
                  "name": "item-service",
                  "protocol": "HTTP",
                  "port": 0,
                  "weight": 49,
                  "version": "v1"
                }
              ]
            },
            "customDomainInfos": [
              {
                "domainId": "d-cshee6dlhtgkf4muio3g",
                "name": "hello-server.com",
                "protocol": "HTTP"
              }
            ],
            "subDomains": [
              {
                "domainId": "d-csmn42um1hksudfk9eng",
                "name": "test",
                "protocol": "HTTP",
                "networkType": "Intranet"
              }
            ],
            "gatewayInfo": {
              "gatewayId": "gw-cq7og15lhtgi6qasrj60",
              "name": "apitest-gw",
              "vpcInfo": {
                "vpcId": "vpc-uf664nyle5kh***",
                "name": "商品中心预发环境专有网络"
              },
              "engineVersion": "2.0.7"
            },
            "mock": {
              "enable": false,
              "responseCode": 200,
              "responseContent": "Mock测试"
            },
            "gatewayType": "API"
          }
        ]
      }
    ]
  }
}

错误码

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

变更历史

变更时间变更内容概要操作
2024-11-28OpenAPI 入参发生变更查看变更详情
2024-10-24OpenAPI 入参发生变更查看变更详情
2024-08-05OpenAPI 入参发生变更查看变更详情