1. Job批处理任务队列
共绩科技
  • 共绩算力 Open API
    • 资源
      • 获取设备资源列表
      • 获取对象存储加速资源列表
      • 获取共享存储卷资源列表
    • 弹性部署服务任务
      • 任务列表查询接口
      • 任务详情查询接口
      • 任务创建接口
      • 任务修改接口
      • 任务恢复接口
      • 任务暂停接口
      • 任务删除接口
      • 节点数量修改接口
      • 新版任务列表查询接口
      • 新版任务详情查询接口
      • 新版任务创建接口
      • 新版任务修改接口
    • Job批处理任务
      • Job任务列表查询接口
      • Job任务详情查询接口
      • Job任务创建接口
      • Job任务停止接口
    • Job批处理任务队列
      • Job任务队列列表查询接口
        GET
      • Job任务队列详情查询接口
        GET
      • Job任务队列创建接口
        POST
      • Job任务队列更新接口
        POST
      • Job任务队列停止接口
        POST
      • Job任务队列任务组推送接口
        POST
      • Job任务队列任务组列表查询接口
        GET
      • Job任务队列任务组详情查询接口
        GET
      • Job任务队列任务组批量停止接口
        POST
    • 弹性部署服务/Job批处理节点
      • 节点列表查询接口
      • 节点日志查询接口
      • 节点事件查询接口
      • 任务节点删除接口
    • 费用
      • 弹性部署/云主机-时间维度计费查询接口
      • 弹性部署/云主机-任务维度计费查询接口
      • 镜像仓库-计费查询接口
      • 对象存储加速-计费查询接口
      • 共享存储卷-计费查询接口
    • 存储
      • 对象存储
        • 查询对象存储可选元数据区域
        • 查询对象存储加速可选区域
        • 查询对象存储列表
        • 按 ID 查询对象存储
        • 查询对象存储容量用量概览
        • 校验对象存储连接
        • 创建对象存储配置
        • 更新对象存储配置
        • 浏览对象存储桶目录
        • 预热导入对象存储数据
        • 浏览对象存储已导入元数据
        • 删除对象存储已导入元数据
        • 激活对象存储
        • 释放对象存储
        • 删除对象存储配置
  1. Job批处理任务队列

Job任务队列任务组推送接口

POST
/api/job/queue/encrypt/push
当前版本旧版本是否需要加密是否需要加签
v1.0.0-是是

描述#

向Job任务队列推送任务组。任务组会在队列中等待调度,并按任务组大小创建Job任务。
数据结构中的 task_dto.resources.item.mark(资源唯一标识) 需要从资源列表接口获取。
加签和加密详见:加签流程和加密流程

请求参数

Header 参数

Body 参数application/json必填

示例
{
    "queue_id": 0,
    "group_name": "string",
    "group_count": 0,
    "task_parallel_limit": 0,
    "task_dto": {
        "task_name": "string",
        "sub_type": "Spot",
        "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",
                "weight": 0
            }
        ],
        "share_disk_volumes": [
            {
                "name": "string"
            }
        ],
        "share_mem_volumes": [
            {
                "name": "string",
                "size_limit": 0
            }
        ],
        "task_qos": {
            "class": "Guaranteed"
        },
        "points": 0,
        "task_tags": [
            "string"
        ],
        "job_support": {
            "estimated_exec_sec": 1,
            "timeout_sec": 0,
            "parallelism": 0,
            "mod_param": {
                "default": {
                    "backoff_limit": 0,
                    "restart_policy": "OnFailure"
                }
            }
        },
        "termination_grace_period_seconds": 0,
        "services": [
            {
                "service_id": 0,
                "service_name": "string",
                "service_image": "string",
                "resource_weight": {
                    "cpu_weight": 0,
                    "mem_weight": 0,
                    "gpu_weight": 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
                    }
                },
                "remote_ports": [
                    {
                        "url": "string",
                        "service_port": 0
                    }
                ],
                "storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "share_storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "nas_storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "share_mem_config": [
                    {
                        "target_dir": "string",
                        "volume_name": "string"
                    }
                ],
                "share_disk_config": [
                    {
                        "target_dir": "string",
                        "volume_name": "string"
                    }
                ],
                "env": [
                    {
                        "name": "string",
                        "value": "string"
                    }
                ],
                "start_script": {
                    "command": [
                        "string"
                    ],
                    "args": [
                        "string"
                    ]
                },
                "repository_account": {
                    "repository_username": "string",
                    "repository_password": "string"
                },
                "is_update_repository": "string",
                "registered_ports": [
                    {
                        "service_port": 0
                    }
                ]
            }
        ],
        "init_services": [
            {
                "service_id": 0,
                "service_name": "string",
                "service_image": "string",
                "resource_weight": {
                    "cpu_weight": 0,
                    "mem_weight": 0,
                    "gpu_weight": 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
                    }
                },
                "remote_ports": [
                    {
                        "url": "string",
                        "service_port": 0
                    }
                ],
                "storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "share_storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "nas_storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "share_mem_config": [
                    {
                        "target_dir": "string",
                        "volume_name": "string"
                    }
                ],
                "share_disk_config": [
                    {
                        "target_dir": "string",
                        "volume_name": "string"
                    }
                ],
                "env": [
                    {
                        "name": "string",
                        "value": "string"
                    }
                ],
                "start_script": {
                    "command": [
                        "string"
                    ],
                    "args": [
                        "string"
                    ]
                },
                "repository_account": {
                    "repository_username": "string",
                    "repository_password": "string"
                },
                "is_update_repository": "string",
                "registered_ports": [
                    {
                        "service_port": 0
                    }
                ],
                "restart_policy": "Always"
            }
        ]
    }
}

