获取服务列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
apig:ListServices |
none |
*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 |
| 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"
}
]
}
]
}
]
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。