创建Endpoint
功能介绍
创建Endpoint。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
POST https://localhost.com/v1/workspaces/{workspace_id}/endpoints
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
workspace_id |
是 |
String |
|
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
否 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
是 |
String |
|
description |
否 |
String |
|
type |
是 |
String |
|
reserved_resource |
否 |
ReservedResource object |
通用预留资源。 |
ray_resource |
否 |
RayResourceInput object |
创建Ray集群的资源配置。 |
cap |
否 |
CapRef object |
CAP信息。 |
log_config |
否 |
LogConfig object |
Ray日志配置。 |
config |
否 |
EndpointConfig object |
端点的配置 |
cache_list |
否 |
Array of CacheConfig objects |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
apu |
否 |
ResourceDef object |
资源定义信息。 |
dpu |
否 |
ResourceDef object |
资源定义信息。 |
mu |
否 |
ResourceDemand object |
资源需求量配置。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
spec_code |
是 |
String |
|
warm_up_num |
是 |
Integer |
预热资源量。 |
max_num |
否 |
Integer |
最大资源量,不填默认为预热资源量,即不使用弹性资源。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
head_node_resource |
是 |
HeadNodeResourceDemand object |
headNode资源需求量配置。 |
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 |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
enable_lts_log |
否 |
Boolean |
是否开启日志并记录到LTS,默认不开启。 |
enable_obs_log |
否 |
Boolean |
|
obs_path |
否 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
ray_serve_config |
是 |
RayServeConfig object |
RayServe配置 |
ray_cluster_config |
是 |
RayClusterConfig object |
Ray集群配置 |
data_infos |
否 |
Array of DataBriefInfo objects |
数据信息 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
是 |
String |
|
import_path |
是 |
String |
|
deployments |
是 |
Array of Deployment objects |
Deployment列表 |
runtime_env |
是 |
ServeRuntimeEnv object |
Serve的运行时环境配置,可选参数有:working_dir:代码将在其中运行的工作目录。必须是远程URI,如s3或本地路径;env_vars:要设置的环境变量。 |
route_prefix |
否 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
否 |
String |
|
ray_actor_options |
否 |
RayActorOptions object |
RayActor配置 |
autoscaling_config |
否 |
AutoscalingConfig object |
自动扩缩的配置 |
num_replicas |
否 |
Integer |
副本数量 |
user_config |
否 |
Object |
用户自定义配置 |
max_replicas_per_node |
否 |
Integer |
每个节点允许的最大副本数 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
num_cpus |
否 |
Double |
CPU数量 |
memory |
否 |
Double |
内存数量 |
resources |
否 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
target_num_ongoing_requests_per_replica |
否 |
Integer |
每个副本单位时间能提供的平均请求数 |
max_concurrent_queries |
否 |
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 |
HeadGroup的配置 |
worker_group_specs |
是 |
Array of WorkerGroupSpecV2 objects |
Worker Group的配置 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
limits |
否 |
ResourceSpec object |
资源限制 |
requests |
否 |
ResourceSpec object |
要求最小资源数 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
name |
否 |
String |
|
min_replicas |
否 |
Integer |
最小副本数。 |
max_replicas |
否 |
Integer |
最大副本数。 |
limits |
否 |
ResourceSpec object |
资源限制 |
requests |
否 |
ResourceSpec object |
最小资源数 |
响应参数
状态码: 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 |
|
请求示例
无
响应示例
无
状态码
状态码 |
描述 |
---|---|
202 |
Accepted |
400 |
BadRequest |
401 |
Unauthorized |
403 |
Forbidden |
408 |
Request Time-out |
500 |
InternalServerError |
错误码
请参见错误码。