获取服务列表 | 大装置帮助中心
跳到主要内容

获取服务列表

GET /v2/services

请求头(Request Header)

参考认证(authentication)

请求参数(Request Parameters)

名称类型必须位置默认值取值范围描述
page_sizeintegerquery--分页大小
page_tokenstringquery--分页码
filterstringquery--过滤器

请求示例(Request Example)

curl --location --globoff 'https://ams.sensecoreapi.tech/studio/ams/data/rp/v2/services?page_size=0&page_token=&filter={%22name%22%3A%22testllama7b%22}' \
--header 'authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6InB1YmxpYzpoeWRyYS5qd3QuYWNjZXNzLXRva2VuIiwidHlwIjoiSldUIn0.eyJhdWQiOltdLCJjbGllbnRfaWQiOiI0ZTQxNDg1NC03MjAwLTUwOWYtYjk2MC1mOGIwZGJiYmYzMzEiLCJleHAiOjE3MDUzMjA4NjcsImV4dCI6eyJhbGxfYXoiOmZhbHNlLCJhel9saXN0IjpbImNuLXNoLTAxYSIsImNuLXNoLTAxYiIsImNuLXNoLTAxeiJdLCJpc19kZWRpY2F0ZWRfdGVuYW50IjpmYWxzZSwicHJwX2xpc3QiOlsiY24tc2gtMDFhLXBycDAxIiwiY24tc2gtMDFiLXBycDAxIl0sInRlbmFudF9jZXJ0aWZ5X3N0YXR1cyI6dHJ1ZSwidGVuYW50X2NlcnRpZnlfdHlwZSI6ImVudGVycHJpc2UiLCJ0ZW5hbnRfY29kZSI6Im1hYXNyb290IiwidGVuYW50X2lkIjoiYjRmNjFmNGMtOGE2YS00ZmRiLWI0YzEtZjNiOWE0YWE0YjI0IiwidXNlcl9pZCI6ImNhNzFlZDFkLTliMjYtNDllNS1iZTk2LWIyZGE0NDlkNWE5NCIsInVzZXJfdHlwZSI6Im5vcm1hbCIsInVzZXJuYW1lIjoiamNhbzA4In0sImlhdCI6MTcwNTMxMDA2NiwiaXNzIjoiaHR0cHM6Ly9zaWduaW4uc2Vuc2Vjb3JlLnRlY2gvIiwianRpIjoiZjliOTQ0NzAtNTE1MC00MmJjLWE3NWYtYzA5NjA1ZGRmYmZhIiwibmJmIjoxNzA1MzEwMDY2LCJzY3AiOlsib3BlbmlkIiwib2ZmbGluZSIsIm9mZmxpbmVfYWNjZXNzIl0sInN1YiI6ImpjYW8wODpiNGY2MWY0Yy04YTZhLTRmZGItYjRjMS1mM2I5YTRhYTRiMjQ6Y2E3MWVkMWQtOWIyNi00OWU1LWJlOTYtYjJkYTQ0OWQ1YTk0In0.VevzG0RcMEOEAvtyjO0u1tFd96hjcLRFvEpV4p35L4J0Je8feUZNa-c-geTNiYIS7Y-ABWxaVz1VoK8T3AQzrIpXw7nfIxcqtmu9xDVtQpe07qov641wL2Qs_0vd5zF-V80laqHkUBavdtxndwdQ7Jmwfb8BeC2SksGFxYEREEbPCoTRr8xArVhMYJRqiFnL1j2ywKXnJ-rh4-QV_jVx-KgV_vFdh8cGOtEpr_3QRjcIyQ1jxf1-NmR1ycQG71Lw4_CKF0dKMZ_Zfqtoxm9h320swNwM3TSnS83KcabhBdmzcdJ-s25Rd-13AK7TRrsP3IOvp5rZkpN2VgmQFN5B2CUI_CG5WMo8smNZDtQU8707nhqvJV3Gfwy67y3A7Xn7-W6I2upunTokZtHv6csmpgJked1gph_C7vYDbwGf2JxLgqOblnN-XT1XI7d7ciZr3eRqxHEUfKDQCNlhu5z55KHZl_dQhCuedLeXe3JKRgwG4DLFrg0H8Thce5GxX4z0YL6L5bfIXuBa5VBtGcl5XDhJczgWJP8S9ekd-WxryaEg-Nyra04sjFLXGxhaTyEjuIAj9wgcIAk-vGEz19o5tjJqr2wZwqgM2ZZp9ZQDeoDETZjoF3kXxwkrciXgq2SPjp5sg2U4vXHc-cmJNX2djpfHHv-ff7UEfmdGO0TtipU' \
--data ''

