1. 弹性部署服务任务
共绩科技
  • 共绩算力 Open API
    • 资源
      • 获取设备资源列表
      • 获取对象存储加速资源列表
      • 获取共享存储卷资源列表
    • 弹性部署服务任务
      • 任务列表查询接口
        GET
      • 任务详情查询接口
        GET
      • 任务创建接口
        POST
      • 任务修改接口
        POST
      • 任务恢复接口
        POST
      • 任务暂停接口
        POST
      • 任务删除接口
        POST
    • Job批处理任务
      • Job任务列表查询接口
      • Job任务详情查询接口
      • Job任务创建接口
      • Job任务停止接口
    • 弹性部署服务节点
      • 节点列表查询接口
      • 节点日志查询接口
      • 节点事件查询接口
      • 节点数量修改接口
      • 任务节点删除接口
    • 费用
      • 弹性部署/云主机-时间维度计费查询接口
      • 弹性部署/云主机-任务维度计费查询接口
      • 镜像仓库-计费查询接口
      • 对象存储加速-计费查询接口
      • 共享存储卷-计费查询接口
  1. 弹性部署服务任务

任务修改接口

POST
/api/deployment/task/update
当前版本旧版本是否需要加密是否需要加签
v1.0.0-否是

描述#

更新已有任务配置。
修改接口将对原有配置整体覆盖更新,不支持局部字段修改。
因此,调用接口时,请求数据结构必须与 任务详情查询接口 响应中的任务配置在结构上保持完全一致。
同时,由于接口文档在一定情况下可能存在滞后,或任务配置中可能包含系统依赖字段。为了避免因字段缺失等导致校验异常,所以代码编写时应基于 任务详情查询接口 返回的完整配置进行修改后回传。

请求参数

Header 参数

Body 参数application/json

