> For the complete documentation index, see [llms.txt](https://docs.yottalabs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yottalabs.ai/api-and-sdk/api-reference-v2/serverless.md).

# Serverless

## Create Endpoint

> Create a new endpoint

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless":{"post":{"summary":"Create Endpoint","deprecated":false,"description":"Create a new endpoint","operationId":"createEndpoint","tags":["API v2","Serverless v2"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElasticV2CreateRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2Response"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Endpoint created successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2Response"}}},"headers":{}},"10001":{"description":"Invalid request parameters","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ElasticV2CreateRequest":{"type":"object","description":"Elastic Endpoint Create Request v2","properties":{"name":{"type":"string","description":"Deployment name","minLength":1,"pattern":"^(?=[A-Za-z])[A-Za-z0-9@._-]{1,20}$"},"imageRegistry":{"type":"string","description":"Docker registry URL","maxLength":255,"minLength":0},"image":{"type":"string","description":"Docker image name","maxLength":255,"minLength":1},"resources":{"type":"array","description":"GPU resources","items":{"$ref":"#/components/schemas/OpenapiElasticResource"},"minItems":1},"minSingleCardVramInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card VRAM in GB","maximum":1536,"minimum":0},"minSingleCardVcpu":{"type":"integer","format":"int32","description":"Minimum GPU single card vCPU count"},"minSingleCardRamInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card RAM in GB","maximum":1536,"minimum":0},"workers":{"type":"integer","format":"int32","description":"Number of workers when auto scaling is disabled. Required when auto scaling is disabled; must be omitted when auto scaling is enabled","minimum":0},"autoScaling":{"$ref":"#/components/schemas/OpenapiElasticAutoScalingConfig","description":"Auto scaling configuration"},"credentialId":{"type":"integer","format":"int64","description":"Credential ID"},"containerVolumeInGb":{"type":"integer","format":"int32","description":"Container volume in GB","minimum":20},"initializationCommand":{"type":"string","description":"Initialization command"},"envVars":{"type":"array","description":"Environment variables","items":{"$ref":"#/components/schemas/KeyValuePairDTO"}},"expose":{"$ref":"#/components/schemas/ElasticV2ExposePort","description":"Exposed port"},"serviceMode":{"type":"string","description":"Service mode: ALB, QUEUE, CUSTOM","minLength":1},"webhook":{"type":"string","description":"Webhook URL for receiving task results","maxLength":512,"minLength":0,"pattern":"^https?://.*"},"fallbackModeEnabled":{"type":"boolean","description":"Enable fallback mode (stop-then-start) during rolling update"},"fallbackTimeoutSec":{"type":"integer","format":"int32","description":"Fallback timeout in seconds (1-3600); recorded even when fallback mode is off","maximum":3600,"minimum":1}},"required":["containerVolumeInGb","image","name","resources","serviceMode"]},"OpenapiElasticResource":{"type":"object","properties":{"region":{"type":"string","description":"Region","minLength":1},"gpuType":{"type":"string","description":"GPU Type","minLength":1},"gpuCount":{"type":"integer","format":"int32","description":"GPU Count"}},"required":["gpuCount","gpuType","region"]},"OpenapiElasticAutoScalingConfig":{"type":"object","description":"Elastic auto scaling configuration","properties":{"enabled":{"type":"boolean","description":"Whether auto scaling is enabled"},"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers when auto scaling is enabled","minimum":0},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers when auto scaling is enabled","minimum":1},"maxQueuedTasksPerWorker":{"type":"integer","format":"int32","description":"Maximum queued tasks assigned per worker","maximum":1000,"minimum":1},"scaleOutEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-out evaluation period in seconds","maximum":3600,"minimum":1},"scaleInEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-in evaluation period in seconds","maximum":3600,"minimum":1}}},"KeyValuePairDTO":{"type":"object","description":"KeyValuePairDTO","properties":{"key":{"type":"string","description":"key","minLength":1},"value":{"type":"string","description":"value","minLength":1}},"required":["key","value"]},"ElasticV2ExposePort":{"type":"object","description":"Exposed port configuration v2","properties":{"port":{"type":"integer","format":"int32","description":"Container port number","maximum":65535,"minimum":1},"protocol":{"type":"string","description":"Protocol type"}},"required":["port","protocol"]},"ResultElasticV2Response":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/ElasticV2Response","description":"data"}}},"ElasticV2Response":{"type":"object","description":"Elastic Endpoint Response v2","properties":{"id":{"type":"integer","format":"int64","description":"Deployment ID"},"name":{"type":"string","description":"Deployment name"},"creator":{"type":"string","description":"Creator email"},"domain":{"type":"string","description":"Custom domain"},"imageRegistry":{"type":"string","description":"Docker registry URL"},"image":{"type":"string","description":"Docker image name"},"resources":{"type":"array","description":"GPU resources","items":{"$ref":"#/components/schemas/OpenapiElasticResourceResponse"}},"minSingleCardVramInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card VRAM in GB"},"minSingleCardVcpu":{"type":"integer","format":"int32","description":"Minimum GPU single card vCPU count"},"minSingleCardRamInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card RAM in GB"},"credentialId":{"type":"integer","format":"int64","description":"Credential ID"},"containerVolumeInGb":{"type":"integer","format":"int32","description":"Container volume in GB"},"initializationCommand":{"type":"string","description":"Initialization command"},"environmentVars":{"type":"array","description":"Environment variables","items":{"$ref":"#/components/schemas/KeyValuePairDTO"}},"expose":{"$ref":"#/components/schemas/OpenapiExposePortResponse","description":"Exposed port"},"totalWorkers":{"type":"integer","format":"int32","description":"Total workers"},"workers":{"type":"integer","format":"int32","description":"Fixed-mode worker count; null when auto scaling is enabled"},"workerScale":{"$ref":"#/components/schemas/OpenapiElasticWorkerScaleResponse","description":"Worker scale range"},"autoScaling":{"$ref":"#/components/schemas/OpenapiElasticAutoScalingResponse","description":"Auto scaling configuration"},"runningWorkers":{"type":"integer","format":"int32","description":"Running workers"},"cost":{"type":"number","description":"Accumulated cost"},"perSecondPrice":{"type":"number","description":"Per-second price"},"perHourPrice":{"type":"number","description":"Per-hour price"},"serviceMode":{"type":"string","description":"Service mode","enum":["ALB","QUEUE","CUSTOM"]},"webhook":{"type":"string","description":"Webhook URL"},"status":{"type":"string","description":"Deployment status","enum":["INITIALIZING","RUNNING","STOPPING","STOPPED","FAILED","ROLLING_UPDATING"]},"updateResult":{"$ref":"#/components/schemas/ElasticV2UpdateResult","description":"Execution metadata, populated by PATCH / rollback"},"currentVersionNo":{"type":"string","description":"Current config version number, e.g. v2"},"rollingUpdate":{"$ref":"#/components/schemas/ElasticV2RollingUpdateSummary","description":"Active rolling update status; null when no active plan"}}},"OpenapiElasticResourceResponse":{"type":"object","description":"ElasticResource","properties":{"region":{"type":"string","description":"Region"},"regionDisplayName":{"type":"string","description":"Region Display Name"},"gpuType":{"type":"string","description":"GPU Type"},"gpuDisplayName":{"type":"string","description":"GPU DisplayName"},"gpuCount":{"type":"integer","format":"int32","description":"GPU Count"},"singleCardVramInGb":{"type":"integer","format":"int32","description":"GPU Single Card VRAM(GB)"},"singleCardVcpu":{"type":"integer","format":"int32","description":"GPU Single Card VCPU"},"singleCardRamInGb":{"type":"integer","format":"int32","description":"GPU Single Card RAM(GB)"}}},"OpenapiExposePortResponse":{"type":"object","description":"ElasticExpose","properties":{"port":{"type":"integer","format":"int32","description":"port"},"protocol":{"type":"string","description":"protocol"}}},"OpenapiElasticWorkerScaleResponse":{"type":"object","description":"Elastic worker scale range","properties":{"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers"}}},"OpenapiElasticAutoScalingResponse":{"type":"object","description":"Elastic auto scaling configuration","properties":{"enabled":{"type":"boolean","description":"Whether auto scaling is enabled"},"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers when auto scaling is enabled"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers when auto scaling is enabled"},"maxQueuedTasksPerWorker":{"type":"integer","format":"int32","description":"Maximum queued tasks assigned per worker"},"scaleOutEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-out evaluation period in seconds"},"scaleInEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-in evaluation period in seconds"}}},"ElasticV2UpdateResult":{"type":"object","description":"Elastic Endpoint Update Result v2","properties":{"requiresRolling":{"type":"boolean","description":"Whether the update started a rolling replacement"},"applied":{"type":"boolean","description":"Whether the update was fully applied synchronously"},"planId":{"type":"string","description":"Rolling plan id when requiresRolling is true"}}},"ElasticV2RollingUpdateSummary":{"type":"object","description":"Elastic rolling update summary v2","properties":{"status":{"type":"string","description":"Plan status: Updating/Stopped/..."},"progressX":{"type":"integer","format":"int32","description":"Progress X (matched and running replacement workers)"},"progressY":{"type":"integer","format":"int32","description":"Progress Y (target workers to replace)"},"planId":{"type":"string","description":"Plan id"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Submit Task

> Submit a task to a QUEUE-mode endpoint

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/tasks":{"post":{"summary":"Submit Task","deprecated":false,"description":"Submit a task to a QUEUE-mode endpoint","operationId":"submitTask","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElasticV2SubmitTaskRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2SubmitTaskResponse"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Task submitted successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2SubmitTaskResponse"}}},"headers":{}},"10001":{"description":"Invalid request or non-QUEUE endpoint","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24000":{"description":"Serverless unavailable","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ElasticV2SubmitTaskRequest":{"type":"object","description":"Elastic Endpoint Submit Task Request v2","properties":{"taskId":{"type":"string","description":"User-defined task ID. Auto-generated UUID if omitted","maxLength":255,"minLength":0,"pattern":"^[A-Za-z0-9_]*$"},"input":{"description":"Task input data"},"workerPort":{"type":"integer","format":"int32","description":"Worker port (1-65535)","maximum":65535,"minimum":1},"processUri":{"type":"string","description":"Process URI on the worker","maxLength":255,"minLength":0},"webhook":{"type":"string","description":"Webhook URL for result delivery","maxLength":512,"minLength":0,"pattern":"^https?://.*"},"webhookAuthKey":{"type":"string","description":"Webhook authentication key","maxLength":255,"minLength":0},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Headers to forward with the task request","properties":{}}},"required":["input","processUri","workerPort"]},"ResultElasticV2SubmitTaskResponse":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/ElasticV2SubmitTaskResponse","description":"data"}}},"ElasticV2SubmitTaskResponse":{"type":"object","description":"Elastic Endpoint Submit Task Response v2","properties":{"taskId":{"type":"string","description":"Task identifier"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Start Endpoint

> Start or resume a stopped endpoint

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/start":{"post":{"summary":"Start Endpoint","deprecated":false,"description":"Start or resume a stopped endpoint","operationId":"startEndpoint","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Endpoint started","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultVoid":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Stop Endpoint

> Stop a running endpoint

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/stop":{"post":{"summary":"Stop Endpoint","deprecated":false,"description":"Stop a running endpoint","operationId":"stopEndpoint","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Endpoint stopped","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultVoid":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Delete Endpoint

> Delete an endpoint

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}":{"delete":{"summary":"Delete Endpoint","deprecated":false,"description":"Delete an endpoint","operationId":"deleteEndpoint","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Endpoint deleted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultVoid":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Get Endpoint

> Get details of a specific endpoint

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}":{"get":{"summary":"Get Endpoint","deprecated":false,"description":"Get details of a specific endpoint","operationId":"getEndpoint","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2Response"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Endpoint found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2Response"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultElasticV2Response":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/ElasticV2Response","description":"data"}}},"ElasticV2Response":{"type":"object","description":"Elastic Endpoint Response v2","properties":{"id":{"type":"integer","format":"int64","description":"Deployment ID"},"name":{"type":"string","description":"Deployment name"},"creator":{"type":"string","description":"Creator email"},"domain":{"type":"string","description":"Custom domain"},"imageRegistry":{"type":"string","description":"Docker registry URL"},"image":{"type":"string","description":"Docker image name"},"resources":{"type":"array","description":"GPU resources","items":{"$ref":"#/components/schemas/OpenapiElasticResourceResponse"}},"minSingleCardVramInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card VRAM in GB"},"minSingleCardVcpu":{"type":"integer","format":"int32","description":"Minimum GPU single card vCPU count"},"minSingleCardRamInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card RAM in GB"},"credentialId":{"type":"integer","format":"int64","description":"Credential ID"},"containerVolumeInGb":{"type":"integer","format":"int32","description":"Container volume in GB"},"initializationCommand":{"type":"string","description":"Initialization command"},"environmentVars":{"type":"array","description":"Environment variables","items":{"$ref":"#/components/schemas/KeyValuePairDTO"}},"expose":{"$ref":"#/components/schemas/OpenapiExposePortResponse","description":"Exposed port"},"totalWorkers":{"type":"integer","format":"int32","description":"Total workers"},"workers":{"type":"integer","format":"int32","description":"Fixed-mode worker count; null when auto scaling is enabled"},"workerScale":{"$ref":"#/components/schemas/OpenapiElasticWorkerScaleResponse","description":"Worker scale range"},"autoScaling":{"$ref":"#/components/schemas/OpenapiElasticAutoScalingResponse","description":"Auto scaling configuration"},"runningWorkers":{"type":"integer","format":"int32","description":"Running workers"},"cost":{"type":"number","description":"Accumulated cost"},"perSecondPrice":{"type":"number","description":"Per-second price"},"perHourPrice":{"type":"number","description":"Per-hour price"},"serviceMode":{"type":"string","description":"Service mode","enum":["ALB","QUEUE","CUSTOM"]},"webhook":{"type":"string","description":"Webhook URL"},"status":{"type":"string","description":"Deployment status","enum":["INITIALIZING","RUNNING","STOPPING","STOPPED","FAILED","ROLLING_UPDATING"]},"updateResult":{"$ref":"#/components/schemas/ElasticV2UpdateResult","description":"Execution metadata, populated by PATCH / rollback"},"currentVersionNo":{"type":"string","description":"Current config version number, e.g. v2"},"rollingUpdate":{"$ref":"#/components/schemas/ElasticV2RollingUpdateSummary","description":"Active rolling update status; null when no active plan"}}},"OpenapiElasticResourceResponse":{"type":"object","description":"ElasticResource","properties":{"region":{"type":"string","description":"Region"},"regionDisplayName":{"type":"string","description":"Region Display Name"},"gpuType":{"type":"string","description":"GPU Type"},"gpuDisplayName":{"type":"string","description":"GPU DisplayName"},"gpuCount":{"type":"integer","format":"int32","description":"GPU Count"},"singleCardVramInGb":{"type":"integer","format":"int32","description":"GPU Single Card VRAM(GB)"},"singleCardVcpu":{"type":"integer","format":"int32","description":"GPU Single Card VCPU"},"singleCardRamInGb":{"type":"integer","format":"int32","description":"GPU Single Card RAM(GB)"}}},"KeyValuePairDTO":{"type":"object","description":"KeyValuePairDTO","properties":{"key":{"type":"string","description":"key","minLength":1},"value":{"type":"string","description":"value","minLength":1}},"required":["key","value"]},"OpenapiExposePortResponse":{"type":"object","description":"ElasticExpose","properties":{"port":{"type":"integer","format":"int32","description":"port"},"protocol":{"type":"string","description":"protocol"}}},"OpenapiElasticWorkerScaleResponse":{"type":"object","description":"Elastic worker scale range","properties":{"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers"}}},"OpenapiElasticAutoScalingResponse":{"type":"object","description":"Elastic auto scaling configuration","properties":{"enabled":{"type":"boolean","description":"Whether auto scaling is enabled"},"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers when auto scaling is enabled"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers when auto scaling is enabled"},"maxQueuedTasksPerWorker":{"type":"integer","format":"int32","description":"Maximum queued tasks assigned per worker"},"scaleOutEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-out evaluation period in seconds"},"scaleInEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-in evaluation period in seconds"}}},"ElasticV2UpdateResult":{"type":"object","description":"Elastic Endpoint Update Result v2","properties":{"requiresRolling":{"type":"boolean","description":"Whether the update started a rolling replacement"},"applied":{"type":"boolean","description":"Whether the update was fully applied synchronously"},"planId":{"type":"string","description":"Rolling plan id when requiresRolling is true"}}},"ElasticV2RollingUpdateSummary":{"type":"object","description":"Elastic rolling update summary v2","properties":{"status":{"type":"string","description":"Plan status: Updating/Stopped/..."},"progressX":{"type":"integer","format":"int32","description":"Progress X (matched and running replacement workers)"},"progressY":{"type":"integer","format":"int32","description":"Progress Y (target workers to replace)"},"planId":{"type":"string","description":"Plan id"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## List Tasks

> Get all tasks of a QUEUE-mode endpoint

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/tasks":{"get":{"summary":"List Tasks","deprecated":false,"description":"Get all tasks of a QUEUE-mode endpoint","operationId":"listTasks","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"status","in":"query","description":"Filter by status: PROCESSING, DELIVERED, SUCCESS, FAILED","required":false,"schema":{"type":"string"}},{"name":"pageNumber","in":"query","description":"","required":false,"schema":{"type":"integer","format":"int32","default":1}},{"name":"pageSize","in":"query","description":"","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultV2PageResponseElasticV2TaskResponse"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultV2PageResponseElasticV2TaskResponse"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24000":{"description":"Serverless unavailable","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultV2PageResponseElasticV2TaskResponse":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/V2PageResponseElasticV2TaskResponse","description":"data"}}},"V2PageResponseElasticV2TaskResponse":{"type":"object","description":"Paginated Response","properties":{"items":{"type":"array","description":"List of items in the current page","items":{"$ref":"#/components/schemas/ElasticV2TaskResponse"}},"page":{"type":"integer","format":"int64","description":"Current page number (1-based)"},"size":{"type":"integer","format":"int64","description":"Number of items per page"},"total":{"type":"integer","format":"int64","description":"Total number of items across all pages"},"pages":{"type":"integer","format":"int64","description":"Total number of pages"}}},"ElasticV2TaskResponse":{"type":"object","description":"Elastic Endpoint Task Response v2","properties":{"taskId":{"type":"string","description":"Unique task identifier"},"endpointId":{"type":"integer","format":"int64","description":"Parent endpoint ID"},"endpointName":{"type":"string","description":"Parent endpoint name"},"status":{"type":"string","description":"Task execution status: PROCESSING, DELIVERED, SUCCESS, FAILED"},"workerUrl":{"type":"string","description":"Worker URL processing this task"},"webhook":{"type":"string","description":"Webhook URL for result delivery"},"deliveryStatus":{"type":"string","description":"Webhook delivery status: INIT, SUCCESS, FAILED, MAX_RETRIES_EXCEEDED"},"deliveryAttempts":{"type":"integer","format":"int32","description":"Number of delivery attempts"},"error":{"type":"string","description":"Error message if failed"},"createdAt":{"type":"integer","format":"int64","description":"Task creation time (epoch milliseconds)"},"deliveredAt":{"type":"integer","format":"int64","description":"Webhook delivery time (epoch milliseconds)"},"updatedAt":{"type":"integer","format":"int64","description":"Last update time (epoch milliseconds)"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## List Endpoints

> Get all elastic endpoints

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless":{"get":{"summary":"List Endpoints","deprecated":false,"description":"Get all elastic endpoints","operationId":"listEndpoints","tags":["API v2","Serverless v2"],"parameters":[{"name":"statusList","in":"query","description":"","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Success, returns list of endpoints","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultListElasticV2Response"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultListElasticV2Response"}}},"headers":{}}}}}},"components":{"schemas":{"ResultListElasticV2Response":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"type":"array","description":"data","items":{"$ref":"#/components/schemas/ElasticV2Response"}}}},"ElasticV2Response":{"type":"object","description":"Elastic Endpoint Response v2","properties":{"id":{"type":"integer","format":"int64","description":"Deployment ID"},"name":{"type":"string","description":"Deployment name"},"creator":{"type":"string","description":"Creator email"},"domain":{"type":"string","description":"Custom domain"},"imageRegistry":{"type":"string","description":"Docker registry URL"},"image":{"type":"string","description":"Docker image name"},"resources":{"type":"array","description":"GPU resources","items":{"$ref":"#/components/schemas/OpenapiElasticResourceResponse"}},"minSingleCardVramInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card VRAM in GB"},"minSingleCardVcpu":{"type":"integer","format":"int32","description":"Minimum GPU single card vCPU count"},"minSingleCardRamInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card RAM in GB"},"credentialId":{"type":"integer","format":"int64","description":"Credential ID"},"containerVolumeInGb":{"type":"integer","format":"int32","description":"Container volume in GB"},"initializationCommand":{"type":"string","description":"Initialization command"},"environmentVars":{"type":"array","description":"Environment variables","items":{"$ref":"#/components/schemas/KeyValuePairDTO"}},"expose":{"$ref":"#/components/schemas/OpenapiExposePortResponse","description":"Exposed port"},"totalWorkers":{"type":"integer","format":"int32","description":"Total workers"},"workers":{"type":"integer","format":"int32","description":"Fixed-mode worker count; null when auto scaling is enabled"},"workerScale":{"$ref":"#/components/schemas/OpenapiElasticWorkerScaleResponse","description":"Worker scale range"},"autoScaling":{"$ref":"#/components/schemas/OpenapiElasticAutoScalingResponse","description":"Auto scaling configuration"},"runningWorkers":{"type":"integer","format":"int32","description":"Running workers"},"cost":{"type":"number","description":"Accumulated cost"},"perSecondPrice":{"type":"number","description":"Per-second price"},"perHourPrice":{"type":"number","description":"Per-hour price"},"serviceMode":{"type":"string","description":"Service mode","enum":["ALB","QUEUE","CUSTOM"]},"webhook":{"type":"string","description":"Webhook URL"},"status":{"type":"string","description":"Deployment status","enum":["INITIALIZING","RUNNING","STOPPING","STOPPED","FAILED","ROLLING_UPDATING"]},"updateResult":{"$ref":"#/components/schemas/ElasticV2UpdateResult","description":"Execution metadata, populated by PATCH / rollback"},"currentVersionNo":{"type":"string","description":"Current config version number, e.g. v2"},"rollingUpdate":{"$ref":"#/components/schemas/ElasticV2RollingUpdateSummary","description":"Active rolling update status; null when no active plan"}}},"OpenapiElasticResourceResponse":{"type":"object","description":"ElasticResource","properties":{"region":{"type":"string","description":"Region"},"regionDisplayName":{"type":"string","description":"Region Display Name"},"gpuType":{"type":"string","description":"GPU Type"},"gpuDisplayName":{"type":"string","description":"GPU DisplayName"},"gpuCount":{"type":"integer","format":"int32","description":"GPU Count"},"singleCardVramInGb":{"type":"integer","format":"int32","description":"GPU Single Card VRAM(GB)"},"singleCardVcpu":{"type":"integer","format":"int32","description":"GPU Single Card VCPU"},"singleCardRamInGb":{"type":"integer","format":"int32","description":"GPU Single Card RAM(GB)"}}},"KeyValuePairDTO":{"type":"object","description":"KeyValuePairDTO","properties":{"key":{"type":"string","description":"key","minLength":1},"value":{"type":"string","description":"value","minLength":1}},"required":["key","value"]},"OpenapiExposePortResponse":{"type":"object","description":"ElasticExpose","properties":{"port":{"type":"integer","format":"int32","description":"port"},"protocol":{"type":"string","description":"protocol"}}},"OpenapiElasticWorkerScaleResponse":{"type":"object","description":"Elastic worker scale range","properties":{"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers"}}},"OpenapiElasticAutoScalingResponse":{"type":"object","description":"Elastic auto scaling configuration","properties":{"enabled":{"type":"boolean","description":"Whether auto scaling is enabled"},"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers when auto scaling is enabled"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers when auto scaling is enabled"},"maxQueuedTasksPerWorker":{"type":"integer","format":"int32","description":"Maximum queued tasks assigned per worker"},"scaleOutEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-out evaluation period in seconds"},"scaleInEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-in evaluation period in seconds"}}},"ElasticV2UpdateResult":{"type":"object","description":"Elastic Endpoint Update Result v2","properties":{"requiresRolling":{"type":"boolean","description":"Whether the update started a rolling replacement"},"applied":{"type":"boolean","description":"Whether the update was fully applied synchronously"},"planId":{"type":"string","description":"Rolling plan id when requiresRolling is true"}}},"ElasticV2RollingUpdateSummary":{"type":"object","description":"Elastic rolling update summary v2","properties":{"status":{"type":"string","description":"Plan status: Updating/Stopped/..."},"progressX":{"type":"integer","format":"int32","description":"Progress X (matched and running replacement workers)"},"progressY":{"type":"integer","format":"int32","description":"Progress Y (target workers to replace)"},"planId":{"type":"string","description":"Plan id"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Scale Workers

> Scale the number of workers for an endpoint

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/workers":{"put":{"summary":"Scale Workers","deprecated":false,"description":"Scale the number of workers for an endpoint","operationId":"scaleWorkers","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"count","in":"query","description":"Target number of workers. Required when auto scaling is disabled; not allowed when auto scaling is enabled","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"minWorkers","in":"query","description":"Minimum workers. Required when auto scaling is enabled and must be less than maxWorkers; not allowed when auto scaling is disabled","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"maxWorkers","in":"query","description":"Maximum workers. Required when auto scaling is enabled; not allowed when auto scaling is disabled","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"enabled","in":"query","description":"Enable or disable auto scaling. When omitted, the current auto scaling setting of the endpoint is kept. Auto scaling is only supported for QUEUE endpoints","required":false,"schema":{"type":"boolean"}},{"name":"maxQueuedTasksPerWorker","in":"query","description":"Maximum queued tasks assigned per worker. Required when enabled is true","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"scaleOutEvaluationPeriodSec","in":"query","description":"Scale-out evaluation period in seconds. Required when enabled is true","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"scaleInEvaluationPeriodSec","in":"query","description":"Scale-in evaluation period in seconds. Required when enabled is true","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Workers scaled","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"10001":{"description":"Invalid request parameters","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24002":{"description":"Serverless action not allowed in the current endpoint status","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24012":{"description":"A rolling update is in progress, this operation is not allowed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24018":{"description":"No Changes Detected: The configuration is unchanged. No update is required.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultVoid":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Get Task

> Get details of a specific task

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/tasks/{taskId}":{"get":{"summary":"Get Task","deprecated":false,"description":"Get details of a specific task","operationId":"getTask","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"taskId","in":"path","description":"","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2TaskDetailResponse"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Task found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2TaskDetailResponse"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24000":{"description":"Serverless unavailable","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24011":{"description":"Task does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultElasticV2TaskDetailResponse":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/ElasticV2TaskDetailResponse","description":"data"}}},"ElasticV2TaskDetailResponse":{"type":"object","description":"Elastic Endpoint Task Detail Response v2","properties":{"taskId":{"type":"string","description":"Unique task identifier"},"endpointId":{"type":"integer","format":"int64","description":"Parent endpoint ID"},"endpointName":{"type":"string","description":"Parent endpoint name"},"status":{"type":"string","description":"Task execution status: PROCESSING, DELIVERED, SUCCESS, FAILED"},"workerUrl":{"type":"string","description":"Worker URL processing this task"},"webhook":{"type":"string","description":"Webhook URL for result delivery"},"deliveryStatus":{"type":"string","description":"Webhook delivery status: INIT, SUCCESS, FAILED, MAX_RETRIES_EXCEEDED"},"deliveryAttempts":{"type":"integer","format":"int32","description":"Number of delivery attempts"},"error":{"type":"string","description":"Error message if failed"},"input":{"description":"Task input data"},"output":{"description":"Task output/result data"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Headers forwarded with the task request","properties":{}},"createdAt":{"type":"integer","format":"int64","description":"Task creation time (epoch milliseconds)"},"updatedAt":{"type":"integer","format":"int64","description":"Last update time (epoch milliseconds)"},"deliveredAt":{"type":"integer","format":"int64","description":"Webhook delivery time (epoch milliseconds)"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Update Endpoint

> Update a specific endpoint

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}":{"patch":{"summary":"Update Endpoint","deprecated":false,"description":"Update a specific endpoint","operationId":"updateEndpoint","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ElasticV2UpdateRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2Response"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Endpoint updated successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2Response"}}},"headers":{}},"10001":{"description":"Invalid request parameters","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24002":{"description":"Serverless action not allowed in the current endpoint status","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24012":{"description":"A rolling update is in progress, this operation is not allowed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24018":{"description":"No Changes Detected: The configuration is unchanged. No update is required.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ElasticV2UpdateRequest":{"type":"object","description":"Elastic Endpoint Update Request v2","properties":{"name":{"type":"string","description":"Deployment name","minLength":1,"pattern":"^(?=[A-Za-z])[A-Za-z0-9@._-]{1,20}$"},"image":{"type":"string","description":"Container image. Changing it triggers a rolling update","maxLength":255,"minLength":1},"imageRegistry":{"type":"string","description":"Container image registry url"},"resources":{"type":"array","description":"GPU resources","items":{"$ref":"#/components/schemas/OpenapiElasticResource"},"minItems":1},"minSingleCardVramInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card VRAM in GB"},"minSingleCardVcpu":{"type":"integer","format":"int32","description":"Minimum GPU single card vCPU count"},"minSingleCardRamInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card RAM in GB"},"workers":{"type":"integer","format":"int32","description":"Number of workers when auto scaling is disabled. Required when auto scaling is disabled; must be omitted when auto scaling is enabled","minimum":0},"autoScaling":{"$ref":"#/components/schemas/OpenapiElasticAutoScalingConfig","description":"Auto scaling configuration"},"credentialId":{"type":"integer","format":"int64","description":"Credential ID"},"containerVolumeInGb":{"type":"integer","format":"int32","description":"Container volume in GB","minimum":20},"initializationCommand":{"type":"string","description":"Initialization command"},"envVars":{"type":"array","description":"Environment variables","items":{"$ref":"#/components/schemas/KeyValuePairDTO"}},"expose":{"$ref":"#/components/schemas/ElasticV2ExposePort","description":"Exposed port"},"webhook":{"type":"string","description":"Webhook URL for receiving task results","maxLength":512,"minLength":0,"pattern":"^https?://.*"},"fallbackModeEnabled":{"type":"boolean","description":"Enable fallback mode (stop-then-start) during rolling update"},"fallbackTimeoutSec":{"type":"integer","format":"int32","description":"Fallback timeout in seconds (1-3600); recorded even when fallback mode is off","maximum":3600,"minimum":1}},"required":["containerVolumeInGb","name","resources"]},"OpenapiElasticResource":{"type":"object","properties":{"region":{"type":"string","description":"Region","minLength":1},"gpuType":{"type":"string","description":"GPU Type","minLength":1},"gpuCount":{"type":"integer","format":"int32","description":"GPU Count"}},"required":["gpuCount","gpuType","region"]},"OpenapiElasticAutoScalingConfig":{"type":"object","description":"Elastic auto scaling configuration","properties":{"enabled":{"type":"boolean","description":"Whether auto scaling is enabled"},"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers when auto scaling is enabled","minimum":0},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers when auto scaling is enabled","minimum":1},"maxQueuedTasksPerWorker":{"type":"integer","format":"int32","description":"Maximum queued tasks assigned per worker","maximum":1000,"minimum":1},"scaleOutEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-out evaluation period in seconds","maximum":3600,"minimum":1},"scaleInEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-in evaluation period in seconds","maximum":3600,"minimum":1}}},"KeyValuePairDTO":{"type":"object","description":"KeyValuePairDTO","properties":{"key":{"type":"string","description":"key","minLength":1},"value":{"type":"string","description":"value","minLength":1}},"required":["key","value"]},"ElasticV2ExposePort":{"type":"object","description":"Exposed port configuration v2","properties":{"port":{"type":"integer","format":"int32","description":"Container port number","maximum":65535,"minimum":1},"protocol":{"type":"string","description":"Protocol type"}},"required":["port","protocol"]},"ResultElasticV2Response":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/ElasticV2Response","description":"data"}}},"ElasticV2Response":{"type":"object","description":"Elastic Endpoint Response v2","properties":{"id":{"type":"integer","format":"int64","description":"Deployment ID"},"name":{"type":"string","description":"Deployment name"},"creator":{"type":"string","description":"Creator email"},"domain":{"type":"string","description":"Custom domain"},"imageRegistry":{"type":"string","description":"Docker registry URL"},"image":{"type":"string","description":"Docker image name"},"resources":{"type":"array","description":"GPU resources","items":{"$ref":"#/components/schemas/OpenapiElasticResourceResponse"}},"minSingleCardVramInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card VRAM in GB"},"minSingleCardVcpu":{"type":"integer","format":"int32","description":"Minimum GPU single card vCPU count"},"minSingleCardRamInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card RAM in GB"},"credentialId":{"type":"integer","format":"int64","description":"Credential ID"},"containerVolumeInGb":{"type":"integer","format":"int32","description":"Container volume in GB"},"initializationCommand":{"type":"string","description":"Initialization command"},"environmentVars":{"type":"array","description":"Environment variables","items":{"$ref":"#/components/schemas/KeyValuePairDTO"}},"expose":{"$ref":"#/components/schemas/OpenapiExposePortResponse","description":"Exposed port"},"totalWorkers":{"type":"integer","format":"int32","description":"Total workers"},"workers":{"type":"integer","format":"int32","description":"Fixed-mode worker count; null when auto scaling is enabled"},"workerScale":{"$ref":"#/components/schemas/OpenapiElasticWorkerScaleResponse","description":"Worker scale range"},"autoScaling":{"$ref":"#/components/schemas/OpenapiElasticAutoScalingResponse","description":"Auto scaling configuration"},"runningWorkers":{"type":"integer","format":"int32","description":"Running workers"},"cost":{"type":"number","description":"Accumulated cost"},"perSecondPrice":{"type":"number","description":"Per-second price"},"perHourPrice":{"type":"number","description":"Per-hour price"},"serviceMode":{"type":"string","description":"Service mode","enum":["ALB","QUEUE","CUSTOM"]},"webhook":{"type":"string","description":"Webhook URL"},"status":{"type":"string","description":"Deployment status","enum":["INITIALIZING","RUNNING","STOPPING","STOPPED","FAILED","ROLLING_UPDATING"]},"updateResult":{"$ref":"#/components/schemas/ElasticV2UpdateResult","description":"Execution metadata, populated by PATCH / rollback"},"currentVersionNo":{"type":"string","description":"Current config version number, e.g. v2"},"rollingUpdate":{"$ref":"#/components/schemas/ElasticV2RollingUpdateSummary","description":"Active rolling update status; null when no active plan"}}},"OpenapiElasticResourceResponse":{"type":"object","description":"ElasticResource","properties":{"region":{"type":"string","description":"Region"},"regionDisplayName":{"type":"string","description":"Region Display Name"},"gpuType":{"type":"string","description":"GPU Type"},"gpuDisplayName":{"type":"string","description":"GPU DisplayName"},"gpuCount":{"type":"integer","format":"int32","description":"GPU Count"},"singleCardVramInGb":{"type":"integer","format":"int32","description":"GPU Single Card VRAM(GB)"},"singleCardVcpu":{"type":"integer","format":"int32","description":"GPU Single Card VCPU"},"singleCardRamInGb":{"type":"integer","format":"int32","description":"GPU Single Card RAM(GB)"}}},"OpenapiExposePortResponse":{"type":"object","description":"ElasticExpose","properties":{"port":{"type":"integer","format":"int32","description":"port"},"protocol":{"type":"string","description":"protocol"}}},"OpenapiElasticWorkerScaleResponse":{"type":"object","description":"Elastic worker scale range","properties":{"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers"}}},"OpenapiElasticAutoScalingResponse":{"type":"object","description":"Elastic auto scaling configuration","properties":{"enabled":{"type":"boolean","description":"Whether auto scaling is enabled"},"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers when auto scaling is enabled"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers when auto scaling is enabled"},"maxQueuedTasksPerWorker":{"type":"integer","format":"int32","description":"Maximum queued tasks assigned per worker"},"scaleOutEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-out evaluation period in seconds"},"scaleInEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-in evaluation period in seconds"}}},"ElasticV2UpdateResult":{"type":"object","description":"Elastic Endpoint Update Result v2","properties":{"requiresRolling":{"type":"boolean","description":"Whether the update started a rolling replacement"},"applied":{"type":"boolean","description":"Whether the update was fully applied synchronously"},"planId":{"type":"string","description":"Rolling plan id when requiresRolling is true"}}},"ElasticV2RollingUpdateSummary":{"type":"object","description":"Elastic rolling update summary v2","properties":{"status":{"type":"string","description":"Plan status: Updating/Stopped/..."},"progressX":{"type":"integer","format":"int32","description":"Progress X (matched and running replacement workers)"},"progressY":{"type":"integer","format":"int32","description":"Progress Y (target workers to replace)"},"planId":{"type":"string","description":"Plan id"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Get Task Count

> Get task statistics grouped by status

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/tasks/count":{"get":{"summary":"Get Task Count","deprecated":false,"description":"Get task statistics grouped by status","operationId":"getTaskCount","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2TaskCountResponse"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2TaskCountResponse"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24000":{"description":"Serverless unavailable","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultElasticV2TaskCountResponse":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/ElasticV2TaskCountResponse","description":"data"}}},"ElasticV2TaskCountResponse":{"type":"object","description":"Elastic Endpoint Task Count Response v2","properties":{"processing":{"type":"integer","format":"int32","description":"Currently processing"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## List Versions

> List config versions of an endpoint

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/versions":{"get":{"summary":"List Versions","deprecated":false,"description":"List config versions of an endpoint","operationId":"listVersions","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"pageNumber","in":"query","description":"","required":false,"schema":{"type":"integer","format":"int32","default":1}},{"name":"pageSize","in":"query","description":"","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultV2PageResponseElasticV2VersionResponse"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultV2PageResponseElasticV2VersionResponse"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultV2PageResponseElasticV2VersionResponse":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/V2PageResponseElasticV2VersionResponse","description":"data"}}},"V2PageResponseElasticV2VersionResponse":{"type":"object","description":"Paginated Response","properties":{"items":{"type":"array","description":"List of items in the current page","items":{"$ref":"#/components/schemas/ElasticV2VersionResponse"}},"page":{"type":"integer","format":"int64","description":"Current page number (1-based)"},"size":{"type":"integer","format":"int64","description":"Number of items per page"},"total":{"type":"integer","format":"int64","description":"Total number of items across all pages"},"pages":{"type":"integer","format":"int64","description":"Total number of pages"}}},"ElasticV2VersionResponse":{"type":"object","description":"Elastic version response v2","properties":{"versionId":{"type":"string","description":"Version id"},"versionNo":{"type":"string","description":"Version number, e.g. v1"},"source":{"type":"string","description":"Source: CREATE/EDIT/ROLLBACK"},"eventType":{"type":"string","description":"Event type: DEPLOYED/CONFIG_CHANGED"},"createdAt":{"type":"integer","format":"int64","description":"Created at, epoch ms"},"createdBy":{"type":"string","description":"Created by user id"},"isCurrent":{"type":"boolean","description":"Whether this version is currently applied to the endpoint"},"diff":{"type":"array","description":"Diff vs the previous version; empty for DEPLOYED / initial version","items":{"$ref":"#/components/schemas/ConfigChangeItem"}},"actions":{"type":"array","description":"Available actions: update (latest non-current) / rollback (historical non-current)","items":{"type":"string"}}}},"ConfigChangeItem":{"type":"object","description":"ConfigChangeItem","properties":{"field":{"type":"string","description":"Field name"},"before":{"type":"string","description":"Value before change"},"after":{"type":"string","description":"Value after change"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Get Version

> Get a config version detail including snapshot and diff

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/versions/{versionId}":{"get":{"summary":"Get Version","deprecated":false,"description":"Get a config version detail including snapshot and diff","operationId":"getVersion","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"versionId","in":"path","description":"Version id, the versionId returned by List Versions","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2VersionDetailResponse"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2VersionDetailResponse"}}},"headers":{}},"10007":{"description":"Version does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"14000":{"description":"Endpoint or version not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultElasticV2VersionDetailResponse":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/ElasticV2VersionDetailResponse","description":"data"}}},"ElasticV2VersionDetailResponse":{"type":"object","description":"Elastic version detail response v2","properties":{"versionId":{"type":"string","description":"Version id"},"versionNo":{"type":"string","description":"Version number, e.g. v1"},"source":{"type":"string","description":"Source: CREATE/EDIT/ROLLBACK"},"eventType":{"type":"string","description":"Event type: DEPLOYED/CONFIG_CHANGED"},"createdAt":{"type":"integer","format":"int64","description":"Created at, epoch ms"},"createdBy":{"type":"string","description":"Created by user id"},"isCurrent":{"type":"boolean","description":"Whether this version is currently applied to the endpoint"},"diff":{"type":"array","description":"Diff vs the previous version; empty for DEPLOYED / initial version","items":{"$ref":"#/components/schemas/ConfigChangeItem"}},"actions":{"type":"array","description":"Available actions: update (latest non-current) / rollback (historical non-current)","items":{"type":"string"}},"configSnapshot":{"$ref":"#/components/schemas/ElasticV2ConfigSnapshot","description":"Full config snapshot of this version"}}},"ConfigChangeItem":{"type":"object","description":"ConfigChangeItem","properties":{"field":{"type":"string","description":"Field name"},"before":{"type":"string","description":"Value before change"},"after":{"type":"string","description":"Value after change"}}},"ElasticV2ConfigSnapshot":{"type":"object","description":"Elastic config snapshot v2","properties":{"name":{"type":"string","description":"Deployment name"},"image":{"type":"string","description":"Docker image name"},"imageType":{"type":"integer","format":"int32","description":"Image type: 1=PUBLIC, 2=PRIVATE"},"imageRegistryType":{"type":"integer","format":"int32","description":"Image registry type: 1=Docker Hub, 2=Others"},"imageRegistry":{"type":"string","description":"Docker registry URL"},"credentialId":{"type":"integer","format":"int64","description":"Credential ID"},"resources":{"type":"array","description":"GPU resources","items":{"$ref":"#/components/schemas/OpenapiElasticResourceResponse"}},"minSingleCardVramInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card VRAM in GB"},"minSingleCardVcpu":{"type":"integer","format":"int32","description":"Minimum GPU single card vCPU count"},"minSingleCardRamInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card RAM in GB"},"containerVolumeInGb":{"type":"integer","format":"int32","description":"Container volume in GB"},"persistentVolumes":{"type":"array","description":"Persistent volumes attached to the endpoint","items":{"type":"object"}},"initializationCommand":{"type":"string","description":"Initialization command"},"environmentVars":{"type":"array","description":"Environment variables","items":{"$ref":"#/components/schemas/KeyValuePairDTO"}},"expose":{"$ref":"#/components/schemas/OpenapiExposePortResponse","description":"Exposed port"},"serviceMode":{"type":"string","description":"Service mode: ALB, QUEUE, CUSTOM"},"webhook":{"type":"string","description":"Webhook URL"},"workers":{"type":"integer","format":"int32","description":"Fixed-mode worker count; null when auto scaling is enabled"},"workerScale":{"$ref":"#/components/schemas/OpenapiElasticWorkerScaleResponse","description":"Worker scale range"},"autoScaling":{"$ref":"#/components/schemas/OpenapiElasticAutoScalingResponse","description":"Auto scaling configuration"},"fallbackModeEnabled":{"type":"boolean","description":"Whether fallback mode (stop-then-start) is enabled"},"fallbackTimeoutSec":{"type":"integer","format":"int32","description":"Fallback timeout in seconds"}}},"OpenapiElasticResourceResponse":{"type":"object","description":"ElasticResource","properties":{"region":{"type":"string","description":"Region"},"regionDisplayName":{"type":"string","description":"Region Display Name"},"gpuType":{"type":"string","description":"GPU Type"},"gpuDisplayName":{"type":"string","description":"GPU DisplayName"},"gpuCount":{"type":"integer","format":"int32","description":"GPU Count"},"singleCardVramInGb":{"type":"integer","format":"int32","description":"GPU Single Card VRAM(GB)"},"singleCardVcpu":{"type":"integer","format":"int32","description":"GPU Single Card VCPU"},"singleCardRamInGb":{"type":"integer","format":"int32","description":"GPU Single Card RAM(GB)"}}},"KeyValuePairDTO":{"type":"object","description":"KeyValuePairDTO","properties":{"key":{"type":"string","description":"key","minLength":1},"value":{"type":"string","description":"value","minLength":1}},"required":["key","value"]},"OpenapiExposePortResponse":{"type":"object","description":"ElasticExpose","properties":{"port":{"type":"integer","format":"int32","description":"port"},"protocol":{"type":"string","description":"protocol"}}},"OpenapiElasticWorkerScaleResponse":{"type":"object","description":"Elastic worker scale range","properties":{"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers"}}},"OpenapiElasticAutoScalingResponse":{"type":"object","description":"Elastic auto scaling configuration","properties":{"enabled":{"type":"boolean","description":"Whether auto scaling is enabled"},"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers when auto scaling is enabled"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers when auto scaling is enabled"},"maxQueuedTasksPerWorker":{"type":"integer","format":"int32","description":"Maximum queued tasks assigned per worker"},"scaleOutEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-out evaluation period in seconds"},"scaleInEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-in evaluation period in seconds"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Rollback Version

> Rollback endpoint config to a historical version; may start a rolling update

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/versions/{versionId}/rollback":{"post":{"summary":"Rollback Version","deprecated":false,"description":"Rollback endpoint config to a historical version; may start a rolling update","operationId":"rollbackVersion","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"versionId","in":"path","description":"Version id, the versionId returned by List Versions","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2Response"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2Response"}}},"headers":{}},"10007":{"description":"Version does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"14000":{"description":"Endpoint or version not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24002":{"description":"Serverless action not allowed in the current endpoint status","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24012":{"description":"A rolling update is in progress, this operation is not allowed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24016":{"description":"Cannot apply the target version","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24018":{"description":"No Changes Detected: The endpoint configuration already matches the target version","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultElasticV2Response":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/ElasticV2Response","description":"data"}}},"ElasticV2Response":{"type":"object","description":"Elastic Endpoint Response v2","properties":{"id":{"type":"integer","format":"int64","description":"Deployment ID"},"name":{"type":"string","description":"Deployment name"},"creator":{"type":"string","description":"Creator email"},"domain":{"type":"string","description":"Custom domain"},"imageRegistry":{"type":"string","description":"Docker registry URL"},"image":{"type":"string","description":"Docker image name"},"resources":{"type":"array","description":"GPU resources","items":{"$ref":"#/components/schemas/OpenapiElasticResourceResponse"}},"minSingleCardVramInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card VRAM in GB"},"minSingleCardVcpu":{"type":"integer","format":"int32","description":"Minimum GPU single card vCPU count"},"minSingleCardRamInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card RAM in GB"},"credentialId":{"type":"integer","format":"int64","description":"Credential ID"},"containerVolumeInGb":{"type":"integer","format":"int32","description":"Container volume in GB"},"initializationCommand":{"type":"string","description":"Initialization command"},"environmentVars":{"type":"array","description":"Environment variables","items":{"$ref":"#/components/schemas/KeyValuePairDTO"}},"expose":{"$ref":"#/components/schemas/OpenapiExposePortResponse","description":"Exposed port"},"totalWorkers":{"type":"integer","format":"int32","description":"Total workers"},"workers":{"type":"integer","format":"int32","description":"Fixed-mode worker count; null when auto scaling is enabled"},"workerScale":{"$ref":"#/components/schemas/OpenapiElasticWorkerScaleResponse","description":"Worker scale range"},"autoScaling":{"$ref":"#/components/schemas/OpenapiElasticAutoScalingResponse","description":"Auto scaling configuration"},"runningWorkers":{"type":"integer","format":"int32","description":"Running workers"},"cost":{"type":"number","description":"Accumulated cost"},"perSecondPrice":{"type":"number","description":"Per-second price"},"perHourPrice":{"type":"number","description":"Per-hour price"},"serviceMode":{"type":"string","description":"Service mode","enum":["ALB","QUEUE","CUSTOM"]},"webhook":{"type":"string","description":"Webhook URL"},"status":{"type":"string","description":"Deployment status","enum":["INITIALIZING","RUNNING","STOPPING","STOPPED","FAILED","ROLLING_UPDATING"]},"updateResult":{"$ref":"#/components/schemas/ElasticV2UpdateResult","description":"Execution metadata, populated by PATCH / rollback"},"currentVersionNo":{"type":"string","description":"Current config version number, e.g. v2"},"rollingUpdate":{"$ref":"#/components/schemas/ElasticV2RollingUpdateSummary","description":"Active rolling update status; null when no active plan"}}},"OpenapiElasticResourceResponse":{"type":"object","description":"ElasticResource","properties":{"region":{"type":"string","description":"Region"},"regionDisplayName":{"type":"string","description":"Region Display Name"},"gpuType":{"type":"string","description":"GPU Type"},"gpuDisplayName":{"type":"string","description":"GPU DisplayName"},"gpuCount":{"type":"integer","format":"int32","description":"GPU Count"},"singleCardVramInGb":{"type":"integer","format":"int32","description":"GPU Single Card VRAM(GB)"},"singleCardVcpu":{"type":"integer","format":"int32","description":"GPU Single Card VCPU"},"singleCardRamInGb":{"type":"integer","format":"int32","description":"GPU Single Card RAM(GB)"}}},"KeyValuePairDTO":{"type":"object","description":"KeyValuePairDTO","properties":{"key":{"type":"string","description":"key","minLength":1},"value":{"type":"string","description":"value","minLength":1}},"required":["key","value"]},"OpenapiExposePortResponse":{"type":"object","description":"ElasticExpose","properties":{"port":{"type":"integer","format":"int32","description":"port"},"protocol":{"type":"string","description":"protocol"}}},"OpenapiElasticWorkerScaleResponse":{"type":"object","description":"Elastic worker scale range","properties":{"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers"}}},"OpenapiElasticAutoScalingResponse":{"type":"object","description":"Elastic auto scaling configuration","properties":{"enabled":{"type":"boolean","description":"Whether auto scaling is enabled"},"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers when auto scaling is enabled"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers when auto scaling is enabled"},"maxQueuedTasksPerWorker":{"type":"integer","format":"int32","description":"Maximum queued tasks assigned per worker"},"scaleOutEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-out evaluation period in seconds"},"scaleInEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-in evaluation period in seconds"}}},"ElasticV2UpdateResult":{"type":"object","description":"Elastic Endpoint Update Result v2","properties":{"requiresRolling":{"type":"boolean","description":"Whether the update started a rolling replacement"},"applied":{"type":"boolean","description":"Whether the update was fully applied synchronously"},"planId":{"type":"string","description":"Rolling plan id when requiresRolling is true"}}},"ElasticV2RollingUpdateSummary":{"type":"object","description":"Elastic rolling update summary v2","properties":{"status":{"type":"string","description":"Plan status: Updating/Stopped/..."},"progressX":{"type":"integer","format":"int32","description":"Progress X (matched and running replacement workers)"},"progressY":{"type":"integer","format":"int32","description":"Progress Y (target workers to replace)"},"planId":{"type":"string","description":"Plan id"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## List Rollouts

> List rolling update plans of an endpoint

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/rollouts":{"get":{"summary":"List Rollouts","deprecated":false,"description":"List rolling update plans of an endpoint","operationId":"listRollouts","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"pageNumber","in":"query","description":"","required":false,"schema":{"type":"integer","format":"int32","default":1}},{"name":"pageSize","in":"query","description":"","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultV2PageResponseElasticV2RolloutResponse"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultV2PageResponseElasticV2RolloutResponse"}}},"headers":{}},"14000":{"description":"Endpoint not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultV2PageResponseElasticV2RolloutResponse":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/V2PageResponseElasticV2RolloutResponse","description":"data"}}},"V2PageResponseElasticV2RolloutResponse":{"type":"object","description":"Paginated Response","properties":{"items":{"type":"array","description":"List of items in the current page","items":{"$ref":"#/components/schemas/ElasticV2RolloutResponse"}},"page":{"type":"integer","format":"int64","description":"Current page number (1-based)"},"size":{"type":"integer","format":"int64","description":"Number of items per page"},"total":{"type":"integer","format":"int64","description":"Total number of items across all pages"},"pages":{"type":"integer","format":"int64","description":"Total number of pages"}}},"ElasticV2RolloutResponse":{"type":"object","description":"Elastic rollout response v2","properties":{"planId":{"type":"string","description":"Plan id"},"startTime":{"type":"integer","format":"int64","description":"Started at, epoch ms"},"endTime":{"type":"integer","format":"int64","description":"Ended at, epoch ms (null when running)"},"durationSec":{"type":"integer","format":"int64","description":"Duration in seconds of the current attempt (endedAt/now - attemptStartedAt)"},"fromVersionId":{"type":"string","description":"From version id (use for rollback)"},"fromVersionNo":{"type":"string","description":"From version number, e.g. v1"},"toVersionId":{"type":"string","description":"To version id"},"toVersionNo":{"type":"string","description":"To version number, e.g. v2"},"status":{"type":"string","description":"Plan status: Updating/Completed/Failed/Stopped/Cancelled/RolledBack"},"uiStatus":{"type":"string","description":"UI status label"},"progressX":{"type":"integer","format":"int32","description":"Progress X (matched and running workers)"},"progressY":{"type":"integer","format":"int32","description":"Progress Y (target workers)"},"actions":{"type":"array","description":"Available actions for the current status","items":{"type":"string"}}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Stop Rollout

> Pause a rolling update plan that already has running replacement workers

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/rollouts/{planId}/stop":{"post":{"summary":"Stop Rollout","deprecated":false,"description":"Pause a rolling update plan that already has running replacement workers","operationId":"stopRollout","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"planId","in":"path","description":"Rolling update plan id, the planId returned by List Rollouts","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"10007":{"description":"Rolling update plan does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24002":{"description":"Not allowed: the plan is not Updating, or no replacement worker is running yet (use Cancel Rollout)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultVoid":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Retry Rollout

> Retry a failed or cancelled rolling update plan

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/rollouts/{planId}/retry":{"post":{"summary":"Retry Rollout","deprecated":false,"description":"Retry a failed or cancelled rolling update plan","operationId":"retryRollout","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"planId","in":"path","description":"Rolling update plan id, the planId returned by List Rollouts","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"10007":{"description":"Rolling update plan does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24002":{"description":"Not allowed: the plan is not Failed or Cancelled, or the endpoint already runs the target version","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24012":{"description":"A rolling update is in progress, this operation is not allowed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24016":{"description":"Cannot apply the target version: a newer version exists","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24017":{"description":"This operation is not allowed when the serverless endpoint is STOPPED or STOPPING","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultVoid":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Cancel Rollout

> Cancel a rolling update plan when no replacement workers are running

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/rollouts/{planId}/cancel":{"post":{"summary":"Cancel Rollout","deprecated":false,"description":"Cancel a rolling update plan when no replacement workers are running","operationId":"cancelRollout","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"planId","in":"path","description":"Rolling update plan id, the planId returned by List Rollouts","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"10007":{"description":"Rolling update plan does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24002":{"description":"Not allowed: the plan is not Updating, or replacement workers are already running (use Stop Rollout)","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultVoid":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Resume Rollout

> Resume a stopped rolling update plan

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/rollouts/{planId}/resume":{"post":{"summary":"Resume Rollout","deprecated":false,"description":"Resume a stopped rolling update plan","operationId":"resumeRollout","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"planId","in":"path","description":"Rolling update plan id, the planId returned by List Rollouts","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultVoid"}}},"headers":{}},"10007":{"description":"Rolling update plan does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24002":{"description":"Not allowed: the plan is not Stopped","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultVoid":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```

## Update to Version

> Re-apply the latest non-current version without creating a new version

```json
{"openapi":"3.0.1","info":{"title":"默认模块","version":"1.0.0"},"tags":[{"name":"API v2"},{"name":"Serverless v2"}],"security":[{}],"paths":{"/v2/serverless/{id}/versions/{versionId}/update":{"post":{"summary":"Update to Version","deprecated":false,"description":"Re-apply the latest non-current version without creating a new version","operationId":"reapplyVersion","tags":["API v2","Serverless v2"],"parameters":[{"name":"id","in":"path","description":"","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"versionId","in":"path","description":"Version id, the versionId returned by List Versions","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2Response"}}},"headers":{}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"10000":{"description":"Success","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ResultElasticV2Response"}}},"headers":{}},"10007":{"description":"Version does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"14000":{"description":"Endpoint or version not found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24001":{"description":"Serverless does not exist","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24002":{"description":"Serverless action not allowed in the current endpoint status","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24012":{"description":"A rolling update is in progress, this operation is not allowed","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24016":{"description":"Cannot apply the target version","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}},"24018":{"description":"No Changes Detected: The endpoint configuration already matches the target version","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Result"}}},"headers":{}}}}}},"components":{"schemas":{"ResultElasticV2Response":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"$ref":"#/components/schemas/ElasticV2Response","description":"data"}}},"ElasticV2Response":{"type":"object","description":"Elastic Endpoint Response v2","properties":{"id":{"type":"integer","format":"int64","description":"Deployment ID"},"name":{"type":"string","description":"Deployment name"},"creator":{"type":"string","description":"Creator email"},"domain":{"type":"string","description":"Custom domain"},"imageRegistry":{"type":"string","description":"Docker registry URL"},"image":{"type":"string","description":"Docker image name"},"resources":{"type":"array","description":"GPU resources","items":{"$ref":"#/components/schemas/OpenapiElasticResourceResponse"}},"minSingleCardVramInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card VRAM in GB"},"minSingleCardVcpu":{"type":"integer","format":"int32","description":"Minimum GPU single card vCPU count"},"minSingleCardRamInGb":{"type":"integer","format":"int32","description":"Minimum GPU single card RAM in GB"},"credentialId":{"type":"integer","format":"int64","description":"Credential ID"},"containerVolumeInGb":{"type":"integer","format":"int32","description":"Container volume in GB"},"initializationCommand":{"type":"string","description":"Initialization command"},"environmentVars":{"type":"array","description":"Environment variables","items":{"$ref":"#/components/schemas/KeyValuePairDTO"}},"expose":{"$ref":"#/components/schemas/OpenapiExposePortResponse","description":"Exposed port"},"totalWorkers":{"type":"integer","format":"int32","description":"Total workers"},"workers":{"type":"integer","format":"int32","description":"Fixed-mode worker count; null when auto scaling is enabled"},"workerScale":{"$ref":"#/components/schemas/OpenapiElasticWorkerScaleResponse","description":"Worker scale range"},"autoScaling":{"$ref":"#/components/schemas/OpenapiElasticAutoScalingResponse","description":"Auto scaling configuration"},"runningWorkers":{"type":"integer","format":"int32","description":"Running workers"},"cost":{"type":"number","description":"Accumulated cost"},"perSecondPrice":{"type":"number","description":"Per-second price"},"perHourPrice":{"type":"number","description":"Per-hour price"},"serviceMode":{"type":"string","description":"Service mode","enum":["ALB","QUEUE","CUSTOM"]},"webhook":{"type":"string","description":"Webhook URL"},"status":{"type":"string","description":"Deployment status","enum":["INITIALIZING","RUNNING","STOPPING","STOPPED","FAILED","ROLLING_UPDATING"]},"updateResult":{"$ref":"#/components/schemas/ElasticV2UpdateResult","description":"Execution metadata, populated by PATCH / rollback"},"currentVersionNo":{"type":"string","description":"Current config version number, e.g. v2"},"rollingUpdate":{"$ref":"#/components/schemas/ElasticV2RollingUpdateSummary","description":"Active rolling update status; null when no active plan"}}},"OpenapiElasticResourceResponse":{"type":"object","description":"ElasticResource","properties":{"region":{"type":"string","description":"Region"},"regionDisplayName":{"type":"string","description":"Region Display Name"},"gpuType":{"type":"string","description":"GPU Type"},"gpuDisplayName":{"type":"string","description":"GPU DisplayName"},"gpuCount":{"type":"integer","format":"int32","description":"GPU Count"},"singleCardVramInGb":{"type":"integer","format":"int32","description":"GPU Single Card VRAM(GB)"},"singleCardVcpu":{"type":"integer","format":"int32","description":"GPU Single Card VCPU"},"singleCardRamInGb":{"type":"integer","format":"int32","description":"GPU Single Card RAM(GB)"}}},"KeyValuePairDTO":{"type":"object","description":"KeyValuePairDTO","properties":{"key":{"type":"string","description":"key","minLength":1},"value":{"type":"string","description":"value","minLength":1}},"required":["key","value"]},"OpenapiExposePortResponse":{"type":"object","description":"ElasticExpose","properties":{"port":{"type":"integer","format":"int32","description":"port"},"protocol":{"type":"string","description":"protocol"}}},"OpenapiElasticWorkerScaleResponse":{"type":"object","description":"Elastic worker scale range","properties":{"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers"}}},"OpenapiElasticAutoScalingResponse":{"type":"object","description":"Elastic auto scaling configuration","properties":{"enabled":{"type":"boolean","description":"Whether auto scaling is enabled"},"minWorkers":{"type":"integer","format":"int32","description":"Minimum workers when auto scaling is enabled"},"maxWorkers":{"type":"integer","format":"int32","description":"Maximum workers when auto scaling is enabled"},"maxQueuedTasksPerWorker":{"type":"integer","format":"int32","description":"Maximum queued tasks assigned per worker"},"scaleOutEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-out evaluation period in seconds"},"scaleInEvaluationPeriodSec":{"type":"integer","format":"int32","description":"Scale-in evaluation period in seconds"}}},"ElasticV2UpdateResult":{"type":"object","description":"Elastic Endpoint Update Result v2","properties":{"requiresRolling":{"type":"boolean","description":"Whether the update started a rolling replacement"},"applied":{"type":"boolean","description":"Whether the update was fully applied synchronously"},"planId":{"type":"string","description":"Rolling plan id when requiresRolling is true"}}},"ElasticV2RollingUpdateSummary":{"type":"object","description":"Elastic rolling update summary v2","properties":{"status":{"type":"string","description":"Plan status: Updating/Stopped/..."},"progressX":{"type":"integer","format":"int32","description":"Progress X (matched and running replacement workers)"},"progressY":{"type":"integer","format":"int32","description":"Progress Y (target workers to replace)"},"planId":{"type":"string","description":"Plan id"}}},"Result":{"type":"object","properties":{"message":{"type":"string","description":"message"},"code":{"type":"integer","format":"int32","description":"code"},"data":{"description":"data"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.yottalabs.ai/api-and-sdk/api-reference-v2/serverless.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
