修改端点
功能介绍
更新端点。用户可通过该接口更新某端点信息,输入为名称、描述、资源配置、镜像包配置、配置等信息,返回更新后的端点信息,rayservice的log_config会被忽略,无法更新。此接口为异步接口,配套使用接口ShowEndpoint查询端点信息,无特殊场景。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
PUT https://localhost.com/v1/workspaces/{workspace_id}/endpoints/{endpoint_id}
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
否 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
否 |
String |
|
description |
否 |
String |
|
reserved_resource |
否 |
ReservedResource object |
|
ray_resource |
否 |
RayResourceInput object |
|
cap |
否 |
CapRef object |
|
config |
否 |
EndpointConfig object |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
apu |
否 |
ResourceDef object |
|
dpu |
否 |
SqlResourceDef object |
|
mu |
否 |
ResourceDemand object |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
spec_code |
是 |
String |
|
warm_up_num |
是 |
Integer |
|
max_num |
否 |
Integer |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
spec_code |
是 |
String |
|
warm_up_num |
是 |
Integer |
|
max_num |
否 |
Integer |
|
use_public_resource |
否 |
Boolean |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
head_node_resource |
是 |
HeadNodeResourceDemand object |
|
work_node_resources |
是 |
Array of WorkNodeResourceDemand objects |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
spec_code |
是 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
是 |
String |
|
resource |
是 |
ResourceDemand object |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
spec_code |
是 |
String |
|
min |
是 |
Integer |
|
max |
是 |
Integer |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
cap_id |
否 |
String |
|
version_id |
否 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
ray_service_config |
否 |
RayServiceConfig object |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
ray_serve_config |
是 |
RayServeConfig object |
|
ray_cluster_config |
是 |
RayClusterConfig object |
|
log_config |
否 |
RayServiceLogConfig object |
|
data_infos |
否 |
Array of DataBriefInfo objects |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
applications |
否 |
Array of ServeApplication objects |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
是 |
String |
|
import_path |
是 |
String |
|
deployments |
是 |
Array of Deployment objects |
|
runtime_env |
是 |
ServeRuntimeEnv object |
|
route_prefix |
否 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
否 |
String |
|
ray_actor_options |
否 |
RayActorOptions object |
|
autoscaling_config |
否 |
AutoscalingConfig object |
|
num_replicas |
否 |
Integer |
|
user_config |
否 |
Object |
|
max_replicas_per_node |
否 |
Integer |
|
max_ongoing_requests |
否 |
Integer |
|
max_queued_requests |
否 |
Integer |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
num_cpus |
否 |
Double |
|
memory |
否 |
Double |
|
resources |
否 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
target_ongoing_requests |
否 |
Integer |
|
min_replicas |
否 |
Integer |
|
max_replicas |
否 |
Integer |
|
initial_replicas |
否 |
Integer |
|
upscale_delay_s |
否 |
Integer |
|
downscale_delay_s |
否 |
Integer |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
working_dir |
否 |
String |
|
env_vars |
否 |
Map<String,String> |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
head_group_spec |
是 |
HeadGroupSpecV2 object |
|
worker_group_specs |
是 |
Array of WorkerGroupSpecV2 objects |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
limits |
否 |
ResourceSpec object |
|
requests |
否 |
ResourceSpec object |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
否 |
String |
|
min_replicas |
否 |
Integer |
|
max_replicas |
否 |
Integer |
|
limits |
否 |
ResourceSpec object |
|
requests |
否 |
ResourceSpec object |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
lts |
否 |
RayServiceLogLtsConfig object |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
enabled |
否 |
Boolean |
|
log_group_id |
否 |
String |
|
log_stream_id |
否 |
String |
|
响应参数
状态码:400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:401
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:408
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:500
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
请求示例
更新端点。具体更新信息如下样例所示。
PUT https://{endpoint}/v1/workspaces/{workspace_id}/endpoints/{endpoint_id} { "name" : "endpoint1", "description" : "description", "reserved_resource" : { "apu" : { "spec_code" : "dpu.d1x", "warm_up_num" : 1, "max_num" : 100 }, "dpu" : { "spec_code" : "dpu.d1x", "warm_up_num" : 1, "max_num" : 100, "use_public_resource" : false }, "mu" : { "spec_code" : "string", "min" : 0, "max" : 1 } }, "ray_resource" : { "head_node_resource" : { "spec_code" : "string" }, "work_node_resources" : [ { "name" : "cpuGroup1", "resource" : { "spec_code" : "string", "min" : 0, "max" : 1 } } ] }, "cap" : { "cap_id" : "0b5633ba2b904511ad514346f4d23d4b", "version_id" : "0b5633ba2b904511ad514346f4d23d4b" }, "config" : { "ray_service_config" : { "ray_serve_config" : { "applications" : [ { "name" : "string", "import_path" : "string", "deployments" : [ { "name" : "string", "ray_actor_options" : { "num_cpus" : 0, "memory" : 0, "resources" : "string" }, "autoscaling_config" : { "target_ongoing_requests" : 1000, "max_ongoing_requests" : 1000, "min_replicas" : 1000, "max_replicas" : 1000, "initial_replicas" : 1000, "upscale_delay_s" : 86400, "downscale_delay_s" : 86400 }, "num_replicas" : 1000, "user_config" : { }, "max_replicas_per_node" : 1 } ], "runtime_env" : { "working_dir" : "string", "env_vars" : { "additionalProp1" : "string", "additionalProp2" : "string", "additionalProp3" : "string" } }, "route_prefix" : "string" } ] }, "ray_cluster_config" : { "head_group_spec" : { "limits" : { "spec_code" : "string" }, "requests" : { "spec_code" : "string" } }, "worker_group_specs" : [ { "name" : "string", "min_replicas" : 10000, "max_replicas" : 10000, "limits" : { "spec_code" : "string" }, "requests" : { "spec_code" : "string" } } ] }, "data_infos" : [ { "input_path" : "OBS://bucket/dir/" } ] } } }
响应示例
状态码:202
查询endpoint详情的响应。
{ "visibility" : "PRIVATE", "id" : "0b5633ba2b904511ad514346f4d23d4b", "name" : "endpoint1", "type" : "job", "status" : "CREATING", "description" : "description", "create_time" : "2023-05-30T12:24:30.401Z", "update_time" : "2023-05-30T12:24:30.401Z", "owner" : { "domain_name" : "string", "domain_id" : "0b5633ba2b904511ad514346f4d23d4b", "user_name" : "string", "user_id" : "0b5633ba2b904511ad514346f4d23d4b" }, "cap" : { "cap_id" : "0b5633ba2b904511ad514346f4d23d4b", "version_id" : "0b5633ba2b904511ad514346f4d23d4b" }, "reserved_resource" : { "apu" : { "spec_code" : "dpu.d1x", "warm_up_num" : 1, "max_num" : 100 }, "dpu" : { "spec_code" : "dpu.d1x", "warm_up_num" : 1, "max_num" : 100, "use_public_resource" : false }, "mu" : { "spec_code" : "string", "min" : 0, "max" : 1 } }, "ray_resource" : { "head_group_spec" : { "spec_code" : "string" }, "worker_group_spec" : [ { "name" : "string", "spec_code" : "string", "min_replicas" : 10000, "max_replicas" : 10000 } ] }, "caches" : [ { "mnt_path" : "string", "cache_ins_id" : "string" } ], "error_code" : "string", "error_msg" : "string", "urls" : [ { "name" : "string", "address" : "string", "type" : "PRIVATE", "token" : "string" } ], "business_engine_instance_ids" : [ "string" ], "tokens_quota" : { "total" : 0, "used" : 0, "expire_time" : "2025-01-17T07:30:35.677Z" }, "runtime_env_type" : "RELEASE", "config" : { "ray_service_config" : { "ray_serve_config" : { "applications" : [ { "name" : "string", "import_path" : "string", "deployments" : [ { "name" : "string", "ray_actor_options" : { "num_cpus" : 0, "memory" : 0, "resources" : "string" }, "autoscaling_config" : { "target_ongoing_requests" : 1000, "max_ongoing_requests" : 1000, "min_replicas" : 1000, "max_replicas" : 1000, "initial_replicas" : 1000, "upscale_delay_s" : 86400, "downscale_delay_s" : 86400 }, "num_replicas" : 1000, "user_config" : { }, "max_replicas_per_node" : "" } ], "runtime_env" : { "working_dir" : "string", "env_vars" : { "additionalProp1" : "string", "additionalProp2" : "string", "additionalProp3" : "string" } }, "route_prefix" : "string" } ] }, "ray_cluster_config" : { "head_group_spec" : { "limits" : { "spec_code" : "string" }, "requests" : { "spec_code" : "string" } }, "worker_group_specs" : [ { "name" : "string", "min_replicas" : 10000, "max_replicas" : 10000, "limits" : { "spec_code" : "string" }, "requests" : { "spec_code" : "string" } } ] }, "data_infos" : [ { "input_path" : "OBS://bucket/dir/", "output_path" : "OBS://bucket/dir/", "env_var_name" : "string" } ] } } }
状态码:400
BadRequest
{ "error_code" : "common.01000001", "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException" }
状态码:401
Unauthorized
{ "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" }
状态码:403
Forbidden
{ "error" : { "code" : "403", "message" : "X-Auth-Token is invalid in the request", "title" : "Forbidden" }, "error_code" : 403, "error_msg" : "X-Auth-Token is invalid in the request", "title" : "Forbidden" }
状态码:408
Request Time-out
{ "error_code" : "common.00000408", "error_msg" : "timeout exception occurred" }
状态码:500
InternalServerError
{ "error_code" : "common.00000500", "error_msg" : "internal error" }
状态码
状态码 |
描述 |
---|---|
202 |
查询endpoint详情的响应。 |
400 |
BadRequest |
401 |
Unauthorized |
403 |
Forbidden |
408 |
Request Time-out |
500 |
InternalServerError |
错误码
请参见错误码。