示例
{
    "task_id": 0,
    "task_type": "Deployment",
    "task_name": "string",
    "resources": [
        {
            "resource": {
                "device_name": "string",
                "region": "string",
                "gpu_name": "string",
                "gpu_count": 0,
                "gpu_memory": 0,
                "memory": 0,
                "cpu_cores": 0
            },
            "region_name": "string",
            "mark": "string"
        }
    ],
    "scheduler_strategy": {
        "mode": "Unrestricted"
    },
    "status": "Pending",
    "points": 0,
    "runing_points": 0,
    "billing_points": 0,
    "billing_value": 0,
    "forecast_value": 0,
    "dynamic_pod_strategy": {
        "min_workers": 0,
        "max_workers": 0,
        "idle_timeout": 0,
        "execution_timeout": 0,
        "switch": true,
        "benchmark": [
            {
                "scaling_strategy": "queue_delay",
                "indicators": {
                    "port": 0,
                    "queue_delay_threshold": 0,
                    "max_concurrency_per_instance": 0
                }
            }
        ]
    },
    "load_balance": {
        "type": "LeastConnection",
        "params": {
            "header": "string",
            "cookie": "string"
        }
    },
    "task_qos": {
        "class": "Guaranteed"
    },
    "namespace": "string",
    "repository_username": "string",
    "repository_password": "string",
    "services": [
        {
            "service_id": 0,
            "service_name": "string",
            "service_image": "string",
            "remote_ports": [
                {
                    "url": "string",
                    "service_port": 0
                }
            ],
            "health_checks": {
                "liveness_probe": {
                    "switch": true,
                    "probe_type": "httpGet",
                    "path": "string",
                    "port": 0,
                    "initial_delay_seconds": 0,
                    "period_seconds": 0,
                    "timeout_seconds": 0,
                    "failure_threshold": 0
                },
                "startup_probe": {
                    "switch": true,
                    "probe_type": "httpGet",
                    "path": "string",
                    "port": 0,
                    "initial_delay_seconds": 0,
                    "period_seconds": 0,
                    "timeout_seconds": 0,
                    "failure_threshold": 0
                },
                "readiness_probe": {
                    "switch": true,
                    "probe_type": "httpGet",
                    "path": "string",
                    "port": 0,
                    "initial_delay_seconds": 0,
                    "period_seconds": 0,
                    "timeout_seconds": 0,
                    "failure_threshold": 0
                }
            },
            "env": "string",
            "start_script_v2": {
                "command": "string",
                "args": [
                    "string"
                ]
            },
            "storage_config": [
                {
                    "storage_id": 0,
                    "target_dir": "string"
                }
            ],
            "share_storage_config": [
                {
                    "storage_id": 0,
                    "target_dir": "string"
                }
            ],
            "shared_mem_size": 0
        }
    ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location 'https://openapi.suanli.cn/api/deployment/task/update' \
--header 'token;' \
--header 'timestamp: 1770194570564' \
--header 'version: 1.0.0' \
--header 'Content-Type: application/json' \
--data '{
    "task_id": 0,
    "task_type": "Deployment",
    "task_name": "string",
    "resources": [
        {
            "resource": {
                "device_name": "string",
                "region": "string",
                "gpu_name": "string",
                "gpu_count": 0,
                "gpu_memory": 0,
                "memory": 0,
                "cpu_cores": 0
            },
            "region_name": "string",
            "mark": "string"
        }
    ],
    "scheduler_strategy": {
        "mode": "Unrestricted"
    },
    "status": "Pending",
    "points": 0,
    "runing_points": 0,
    "billing_points": 0,
    "billing_value": 0,
    "forecast_value": 0,
    "dynamic_pod_strategy": {
        "min_workers": 0,
        "max_workers": 0,
        "idle_timeout": 0,
        "execution_timeout": 0,
        "switch": true,
        "benchmark": [
            {
                "scaling_strategy": "queue_delay",
                "indicators": {
                    "port": 0,
                    "queue_delay_threshold": 0,
                    "max_concurrency_per_instance": 0
                }
            }
        ]
    },
    "load_balance": {
        "type": "LeastConnection",
        "params": {
            "header": "string",
            "cookie": "string"
        }
    },
    "task_qos": {
        "class": "Guaranteed"
    },
    "namespace": "string",
    "repository_username": "string",
    "repository_password": "string",
    "services": [
        {
            "service_id": 0,
            "service_name": "string",
            "service_image": "string",
            "remote_ports": [
                {
                    "url": "string",
                    "service_port": 0
                }
            ],
            "health_checks": {
                "liveness_probe": {
                    "switch": true,
                    "probe_type": "httpGet",
                    "path": "string",
                    "port": 0,
                    "initial_delay_seconds": 0,
                    "period_seconds": 0,
                    "timeout_seconds": 0,
                    "failure_threshold": 0
                },
                "startup_probe": {
                    "switch": true,
                    "probe_type": "httpGet",
                    "path": "string",
                    "port": 0,
                    "initial_delay_seconds": 0,
                    "period_seconds": 0,
                    "timeout_seconds": 0,
                    "failure_threshold": 0
                },
                "readiness_probe": {
                    "switch": true,
                    "probe_type": "httpGet",
                    "path": "string",
                    "port": 0,
                    "initial_delay_seconds": 0,
                    "period_seconds": 0,
                    "timeout_seconds": 0,
                    "failure_threshold": 0
                }
            },
            "env": "string",
            "start_script_v2": {
                "command": "string",
                "args": [
                    "string"
                ]
            },
            "storage_config": [
                {
                    "storage_id": 0,
                    "target_dir": "string"
                }
            ],
            "share_storage_config": [
                {
                    "storage_id": 0,
                    "target_dir": "string"
                }
            ],
            "shared_mem_size": 0
        }
    ]
}'

返回响应

🟢200成功
application/json
请求成功
Bodyapplication/json

示例
{
    "code": "0000",
    "message": "success",
    "data": null
}
上一页
任务创建接口
下一页
任务恢复接口
Built with