请求示例代码

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/job/queue/encrypt/push' \
--header 'token;' \
--header 'timestamp: {{$date.millisecondsTimestamp}}' \
--header 'version: 1.0.0' \
--header 'sign_str;' \
--header 'Content-Type: application/json' \
--data '{
    "queue_id": 0,
    "group_name": "string",
    "group_count": 0,
    "task_parallel_limit": 0,
    "task_dto": {
        "task_name": "string",
        "sub_type": "Spot",
        "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",
                "weight": 0
            }
        ],
        "share_disk_volumes": [
            {
                "name": "string"
            }
        ],
        "share_mem_volumes": [
            {
                "name": "string",
                "size_limit": 0
            }
        ],
        "task_qos": {
            "class": "Guaranteed"
        },
        "points": 0,
        "task_tags": [
            "string"
        ],
        "job_support": {
            "estimated_exec_sec": 1,
            "timeout_sec": 0,
            "parallelism": 0,
            "mod_param": {
                "default": {
                    "backoff_limit": 0,
                    "restart_policy": "OnFailure"
                }
            }
        },
        "termination_grace_period_seconds": 0,
        "services": [
            {
                "service_id": 0,
                "service_name": "string",
                "service_image": "string",
                "resource_weight": {
                    "cpu_weight": 0,
                    "mem_weight": 0,
                    "gpu_weight": 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
                    }
                },
                "remote_ports": [
                    {
                        "url": "string",
                        "service_port": 0
                    }
                ],
                "storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "share_storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "nas_storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "share_mem_config": [
                    {
                        "target_dir": "string",
                        "volume_name": "string"
                    }
                ],
                "share_disk_config": [
                    {
                        "target_dir": "string",
                        "volume_name": "string"
                    }
                ],
                "env": [
                    {
                        "name": "string",
                        "value": "string"
                    }
                ],
                "start_script": {
                    "command": [
                        "string"
                    ],
                    "args": [
                        "string"
                    ]
                },
                "repository_account": {
                    "repository_username": "string",
                    "repository_password": "string"
                },
                "is_update_repository": "string",
                "registered_ports": [
                    {
                        "service_port": 0
                    }
                ]
            }
        ],
        "init_services": [
            {
                "service_id": 0,
                "service_name": "string",
                "service_image": "string",
                "resource_weight": {
                    "cpu_weight": 0,
                    "mem_weight": 0,
                    "gpu_weight": 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
                    }
                },
                "remote_ports": [
                    {
                        "url": "string",
                        "service_port": 0
                    }
                ],
                "storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "share_storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "nas_storage_config": [
                    {
                        "storage_id": 0,
                        "target_dir": "string"
                    }
                ],
                "share_mem_config": [
                    {
                        "target_dir": "string",
                        "volume_name": "string"
                    }
                ],
                "share_disk_config": [
                    {
                        "target_dir": "string",
                        "volume_name": "string"
                    }
                ],
                "env": [
                    {
                        "name": "string",
                        "value": "string"
                    }
                ],
                "start_script": {
                    "command": [
                        "string"
                    ],
                    "args": [
                        "string"
                    ]
                },
                "repository_account": {
                    "repository_username": "string",
                    "repository_password": "string"
                },
                "is_update_repository": "string",
                "registered_ports": [
                    {
                        "service_port": 0
                    }
                ],
                "restart_policy": "Always"
            }
        ]
    }
}'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{
    "code": "0000",
    "message": "string",
    "data": {
        "group_id": 0
    }
}
上一页
Job任务队列停止接口
下一页
Job任务队列任务组列表查询接口
Built with