ListServices - 查询服务列表

更新时间:
复制 MD 格式

获取服务列表。

调试

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

调试

授权信息

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

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

apig:ListServices

none

*Service

acs:apig:{#regionId}:{#accountId}:service/*

请求语法

GET /v1/services HTTP/1.1

请求参数

名称

类型

必填

描述

示例值

pageNumber

integer

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

1

pageSize

integer

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

10

name

string

根据服务名精确查询。

user-service

sourceType

string

根据服务来源类型查询, 服务来源:

  • MSE_NACOS: 来源为 MSE Nacos 里的服务。

  • K8S: 来源为容器服务里 K8S 集群里的服务。

  • FC3: 来源为函数计算里的服务。

  • VIP: 来源为固定地址的服务。

  • DNS: 来源为域名的服务。

枚举值:

  • K8S :

    容器服务

  • FC3 :

    函数计算服务

  • DNS :

    DNS 域名

  • VIP :

    固定地址

  • MSE_NACOS :

    MSE Nacos

MSE_NACOS

sourceTypes

string

服务来源类型列表

["K8S", "FC3"]

gatewayId

string

云原生 API 网关 ID。

gw-cpv4sqdl*****

resourceGroupId

string

资源组 ID。

rg-acfmxxe5rc6cvla

返回参数

名称

类型

描述

示例值

object

返回体

requestId

string

请求 ID。

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

code

string

响应状态码。

Ok

message

string

响应消息。

success

data

object

响应数据。

pageNumber

integer

分页页码。

1

pageSize

integer

分页大小。

10

totalSize

integer

总数量。

18

items

array

服务列表。

Service

服务信息。

示例

正常返回示例

JSON格式

{
  "requestId": "585657D2-1C20-5B8A-AF17-D727C6490BE4",
  "code": "Ok",
  "message": "success",
  "data": {
    "pageNumber": 1,
    "pageSize": 10,
    "totalSize": 18,
    "items": [
      {
        "serviceId": "svc-cr6pk4tlhtgm***",
        "sourceType": "MSE_NACOS",
        "name": "user-service",
        "namespace": "PUBLIC",
        "healthCheck": {
          "protocol": "TCP",
          "timeout": 5,
          "interval": 10,
          "healthyThreshold": 2,
          "unhealthyThreshold": 3,
          "httpPath": "/health",
          "httpHost": "example.com",
          "enable": true
        },
        "healthStatus": "Healthy",
        "qualifier": "LATEST",
        "createTimestamp": 1725617840096,
        "updateTimestamp": 1725868548440,
        "protocol": "HTTP",
        "gatewayId": "gw-xxxx",
        "modelProviderId": "mp-xxxx",
        "resourceGroupId": "rg-xxx",
        "groupName": "publich",
        "aiServiceConfig": {
          "provider": "qwen\nmoonshot\nbaichuan\nyi\nzhipuai\n360ai\nhunyuan\nstepfun\nspark\nopenai\nclaude\nanthropic\ndoubao\nminimax\ngemini\nazure\ndeepseek\ncustom\npai-eas\nbedrock\nvertex",
          "address": "https://dashscope.aliyun.com",
          "enableHealthCheck": true,
          "paiEASServiceConfig": {
            "workspaceId": "cb89d4de30042df4459442589664e00d",
            "serviceId": "svc-cvaeb0um1hkqp79k72v0",
            "serviceName": "auto-ai-service",
            "endpointType": "\"public\",\"private\""
          },
          "bedrockServiceConfig": {
            "awsRegion": "us-east-1",
            "awsAccessKey": "AKIAIOSFODNN7EXAMPLE",
            "awsSecretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
          },
          "ApiKeyGenerateMode": "Custom",
          "defaultModelName": "gpt-4",
          "enableOutlierDetection": true,
          "vertexServiceConfig": {
            "vertexAuthKey": "{\\\"type\\\":\\\"service_account\\\",\\\"project_id\\\":\\\"my-project\\\",\\\"private_key\\\":\\\"-----BEGIN PRIVATE KEY-----...\\\",\\\"client_email\\\":\\\"xxx@xxx.iam.gserviceaccount.com\\\",\\\"token_uri\\\":\\\"https://oauth2.googleapis.com/token\\\"}",
            "vertexRegion": "us-central1",
            "vertexProjectId": "my-project",
            "vertexAuthServiceName": "google-oauth2",
            "geminiSafetySetting": {
              "key": "{\"BLOCK_NONE\": \"true\"}"
            },
            "vertexTokenRefreshAhead": 300
          },
          "protocols": [
            "OpenAI/v1"
          ],
          "apiKeys": [
            "sk-xxx"
          ],
          "compatibleProtocols": [
            "\"openai\", \"anthropic\""
          ]
        },
        "agentServiceConfig": {
          "address": "https://dashscope.aliyuncs.com/api/v1",
          "dashScopeConfig": {
            "appCredentials": [
              {
                "apiKey": "sk-xxx",
                "appId": "app-xxx"
              }
            ]
          },
          "enableHealthCheck": true,
          "provider": "qwen",
          "difyConfig": {
            "botType": "chatbot",
            "apiKey": "app-xxx"
          },
          "enableOutlierDetection": true,
          "customConfig": {
            "apiKey": "app-xxx\n",
            "apiKeyGenerateMode": "Reference"
          },
          "protocols": [
            "DashScope"
          ]
        },
        "expressType": "StartExecution",
        "addresses": [
          "127.0.0.1:8080"
        ],
        "ports": [
          {
            "port": 8080,
            "name": "user-service",
            "protocol": "TCP"
          }
        ],
        "unhealthyEndpoints": [
          "192.168.1.12:8080"
        ],
        "outlierEndpoints": [
          "[\"10.0.0.2:8080\"]"
        ],
        "labelDetails": [
          {
            "key": "version",
            "values": [
              "[\"v1.0.0\", \"v2.0.0\"]"
            ]
          }
        ],
        "runtimeDetailStatus": "Available",
        "runtimeDetailErrorCode": "RuntimeEndpointTimeout",
        "versions": [
          {
            "name": "v1",
            "labels": [
              {
                "key": "version",
                "value": "v1"
              }
            ]
          }
        ]
      }
    ]
  }
}

错误码

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

变更历史

更多信息,参考变更详情