响应(Response)

名称类型描述
servicesarray[object]服务
next_page_tokenstring下一条分页码

其中,services的参数如下

名称类型描述
namestring名称
specobject服务规格
statusobject服务状态
create_timestring创建时间

其中,spec的参数如下

名称类型描述
resource_idstring资源id
subscriptionstring订阅
resource_groupstring资源组
zonestring可用区

其中,status的参数如下

名称类型描述
uristringuri
healthobject健康状态
instancesarray[object]实例简报
creator_namestring创建者

其中,health的参数如下

名称类型描述
messagestring消息
statusstring状态

其中,status有如下情况

状态含义
HEALTH_STATE_CODE_UNKNOWN_UNSPECIFIED未知
HEALTH_STATE_CODE_PROGRESSING更新中
HEALTH_STATE_CODE_HEALTHY健康
HEALTH_STATE_CODE_SUSPENDED更新暂停中
HEALTH_STATE_CODE_DEGRADED异常
HEALTH_STATE_CODE_MISSING未知
HEALTH_STATE_CODE_DELETING删除中
HEALTH_STATE_CODE_FAILED已失败
HEALTH_STATE_CODE_CREATING创建中
HEALTH_STATE_CODE_ONLINING上线中
HEALTH_STATE_CODE_OFFLINING下线中
HEALTH_STATE_CODE_OFFLINED已下线

其中,instances的参数如下

名称类型描述
namestring名称
healthobject健康状态
running_replicasinteger运行中副本数
current_replicasinteger当前副本数

其中,health的参数如下

名称类型描述
messagestring消息
statusstring状态

其中,status有如下情况

状态含义
HEALTH_STATE_CODE_UNKNOWN_UNSPECIFIED未知
HEALTH_STATE_CODE_PROGRESSING更新中
HEALTH_STATE_CODE_HEALTHY健康
HEALTH_STATE_CODE_SUSPENDED更新暂停中
HEALTH_STATE_CODE_DEGRADED异常
HEALTH_STATE_CODE_MISSING未知
HEALTH_STATE_CODE_DELETING删除中
HEALTH_STATE_CODE_FAILED已失败
HEALTH_STATE_CODE_CREATING创建中
HEALTH_STATE_CODE_ONLINING上线中
HEALTH_STATE_CODE_OFFLINING下线中
HEALTH_STATE_CODE_OFFLINED已下线

响应示例(Response Example)

{
"services": [
{
"name": "testllama7b",
"spec": {
"resource_id": "c9f834b2-b126-11ee-9812-f26b14e33415",
"subscription": "b4f61f4c-8a6a-4fdb-b4c1-f3b9a4aa4b24",
"resource_group": "default",
"zone": "cn-sh-01z"
},
"status": {
"uri": "https://maasroot.ams-endpoint.cn-sh-01.sensecoreapi.tech/testllama7b",
"health": {
"message": "This service is healthy",
"status": "HEALTH_STATE_CODE_HEALTHY"
},
"instances": [
{
"name": "testllama7b",
"health": {
"message": "This instance is healthy",
"status": "HEALTH_STATE_CODE_HEALTHY"
},
"running_replicas": 1,
"current_replicas": 1
}
],
"creator_name": "maasroot"
},
"create_time": "2024-01-12T08:44:25.306047Z"
}
],
"next_page_token": ""
}