上线服务 | 大装置帮助中心
跳到主要内容

上线服务

POST /v2/services/{service}:online

请求头(Request Header)

参考认证(authentication)

请求参数(Request Parameters)

名称类型必须位置默认值取值范围描述
servicestringpath--The service id.

请求体(Request Body)

名称类型必须默认值取值范围描述
namestring--服务名

请求示例(Request Example)

curl --location --request POST 'https://ams.sensecoreapi.tech/studio/ams/data/rp/v2/services/testllama7baaa:online' \
-H 'authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6InB1YmxpYzpoeWRyYS5qd3QuYWNjZXNzLXRva2VuIiwidHlwIjoiSldUIn0.eyJhdWQiOltdLCJjbGllbnRfaWQiOiI0ZTQxNDg1NC03MjAwLTUwOWYtYjk2MC1mOGIwZGJiYmYzMzEiLCJleHAiOjE3MDUzODYyMzEsImV4dCI6eyJhbGxfYXoiOmZhbHNlLCJhel9saXN0IjpbImNuLXNoLTAxYSIsImNuLXNoLTAxYiIsImNuLXNoLTAxeiJdLCJpc19kZWRpY2F0ZWRfdGVuYW50IjpmYWxzZSwicHJwX2xpc3QiOlsiY24tc2gtMDFhLXBycDAxIiwiY24tc2gtMDFiLXBycDAxIl0sInRlbmFudF9jZXJ0aWZ5X3N0YXR1cyI6dHJ1ZSwidGVuYW50X2NlcnRpZnlfdHlwZSI6ImVudGVycHJpc2UiLCJ0ZW5hbnRfY29kZSI6Im1hYXNyb290IiwidGVuYW50X2lkIjoiYjRmNjFmNGMtOGE2YS00ZmRiLWI0YzEtZjNiOWE0YWE0YjI0IiwidXNlcl9pZCI6ImNhNzFlZDFkLTliMjYtNDllNS1iZTk2LWIyZGE0NDlkNWE5NCIsInVzZXJfdHlwZSI6Im5vcm1hbCIsInVzZXJuYW1lIjoiamNhbzA4In0sImlhdCI6MTcwNTM3NTQzMSwiaXNzIjoiaHR0cHM6Ly9zaWduaW4uc2Vuc2Vjb3JlLnRlY2gvIiwianRpIjoiZmRjNjZlNjktNmNmYy00MDU5LWJjMTItYTBmODJiMjQxYjE5IiwibmJmIjoxNzA1Mzc1NDMxLCJzY3AiOlsib3BlbmlkIiwib2ZmbGluZSIsIm9mZmxpbmVfYWNjZXNzIl0sInN1YiI6ImpjYW8wODpiNGY2MWY0Yy04YTZhLTRmZGItYjRjMS1mM2I5YTRhYTRiMjQ6Y2E3MWVkMWQtOWIyNi00OWU1LWJlOTYtYjJkYTQ0OWQ1YTk0In0.ETwXlKKODAO5V85zUlaTEy9gp81dkQboF3p423yXXpPLYqup88CwmDI4VhHTsECkMS8w-HaSSae0oKwdF5wdfNazsUx3QeGBiXY7WcOH12cWh2yGaBO7oF75OG2n5PY3aBd4TSF7M7Y36oFjXF2zHIG8oGfvzBTa0IsKaZSrRhx2X9oP3XEWwIcIotIxl-ZC5UWyy5qyfBRsEhyn-P_j7Bl8z4Gkh3VTcDZXbPNG7n7TwymZQrmBIOpKXNmqSrkj3rYn28y9leWlSmmEOKL3i0bBfgaZ-suDxl-Uk9HXOqHEr7FdtAQsrs9jgdqVuvw2Mfef48N8twB_16p-7pu2y84lSJHt1jEDeHgTRjnvmm8tO2AP_u04eUv3a936B8gZpON9uomIK5otu0P0UDZIsyLDe-bvUr4kM9E0zvTQBLqm_UyWeGgiXuZrQPUrYVqx7yPtwEuzPf4rWjP4pmEZyr7hHKNPS-MeAJmG3eIyNm0iQAfCwSjkk-muWDPt2FmLN1i5_jUn5qKWhk9je_yqLEAkwWYMwQGAcw3qdzSITnVQif7pLE3bfDUfrkqgcG4UKSq2-NN_8qhfovSDWy8gbf9i9toKrJxZxRK-5xHtYvkUYVwvQUc6rUYmVJK6AmiVYGNeNp0_UsoWgH3vZE-X37abysZZ-sybODupv9URhNM' \
--data '{"name":"testllama7baaa"}'

响应(Response)

名称类型描述
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)

{
"name": "testllama7baaa",
"spec": {
"resource_id": "9ff3beb1-b41d-11ee-a9e7-7af9e4e0e6e5",
"subscription": "b4f61f4c-8a6a-4fdb-b4c1-f3b9a4aa4b24",
"resource_group": "default",
"zone": "cn-sh-01z"
},
"status": {
"uri": "https://maasroot.ams-endpoint.cn-sh-01.sensecoreapi.tech/testllama7baaa",
"health": {
"message": "服务正在上线中",
"status": "HEALTH_STATE_CODE_ONLINING"
},
"instances": [
{
"name": "testllama7bddd",
"health": {
"message": "实例已下线",
"status": "HEALTH_STATE_CODE_OFFLINED"
},
"running_replicas": 0,
"current_replicas": 0
},
{
"name": "testllama7bccc",
"health": {
"message": "实例已下线",
"status": "HEALTH_STATE_CODE_OFFLINED"
},
"running_replicas": 0,
"current_replicas": 0
}
],
"creator_name": "maasroot"
},
"create_time": "2024-01-16T03:16:23.183012Z"
}