人工智能平台 PAI - 分布式训练(DLC) - pai-dlc CLI 命令参考

更新时间:
复制 MD 格式

本文列出人工智能平台 PAI - 分布式训练(DLC) - pai-dlc 在阿里云 CLI 中的可用命令,并提供各命令的语法和参数说明。

前提条件

  • 已安装阿里云 CLI。安装方法请参见安装/更新 CLI。

  • 执行需要身份认证的命令前,请确认已配置阿里云 CLI 凭证,且凭证对应的身份拥有所需权限。配置方法请参见配置与管理身份凭证。

地域与接入点

凭证配置中的默认地域可用 --region <regionId> 覆盖。

未指定接入地址时,CLI 按产品规则尝试解析,需要指定时可按地域和网络类型查看 Endpoint,再使用 --endpoint <endpoint>。

版本信息

属性

值

CLI 版本

3.5.4

API 版本

2020-12-03

可用命令

单击命令名称,查看命令描述、语法和参数说明。

命令详情

语法逐行列出命令参数:<类型> 是需要替换的值占位符,方括号表示可选参数,# 表示列表项序号;[options] 表示 CLI 通用选项,见“全局选项”。可选对象或列表内标为必填的字段,仅在提供该对象或列表项时必填。完整参数定义见各命令的参数说明。

CreateJob

命令描述

创建一个任务到集群中运行。您可以指定数据源配置、代码源配置、启动命令以及任务运行的每个节点的计算资源配置等信息

contentType:application/json

HTTP 方法:POST

protocol:HTTPS

requestBodyType:json

url:/api/v1/jobs

语法

aliyun pai-dlc CreateJob
    [--body <string>]
    [options]

参数

参数

类型

必填

说明

--body

String

否

请求Body参数

示例

aliyun pai-dlc POST /api/v1/jobs --region cn-hangzhou --header "Content-Type=application/json" --body '{"JobSpecs":[{"HyperNodeSchedulingConfig":{"QualityPolicy":"AlwaysRequire","MinAvailable":1},"QuotaId":"quota12345","ServiceSpec":{"ExtraPorts":[8081],"ServiceMode":"PerRole","DefaultPort":8080},"AssignNodeSpec":{"AntiAffinityNodeNames":"lingjxxxxxxxx","AntiAffinityHyperNodes":[{"HyperNodeName":"mg1234567","NodeNames":"lingjxxxxxxxx"}],"EnableAssignNode":true,"HyperNodes":[{"HyperNodeName":"mg1234567","NodeNames":"lingjxxxxxxxx"}],"NodeNames":"lingjxxxxxxxx"},"Driver":"535.54.03","Image":"registry-vpc.cn-hangzhou.aliyuncs.com/cloud-dsw/tensorflow:1.12PAI-gpu-py36-cu101-ubuntu18.04","PodCount":1,"SystemDisk":{"Category":"cloud_essd","PerformanceLevel":"PL1","Size":200},"SpotSpec":{"SpotDiscountLimit":0.8,"SpotPriceLimit":0.4744,"SpotStrategy":"SpotWithPriceLimit"},"ConsiderInSuccessPolicy":true,"IsCheif":true,"ResourceConfig":{"GPUType":"Tesla-V100-16G","Memory":"10Gi","CPU":"10","SharedMemory":"5Gi","GPU":"3"},"IsChief":true,"ImageConfig":{"DockerRegistry":"docker****registry.com","Username":" username","Auth":"example-string","Password":"password"},"UseSpotInstance":false,"EcsSpec":"ecs.c6.large","RestartPolicy":"ExitCode","UserCommand":"python train.py","Type":"Worker","ElasticSpotSpecs":[{"SpotDiscountLimit":0.8,"SpotPriceLimit":0.4744,"InstanceType":"ecs.gn6e-c12g1.3xlarge","SpotStrategy":"SpotWithPriceLimit"}],"AutoScalingSpec":{"AutoscalingMetricSpec":{"MetricName":"POD_CPU_UTIL","TargetValue":80,"Tolerance":"0.1","StabilizationWindowSeconds":60},"ScalingStrategy":"Default","MinReplicas":1,"MaxReplicas":10,"PodsToDelete":["pod-a"]},"LocalMountSpecs":[{"MountPath":"/mnt/data","MountMode":"Filesystem","LocalPath":"/local/a"}],"OversoldType":"AcceptQuotaOverSold","ExtraPodSpec":{"InitContainers":[{"WorkingDir":"/root","Args":["-v"],"Command":["curl www.aliyun.com"],"SecurityContext":{"RunAsUser":1000,"Capabilities":{"Add":["NET_ADMIN"],"Drop":["NET_ADMIN"]},"Privileged":true,"RunAsGroup":1000,"SeccompProfile":{"Type":"Unconfined","LocalhostProfile":"my-profiles/profile-allow.json"}},"Resources":{"Limits":{"key":"{'"'"'cpu'"'"': '"'"'1'"'"', '"'"'memory'"'"': '"'"'1000Mi'"'"'}"},"Requests":{"key":"{'"'"'cpu'"'"': '"'"'1'"'"', '"'"'memory'"'"': '"'"'1000Mi'"'"'}"}},"Env":[{"Value":"true","Name":"ENABLE_DEBUG"}],"Image":"registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0","Name":"data-init"}],"PodAnnotations":{"key":"example-annotation"},"SideCarContainers":[{"WorkingDir":"/root","Args":["-v"],"Command":["curl www.aliyun.com"],"SecurityContext":{"RunAsUser":1000,"Capabilities":{"Add":["NET_ADMIN"],"Drop":["NET_ADMIN"]},"Privileged":true,"RunAsGroup":1000,"SeccompProfile":{"Type":"Unconfined","LocalhostProfile":"my-profiles/profile-allow.json"}},"Resources":{"Limits":{"key":"{'"'"'cpu'"'"': '"'"'1'"'"', '"'"'memory'"'"': '"'"'1000Mi'"'"'}"},"Requests":{"key":"{'"'"'cpu'"'"': '"'"'1'"'"', '"'"'memory'"'"': '"'"'1000Mi'"'"'}"}},"Env":[{"Value":"true","Name":"ENABLE_DEBUG"}],"Image":"registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0","Name":"data-init"}],"Lifecycle":{"PreStop":{"Exec":{"Command":["/bin/sh"]}},"PostStart":{"Exec":{"Command":["echo"]}}},"MainContainerSecurityContext":{"RunAsUser":1000,"Capabilities":{"Add":["NET_ADMIN"],"Drop":["NET_ADMIN"]},"Privileged":true,"RunAsGroup":1000,"SeccompProfile":{"Type":"Unconfined","LocalhostProfile":"my-profiles/profile-allow.json"}},"SharedVolumeMountPaths":["/root/share/"],"PodLabels":{"key":"example-lable"}},"StartupDependencies":[{"Type":"Worker","MinReplicas":"1","OnPhase":"ServiceReady"}]}],"UserCommand":"python /root/code/mnist.py","JobType":"TFJob","DisplayName":"tf-mnist-test"}'

CreateJobTemplate

命令描述

创建任务模板

contentType:application/json

HTTP 方法:POST

protocol:HTTPS

requestBodyType:json

url:/api/v1/jobtemplates

语法

aliyun pai-dlc CreateJobTemplate
    [--body <string>]
    [options]

参数

参数

类型

必填

说明

--body

String

否

请求Body参数

示例

aliyun pai-dlc POST /api/v1/jobtemplates --region cn-hangzhou --header "Content-Type=application/json" --body '{"Content":"{\\\"WorkspaceId\\\":\\\"15****05\\\",\\\"JobType\\\":\\\"PyTorchJob\\\",\\\"UserCommand\\\":\\\"echo hello\\\",\\\"JobSpecs\\\":[{\\\"Type\\\":\\\"Worker\\\",\\\"PodCount\\\":1,\\\"Image\\\":\\\"dsw-registry-vpc.cn-hangzhou.cr.aliyuncs.com/pai/pytorch:2.8.0-gpu-py313-cu129-ubuntu22.04-3995b779-1764361782\\\",\\\"EcsSpec\\\":\\\"ecs.gn7i-c8g1.2xlarge\\\"}],\\\"ResourceType\\\":\\\"ECS\\\",\\\"_ResourcePaymentType\\\":\\\"PostPaid\\\",\\\"CredentialConfig\\\":{\\\"EnableCredentialInject\\\":false},\\\"Accessibility\\\":\\\"PRIVATE\\\",\\\"Settings\\\":{\\\"JobReservedMinutes\\\":0,\\\"Tags\\\":{}}}\t","WorkspaceId":"15****05","TemplateName":"job-template-example-1778047****\t"}'

CreateRayHistoryServer

命令描述

创建 RayHistoryServer

contentType:application/json

HTTP 方法:POST

protocol:HTTPS

requestBodyType:json

url:/api/v1/rayhistoryservers

语法

aliyun pai-dlc CreateRayHistoryServer
    [--body <string>]
    [options]

参数

参数

类型

必填

说明

--body

String

否

请求Body参数

示例

aliyun pai-dlc POST /api/v1/rayhistoryservers --region cn-hangzhou --header "Content-Type=application/json" --body '{"StoragePath":"oss://bucket-test-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/tmp","DisplayName":"my-ray-history-server","WorkspaceId":"12345"}'

CreateSignal

命令描述

向指定作业的Pod发送信号并获取信号ID

contentType:application/json

HTTP 方法:POST

protocol:HTTPS

requestBodyType:json

url:/api/v1/jobs/{JobId}/signals

语法

aliyun pai-dlc CreateSignal
    [--JobId <string>]
    [--body <string>]
    [options]

参数

参数

类型

必填

说明

--JobId

String

否

任务ID

--body

String

否

请求Body参数

示例

aliyun pai-dlc POST /api/v1/jobs/dlc00000000/signals --region cn-hangzhou --header "Content-Type=application/json" --body '{"Signal":"SIGUSR1","Target":{"Scope":"pods","Roles":["worker"],"PodNames":["dlc*******-worker-0"]}}'

CreateTensorboard

命令描述

创建一个Tensorboard,可以通过一个任务或者指定数据源配置来创建

contentType:application/json

HTTP 方法:POST

protocol:HTTPS

requestBodyType:json

url:/api/v1/tensorboards

语法

aliyun pai-dlc CreateTensorboard
    [--body <string>]
    [options]

参数

参数

类型

必填

说明

--body

String

否

请求参数

示例

aliyun pai-dlc POST /api/v1/tensorboards --region cn-hangzhou --header "Content-Type=application/json" --body '{"MaxRunningTimeMinutes":240,"Options":"{\"mountpath\":\"/root/data/\"}","QuotaId":"quota12345","Accessibility":"PRIVATE","SummaryPath":"/root/data/","Memory":1000,"Priority":"1","SourceType":"job","SourceId":"dlc-xxxxxx","WorkspaceId":"123***","Cpu":1,"Uri":"oss://.oss-cn-shanghai-finance-1.aliyuncs.com/","TensorboardDataSources":[{"SummaryPath":"/tensorboard/run1","DataSourceType":"OSS","SourceType":"datasource","Id":"d-vf2fdhxxxxxx","DirectoryName":"dlcJobName","Uri":"oss://examplebucket.oss-cn-shanghai-internal.aliyuncs.com/","FullSummaryPath":"oss://xxxxx/tensorboard/run1","Name":"dlcJobName"}],"TensorboardSpec":{"VpcId":"vpc-xxxx","EcsType":"ecs.g6.large","SecurityGroupId":"sg-xxxxx","SwitchId":"vsw-xxxx"},"DataSources":[{"Path":"oss://mybucket/path/to/dir","MountPath":"/root/data/","Options":"{\"key\": \"value\"}","Description":"data source of dlc examples","Endpoint":"oss-cn-beijing-internal.aliyuncs.com","GmtModifyTime":"2021-01-12T14:36:00Z","UserId":"123456789","DataSourceType":"NAS","DisplayName":"nas-data","FileSystemId":"1ca404****","DataSourceId":"data-20210114104214-xxxxxxx","GmtCreateTime":"2021-01-12T14:35:00Z"}],"SummaryRelativePath":"/summary/","DataSourceType":"OSS","DisplayName":"tensorboard","JobId":"dlc-20210126170216-mtl37ge7gkvdz","DataSourceId":"d-xxxxxxxx"}'

DeleteJob

命令描述

删除一个运行结束(或者已停止)的任务

HTTP 方法:DELETE

protocol:HTTPS

url:/api/v1/jobs/{JobId}

语法

aliyun pai-dlc DeleteJob
    --JobId <string>
    [options]

参数

参数

类型

必填

说明

--JobId

String

是

任务ID。如何获取任务ID,请参见https://help.aliyun.com/document_detail/459676.html

示例

aliyun pai-dlc DELETE /api/v1/jobs/dlc0000000000000 --region cn-hangzhou --header "Content-Type=application/json"

DeleteJobTemplate

命令描述

删除没有使用的任务模板,如果模版已经被任务使用则不允许删除

HTTP 方法:DELETE

protocol:HTTPS

url:/api/v1/jobtemplates/{TemplateId}

语法

aliyun pai-dlc DeleteJobTemplate
    --TemplateId <string>
    [options]

参数

参数

类型

必填

说明

--TemplateId

String

是

模板 ID

  • 约束:

    • 最大长度:128

示例

aliyun pai-dlc DELETE /api/v1/jobtemplates/tplwk80096dw0000 --region cn-hangzhou --header "Content-Type=application/json"

DeleteRayHistoryServer

命令描述

删除RayHistoryServer

HTTP 方法:DELETE

protocol:HTTPS

url:/api/v1/rayhistoryservers/{RayHistoryServerId}

语法

aliyun pai-dlc DeleteRayHistoryServer
    [--RayHistoryServerId <string>]
    [options]

参数

参数

类型

必填

说明

--RayHistoryServerId

String

否

请求删除的 Ray History Server ID

示例

aliyun pai-dlc DELETE /api/v1/rayhistoryservers/rhsxxx --region cn-hangzhou --header "Content-Type=application/json"

DeleteTensorboard

命令描述

删除一个已经停止的Tensorboard

HTTP 方法:DELETE

protocol:HTTPS

url:/api/v1/tensorboards/{TensorboardId}

语法

aliyun pai-dlc DeleteTensorboard
    --TensorboardId <string>
    [--WorkspaceId <string>]
    [options]

参数

参数

类型

必填

说明

--TensorboardId

String

是

Tensorboard ID。如何获取Tensorboard ID,请参见https://help.aliyun.com/document_detail/459689.html

  • 约束:

    • 最大长度:256

    • 最小长度:1

--WorkspaceId

String

否

工作空间ID。如何获取工作空间ID,请参见https://help.aliyun.com/document_detail/449124.html。

示例

aliyun pai-dlc DELETE /api/v1/tensorboards/tensorboard-20210114104214-xxxxxxxx --region cn-hangzhou --header "Content-Type=application/json"

GetDashboard

命令描述

获取DLC任务的Dashboard URL(如果存在)

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{jobId}/dashboard

语法

aliyun pai-dlc GetDashboard
    [--isShared <bool>]
    [--jobId <string>]
    [--token <string>]
    [options]

参数

参数

类型

必填

说明

--isShared

Boolean

否

是否为分享链接。若为是,目前同时必填token

--jobId

String

否

任务ID

--token

String

否

从GetToken获取的token

示例

aliyun pai-dlc GET /api/v1/jobs/dlc1k7426goc7bvy/dashboard --region cn-hangzhou --isShared false --token some_token_value --header "Content-Type=application/json"

GetJob

命令描述

获取一个任务的详细配置和运行时信息

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{JobId}

语法

aliyun pai-dlc GetJob
    --JobId <string>
    [--NeedDetail <bool>]
    [options]

参数

参数

类型

必填

说明

--JobId

String

是

任务ID。如何获取任务ID,请参见https://help.aliyun.com/document_detail/459676.html

  • 约束:

    • 最大长度:256

    • 最小长度:1

--NeedDetail

Boolean

否

是否返回作业详情信息,默认为true

示例

aliyun pai-dlc GET /api/v1/jobs/dlc0000000 --region cn-hangzhou --header "Content-Type=application/json"

GetJobEvents

命令描述

获取一个任务的系统事件

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{JobId}/events

语法

aliyun pai-dlc GetJobEvents
    [--EndTime <string>]
    --JobId <string>
    [--MaxEventsNum <int>]
    [--StartTime <string>]
    [options]

参数

参数

类型

必填

说明

--EndTime

String

否

查询事件的时间区间的截止时间(UTC),默认值是当前

--JobId

String

是

任务ID。如何获取任务ID,请参见https://help.aliyun.com/document_detail/459676.html

--MaxEventsNum

Integer

否

获取事件的最大数目,默认值:2000

  • 约束:

    • 最大值:10000

    • 最小值:1

--StartTime

String

否

查询事件的时间区间的起始时间(UTC),默认值是7天前

示例

aliyun pai-dlc GET /api/v1/jobs/dlc-20210126170216-0000000/events --region cn-hangzhou --header "Content-Type=application/json"

GetJobMetrics

命令描述

获取一个任务的监控数据,包括CPU、GPU、Memory的使用率、Network、Disk读写速率等。
⚠️注意:除基于通用计算资源的按量付费(后付费)任务外,其余任务类型均已对接云监控。相关监控调用请使用云监控接口,原接口中已被覆盖的功能将不再维护。更多信息,请参见训练监控与报警 (https://www.alibabacloud.com/help/zh/pai/user-guide/training-monitoring-and-alerting)

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{JobId}/metrics

语法

aliyun pai-dlc GetJobMetrics
    [--EndTime <string>]
    --JobId <string>
    --MetricType <string>
    [--StartTime <string>]
    [--TimeStep <string>]
    [--Token <string>]
    [options]

参数

参数

类型

必填

说明

--EndTime

String

否

查询监控数据的时间区间的截止时间(UTC),默认值是当前

--JobId

String

是

任务ID。您可以调用https://help.aliyun.com/document_detail/459676.html获取所有任务的ID

--MetricType

String

是

查询监控数据的指标类型,取值如下:
GpuCoreUsage:GPU使用率。
GpuMemoryUsage:GPU Memory使用率。
CpuCoreUsage:CPU使用率。
MemoryUsage:Memory使用率。
NetworkInputRate:网络写入速率。
NetworkOutputRate:网络写出速率。
DiskReadRate:磁盘读取速率。
DiskWriteRate:磁盘写入速率







--StartTime

String

否

查询监控数据的时间区间的起始时间(UTC),默认值是1小时前

--TimeStep

String

否

返回监控数据的时间间隔,默认值是5分钟

--Token

String

否

用于鉴权的临时令牌

示例

aliyun pai-dlc GET /api/v1/jobs/dlc-20210126170216-0000000/metrics --region cn-hangzhou --MetricType GpuMemoryUsage --header "Content-Type=application/json"

GetJobSanityCheckResult

命令描述

获取DLC任务某次算力健康检测结果

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{JobId}/sanitycheckresult

语法

aliyun pai-dlc GetJobSanityCheckResult
    --JobId <string>
    --SanityCheckNumber <int>
    [--SanityCheckPhase <string>]
    [--Token <string>]
    [options]

参数

参数

类型

必填

说明

--JobId

String

是

任务ID。如何获取任务ID,请参见https://help.aliyun.com/document_detail/459676.html

--SanityCheckNumber

Integer

是

任务第几次算力健康检测

  • 约束:

    • 最小值:1

--SanityCheckPhase

String

否

算力健康检测的检测阶段:
CheckInit:检测环境准备。
DeviceCheck:单卡算力检测。
SingleNodeCommCheck:单节点内部通信检测。
TwoNodeCommCheck:两节点间通信检测。
AllNodeCommCheck:所有节点通信检测




--Token

String

否

任务分享令牌中的Token信息。如何获取,请参见https://help.aliyun.com/document_detail/2557812.html

示例

aliyun pai-dlc GET /api/v1/jobs/dlcl5qxoxxxxx5iq/sanitycheckresult --region cn-hangzhou --SanityCheckNumber 1 --header "Content-Type=application/json"

GetJobTemplate

命令描述

获取任务模板详情

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobtemplates/{TemplateId}

语法

aliyun pai-dlc GetJobTemplate
    --TemplateId <string>
    [--Version <string>]
    [options]

参数

参数

类型

必填

说明

--TemplateId

String

是

任务模板的唯一标识

  • 约束:

    • 最大长度:128

--Version

String

否

不传返回默认版本;传具体数字返回该版本;传 all 返回全部版本

示例

aliyun pai-dlc GET /api/v1/jobtemplates/tplmceolmf20000 --region cn-hangzhou --header "Content-Type=application/json"

GetMetrics

命令描述

获取metrics数据

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/cms/metrics

语法

aliyun pai-dlc GetMetrics
    [--Dimensions <string>]
    [--EndTime <string>]
    [--JobId <string>]
    [--Length <string>]
    [--MetricName <string>]
    [--Namespace <string>]
    [--NextToken <string>]
    [--Period <string>]
    [--StartTime <string>]
    [--Token <string>]
    [options]

参数

参数

类型

必填

说明

--Dimensions

String

否

(必填)请求参数

--EndTime

String

否

查询的截止时间,默认值:当前

--JobId

String

否

任务ID

--Length

String

否

每次查询大小,用于分页查询,默认值为1000

--MetricName

String

否

metric名称。未填充,不在使用中

--Namespace

String

否

云产品的数据命名空间。关于云产品的数据命名空间,请参见云产品监控项

--NextToken

String

否

分页游标标识。说明 如果不设置该参数,则表示获取第一页的数据。当该参数有返回值时,说明还有下一页,您可以将返回的NextToken作为参数再次请求获得下一页的数据,直到返回为Null为止,表示获取到了所有的数据

--Period

String

否

监控数据的统计周期。单位:秒。取值:15、60、900和3600

--StartTime

String

否

查询监控数据的时间区间的起始时间(UTC),默认值是1小时前

--Token

String

否

用于鉴权的临时令牌

示例

aliyun pai-dlc GET /api/v1/cms/metrics --region cn-hangzhou --MetricName JOB_MEMORY_FREE --EndTime '2020-11-09T16:00:00Z' --NextToken 2c6b65b6f9d625d4716568ca19b2064be0b5e8707e68181f --Length 5000 --StartTime '2020-11-08T16:00:00Z' --Dimensions '[{\"jobId\":\"dlcdpfpc96mh63mg\",\"pod\":\"dlcdpfpc96mh63mg-worker-748\",\"regionId\":\"cn-wulanchabu\",\"userId\":\"1458867964644701\"}]' --Period 5 --Token 'eyXXXX-XXXX.XXXXX' --Namespace acs_pai_dlc --JobId dlckjd5hm84tmjec --header "Content-Type=application/json"

GetPodEvents

命令描述

通过获取任务中特定节点的系统事件,来进行问题的定位与排查

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{JobId}/pods/{PodId}/events

语法

aliyun pai-dlc GetPodEvents
    [--EndTime <string>]
    --JobId <string>
    [--MaxEventsNum <int>]
    --PodId <string>
    [--PodUid <string>]
    [--StartTime <string>]
    [options]

参数

参数

类型

必填

说明

--EndTime

String

否

截止时间(UTC)

--JobId

String

是

任务ID。参见https://help.aliyun.com/document_detail/459676.html获取任务ID

--MaxEventsNum

Integer

否

返回的事件最大数量

--PodId

String

是

节点ID。参见https://help.aliyun.com/document_detail/459677.html获取节点ID

--PodUid

String

否

节点UID。参见https://help.aliyun.com/document_detail/459677.html获取节点UID

--StartTime

String

否

起始时间(UTC)

示例

aliyun pai-dlc GET /api/v1/jobs/dlc-20210126170216-00000/pods/dlc-20210126170216-mtl37ge7g0000-chief-0/events --region cn-hangzhou --header "Content-Type=application/json"

GetPodLogs

命令描述

获取(或者下载)任务某个节点的日志,日志来源于系统和用户脚本的stdout和stderr

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{JobId}/pods/{PodId}/logs

语法

aliyun pai-dlc GetPodLogs
    [--Containers <string>]
    [--DownloadToFile <bool>]
    [--EndTime <string>]
    --JobId <string>
    [--MaxLines <int>]
    --PodId <string>
    [--PodUid <string>]
    [--StartTime <string>]
    [options]

参数

参数

类型

必填

说明

--Containers

String

否

筛选指定容器的日志,多个容器名称用,链接

--DownloadToFile

Boolean

否

是否下载日志文件。取值如下:
false(默认):表示不下载日志文件。
true:开始下载日志文件

--EndTime

String

否

查询的截止时间,默认值:当前

--JobId

String

是

任务ID。如何获取任务ID,请参见https://help.aliyun.com/document_detail/459676.html

--MaxLines

Integer

否

返回的日志的最大行数,默认值:2000

--PodId

String

是

节点ID。如何获取节点ID,请参见https://help.aliyun.com/document_detail/459677.html

--PodUid

String

否

节点UID;如何获取节点UID,请参见https://help.aliyun.com/document_detail/459677.html

--StartTime

String

否

查询的起始时间,默认值:7天前

示例

aliyun pai-dlc GET /api/v1/jobs/dlc-20210126170216-00000/pods/dlc-20210126170216-00000-chief-0/logs --region cn-hangzhou --header "Content-Type=application/json"

GetRayDashboard

命令描述

获取 Ray Dashboard 链接

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{jobId}/rayDashboard

语法

aliyun pai-dlc GetRayDashboard
    [--isShared <bool>]
    [--jobId <string>]
    [--token <string>]
    [options]

参数

参数

类型

必填

说明

--isShared

Boolean

否

是否为分享链接。若为是,目前同时必填token

--jobId

String

否

任务ID

--token

String

否

从GetToken获取的token

示例

aliyun pai-dlc GET /api/v1/jobs/dlc1k7426goc7bvy/rayDashboard --region cn-hangzhou --isShared false --token some_token_value --header "Content-Type=application/json"

GetRayHistoryServer

命令描述

查询 RayHistoryServer

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/rayhistoryservers/{RayHistoryServerId}

语法

aliyun pai-dlc GetRayHistoryServer
    --RayHistoryServerId <string>
    [options]

参数

参数

类型

必填

说明

--RayHistoryServerId

String

是

请求的 RayHistoryServer ID

示例

aliyun pai-dlc GET /api/v1/rayhistoryservers/rhsxxx --region cn-hangzhou --header "Content-Type=application/json"

GetSignal

命令描述

查询指定作业下的特定信号的详细信息

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{JobId}/signals/{SignalId}

语法

aliyun pai-dlc GetSignal
    [--JobId <string>]
    [--SignalId <string>]
    [--Token <string>]
    [options]

参数

参数

类型

必填

说明

--JobId

String

否

作业 Id

--SignalId

String

否

信号 Id

--Token

String

否

用于鉴权的临时令牌

示例

aliyun pai-dlc GET /api/v1/jobs/dlc0000000000/signals/oper0000000000 --region cn-hangzhou --Token 'eyXXXX-XXXX.XXXXX' --header "Content-Type=application/json"

GetTensorboard

命令描述

获取一个Tensorboard的详细信息

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/tensorboards/{TensorboardId}

语法

aliyun pai-dlc GetTensorboard
    [--JodId <string>]
    --TensorboardId <string>
    [--Token <string>]
    [--WorkspaceId <string>]
    [options]

参数

参数

类型

必填

说明

--JodId

String

否

任务ID。参见https://help.aliyun.com/document_detail/459676.html获取任务ID

--TensorboardId

String

是

Tensorboard ID。参见https://help.aliyun.com/document_detail/459689.html获取Tensorboard ID

  • 约束:

    • 最大长度:256

    • 最小长度:1

--Token

String

否

分享令牌信息,填入该参数可利用分享令牌信息获得查看某个Tensorboard任务的权限。可通过执行https://help.aliyun.com/document_detail/2557813.html,在获得的链接中提取

--WorkspaceId

String

否

工作空间ID。参见https://help.aliyun.com/document_detail/449124.html获取工作空间ID。

示例

aliyun pai-dlc GET /api/v1/tensorboards/tb-20210114104214-xxxxx --region cn-hangzhou --header "Content-Type=application/json"

GetTensorboardSharedUrl

命令描述

获得Tensorboard的分享链接。该链接中包含数字令牌。使用该分享链接可以访问被分享的Tensorboard任务

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/tensorboards/{TensorboardId}/sharedurl

语法

aliyun pai-dlc GetTensorboardSharedUrl
    [--ExpireTimeSeconds <string>]
    --TensorboardId <string>
    [options]

参数

参数

类型

必填

说明

--ExpireTimeSeconds

String

否

分享链接的有效时长,单位:秒。最大值为604800

--TensorboardId

String

是

Tensorboard任务的ID

示例

aliyun pai-dlc GET /api/v1/tensorboards/tbxxxxxx/sharedurl --region cn-hangzhou --header "Content-Type=application/json"

GetToken

命令描述

获取DLC任务的分享令牌(Token),用于查看分享任务的相关信息

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/tokens

语法

aliyun pai-dlc GetToken
    [--ExpireTime <int>]
    [--TargetId <string>]
    [--TargetType <string>]
    [--TokenSettings <string>]
    [options]

参数

参数

类型

必填

说明

--ExpireTime

Integer

否

分享链接过期时间(默认为604800秒),最小值为0

--TargetId

String

否

等待分享的任务的ID

--TargetType

String

否

分享的任务类型,只可指定job或者tensorboard

--TokenSettings

String

否

分享令牌的权限配置,可控制日志下载和跨账号访问

示例

aliyun pai-dlc GET /api/v1/tokens --region cn-hangzhou --TokenSettings '{EnableLogDownloadJob=true, EnableCrossAccountAccess=true}' --TargetType job --ExpireTime 60 --TargetId 'dlc*******' --header "Content-Type=application/json"

GetWebTerminal

命令描述

提供获取容器访问HTTP链接的方法和步骤

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{JobId}/pods/{PodId}/webterminal

语法

aliyun pai-dlc GetWebTerminal
    [--ContainerName <string>]
    [--IsShared <bool>]
    [--JobId <string>]
    [--PodId <string>]
    [--PodUid <string>]
    [options]

参数

参数

类型

必填

说明

--ContainerName

String

否

容器名称,不传表示进入主容器的WebTerminal

--IsShared

Boolean

否

是否创建用于分享的进入容器链接,取值如下:
true:返回进入容器的分享链接。该链接将在三十秒后失效,且仅能被使用一次。一旦通过该链接进入容器后,其他使用该链接进入容器的请求将无效。
false:返回普通的进入容器的分享链接,使用时需进行阿里云身份认证。该链接将在三十秒后失效

--JobId

String

否

任务ID

--PodId

String

否

任务Pod ID

--PodUid

String

否

Pod UID

示例

aliyun pai-dlc GET /api/v1/jobs/dlc-20210126170216-000000/pods/dlc-20210126170216-0000-chief-0/webterminal --region cn-hangzhou --IsShared true --PodUid '94a7cc7c-0033-48b5-85bd-71c63592****' --ContainerName 'sidecar-test' --header "Content-Type=application/json"

ListEcsSpecs

命令描述

查询当前支持的机器资源配置列表

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/ecsspecs

语法

aliyun pai-dlc ListEcsSpecs
    [--AcceleratorType <string>]
    [--InstanceTypes <string>]
    [--Order <string>]
    [--PageNumber <int>]
    [--PageSize <int>]
    [--ResourceType <string>]
    [--SortBy <string>]
    [options]

参数

参数

类型

必填

说明

--AcceleratorType

String

否

按加速器类型过滤。取值如下:
CPU
GPU

--InstanceTypes

String

否

需要查询的机器规格列表,以半角逗号(,)分隔

--Order

String

否

排序顺序,取值如下:
desc:逆序排列。
asc:升序排列

--PageNumber

Integer

否

查询第几页数据,起始值为1

--PageSize

Integer

否

分页查询时每页显示的数量

--ResourceType

String

否

资源类型,取值如下:
ECS
Lingjun

--SortBy

String

否

按返回字段排序。取值如下:
CPU
GPU
Memory
GmtCreateTime



示例

aliyun pai-dlc GET /api/v1/ecsspecs --region cn-hangzhou --Order desc --PageSize 10 --PageNumber 1 --SortBy GPU --ResourceType ECS --InstanceTypes 'ecs.g6.large,ecs.g6.xlarge' --AcceleratorType GPU --header "Content-Type=application/json"

ListJobSanityCheckResults

命令描述

获取某个DLC任务所有算力健康检测的检测结果

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{JobId}/sanitycheckresults

语法

aliyun pai-dlc ListJobSanityCheckResults
    --JobId <string>
    [--Order <string>]
    [options]

参数

参数

类型

必填

说明

--JobId

String

是

任务ID。参见https://help.aliyun.com/document_detail/459676.html获取

--Order

String

否

排列顺序:
desc(降序)
asc(升序)

示例

aliyun pai-dlc GET /api/v1/jobs/dlc-20210114104214-xxxx/sanitycheckresults --region cn-hangzhou --header "Content-Type=application/json"

ListJobTemplates

命令描述

按工作空间列出任务模板,支持分页与排序;可按创建者、TemplateId、TemplateName 筛选

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobtemplates

语法

aliyun pai-dlc ListJobTemplates
    [--Description <string>]
    [--Order <string>]
    [--PageNumber <int>]
    [--PageSize <int>]
    [--SortBy <string>]
    [--TemplateId <string>]
    [--TemplateName <string>]
    [--UserId <string>]
    --WorkspaceId <string>
    [options]

参数

参数

类型

必填

说明

--Description

String

否

按模板描述模糊筛选

  • 约束:

    • 最大长度:1024

--Order

String

否

排序顺序

  • 约束:

    • 允许值:["asc", "desc"]

--PageNumber

Integer

否

页码

  • 约束:

    • 最小值:1

--PageSize

Integer

否

每页数量

  • 约束:

    • 最大值:100

    • 最小值:1

--SortBy

String

否

排序字段

  • 约束:

    • 允许值:["GmtCreateTime", "GmtModifyTime", "TemplateName", "LastUsedTime"]

--TemplateId

String

否

按模板 ID 精确筛选列表

  • 约束:

    • 最大长度:128

--TemplateName

String

否

按模板名称模糊筛选列表

  • 约束:

    • 最大长度:256

--UserId

String

否

用户 ID

--WorkspaceId

String

是

工作空间 ID

示例

aliyun pai-dlc GET /api/v1/jobtemplates --region cn-hangzhou --WorkspaceId '4***9' --header "Content-Type=application/json"

ListJobs

命令描述

获取任务列表,支持分页、排序和按条件过滤

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs

语法

aliyun pai-dlc ListJobs
    [--Accessibility <string>]
    [--BusinessUserId <string>]
    [--Caller <string>]
    [--Description <string>]
    [--DisplayName <string>]
    [--DisplayNameSearchMode <string>]
    [--EnableAssignNode <string>]
    [--EndTime <string>]
    [--FromAllWorkspaces <bool>]
    [--ImageSearch <string>]
    [--JobId <string>]
    [--JobIds <string>]
    [--JobType <string>]
    [--NumericRangeField <string>]
    [--NumericRangeMax <int>]
    [--NumericRangeMin <int>]
    [--Order <string>]
    [--OversoldInfo <string>]
    [--PageNumber <int>]
    [--PageSize <int>]
    [--PaymentType <string>]
    [--PipelineId <string>]
    [--ReasonSearch <string>]
    [--ResourceId <string>]
    [--ResourceIds <string>]
    [--ResourceQuotaName <string>]
    [--ShowOwn <bool>]
    [--SortBy <string>]
    [--StartTime <string>]
    [--Status <string>]
    [--Tags <map>]
    [--TemplateId <string>]
    [--TimeRangeField <string>]
    [--UserCommandSearch <string>]
    [--UserIdForFilter <string>]
    [--Username <string>]
    [--WorkspaceId <string>]
    [options]

参数

参数

类型

必填

说明

--Accessibility

String

否

作业的可见性,取值如下:
PUBLIC:在此工作空间中,对所有人可见。
PRIVATE(默认值):在此工作空间中,仅对您和管理员可见

  • 约束:

    • 允许值:["PRIVATE", "PUBLIC"]

--BusinessUserId

String

否

任务关联用户ID

--Caller

String

否

调用方

--Description

String

否

用于全文搜索任务描述的关键词

--DisplayName

String

否

任务名称,支持模糊查询,大小写不敏感,不支持通配符。
例如:输入test,可以匹配test-job1、job-test、job-test2或job-Test;但是不能匹配job-t1。
默认为空,代表任意任务名称

  • 约束:

    • 最大长度:1024

--DisplayNameSearchMode

String

否

DisplayName搜索模式。默认为通配符匹配

  • 约束:

    • 允许值:["fulltext", "prefix", "term", "wildcard"]

--EnableAssignNode

String

否

筛选是否启用指定节点运行的任务

  • 约束:

    • 允许值:["false", "true"]

--EndTime

String

否

查询区间的截止时间;使用任务的创建时间来过滤。默认值是当前时刻

--FromAllWorkspaces

Boolean

否

是否跨工作空间获取任务列表,需要配合ShowOwn=true参数使用,可以查询当前用户最近提交的任务列表

--ImageSearch

String

否

在镜像(images)字段中进行全文检索,支持中英文分词

--JobId

String

否

任务ID,不支持模糊查询,对大小写不敏感。不支持通配符。
默认为空,代表任意任务ID

--JobIds

String

否

任务ID列表,多个ID用英文逗号分隔。与JobId同时设置时,以JobId为准

--JobType

String

否

任务类型,默认为空,代表所有类型。支持的任务类型如下:
TFJob
PyTorchJob
XGBoostJob
OneFlowJob
ElasticBatchJob




  • 约束:

    • 最大长度:32

--NumericRangeField

String

否

数值范围筛选的字段名。需配合NumericRangeMin/NumericRangeMax使用

--NumericRangeMax

Integer

否

数值范围筛选的最大值(包含)。需配合NumericRangeField使用

--NumericRangeMin

Integer

否

数值范围筛选的最小值(包含)。需配合NumericRangeField使用

--Order

String

否

排列顺序,支持:
desc:降序,默认值。
asc:升序

  • 约束:

    • 允许值:["asc", "desc"]

--OversoldInfo

String

否

闲时资源信息,可能的取值
ForbiddenQuotaOverSold
ForceQuotaOverSold
AcceptQuotaOverSold-true (true表示作业实际使用了闲时资源)
AcceptQuotaOverSold-false (false表示作业实际使用了保障资源)



--PageNumber

Integer

否

分页查询,指定当前需要返回的页码,起始值为1,默认为1

  • 约束:

    • 最大值:1000

    • 最小值:1

--PageSize

Integer

否

每页返回的任务数量

  • 约束:

    • 最大值:100

    • 最小值:1

--PaymentType

String

否

资源类型,取值如下:
PrePaid:资源配额
Spot:竞价资源
PostPaid:公共资源


--PipelineId

String

否

过滤指定工作流ID创建的任务

--ReasonSearch

String

否

在任务失败原因(reason)字段中进行全文检索,支持中英文分词

--ResourceId

String

否

资源组ID。如何查询专有资源组ID,详情请参见https://help.aliyun.com/document_detail/2651299.html

--ResourceIds

String

否

按资源 ID 列表筛选任务

--ResourceQuotaName

String

否

按资源配额的名字,过滤查询任务列表。支持模糊匹配,不支持通配符。默认为空,表示不过滤资源配额

--ShowOwn

Boolean

否

是否只查询当前用户提交的任务列表

--SortBy

String

否

排序字段:
DisplayName
JobType
Status
GmtCreateTime
GmtFinishTime




--StartTime

String

否

查询区间的起始时间;使用任务的创建时间来过滤。默认值是当前时间减去7天,即:如果StartTime与EndTime都没有配置时,默认查询最近7天的任务列表

--Status

String

否

任务运行状态,可能值:
Creating
Queuing
Bidding (当前仅限灵骏Spot作业)
EnvPreparing
SanityChecking
Running
Restarting
Stopping
SucceededReserving
FailedReserving
Succeeded
Failed
Stopped












  • 约束:

    • 最大长度:200

--Tags

Map

否

用于过滤的标签

--TemplateId

String

否

模板ID,用于筛选由指定模板创建的任务

--TimeRangeField

String

否

指定StartTime/EndTime筛选使用的时间字段。不填默认为创建时间

--UserCommandSearch

String

否

在用户命令(user_command)字段中进行全文检索,支持中英文分词

--UserIdForFilter

String

否

按任务提交者的用户ID,过滤查询任务列表

--Username

String

否

按任务提交者的用户名,过滤查询任务列表。支持模糊查询,不支持通配符。默认为空,表示不过滤用户名

--WorkspaceId

String

否

工作空间ID。如何获取工作空间ID,请参见https://help.aliyun.com/document_detail/449124.html。

示例

aliyun pai-dlc GET /api/v1/jobs --region cn-hangzhou --Description 'This is a training job' --EndTime '2025-04-16T07:26:41Z' --PageSize 50 --Accessibility PRIVATE --NumericRangeMax 8 --SortBy GmtCreateTime --WorkspaceId '1****' --JobIds dlc123abc --ReasonSearch OOM --OversoldInfo ForbiddenQuotaOverSold --NumericRangeMin 4 --TimeRangeField GmtFinishTime --ResourceIds 'example-string' --PageNumber 1 --DisplayNameSearchMode wildcard --DisplayName 'tf-mnist-test' --ShowOwn true --PipelineId 'flow-*******' --PaymentType PostPaid --BusinessUserId '16****' --Tags '{"key":"recommandation"}' --JobId 'dlc********' --UserCommandSearch 'python train.py' --TemplateId 'tmlabc123	' --Status Running --Order desc --UserIdForFilter '20**************' --StartTime '2025-04-16T07:25:34Z' --EnableAssignNode true --JobType TFJob --ImageSearch pytorch --ResourceId 'r*****' --Caller local --Username 'test***' --NumericRangeField RequestGPU --FromAllWorkspaces false --ResourceQuotaName 'quota***' --header "Content-Type=application/json"

ListRayHistoryServers

命令描述

列出资源RayHistoryServer

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/rayhistoryservers

语法

aliyun pai-dlc ListRayHistoryServers
    [--DisplayName <string>]
    [--EndTime <string>]
    [--IdPrefix <string>]
    [--ModifiedAfter <string>]
    [--Order <string>]
    [--PageNumber <int>]
    [--PageSize <int>]
    [--PaymentType <string>]
    [--ResourceId <string>]
    [--ShowOwn <bool>]
    [--SortBy <string>]
    [--StartTime <string>]
    [--Status <string>]
    [--StoragePath <string>]
    [--UserIdForFilter <string>]
    [--Username <string>]
    [--WorkspaceId <string>]
    [options]

参数

参数

类型

必填

说明

--DisplayName

String

否

任务的显示名称

--EndTime

String

否

查询区间的截止时间;使用任务的创建时间来过滤

--IdPrefix

String

否

ID前缀

--ModifiedAfter

String

否

按修改后时间过滤

--Order

String

否

排序顺序。
desc:降序。
asc:升序

--PageNumber

Integer

否

分页查询,指定当前需要返回的页码,从1开始往后编号

--PageSize

Integer

否

分页查询中,指定每页返回的RayHistoryServer数量

--PaymentType

String

否

付费类型。
PrePaid
PostPaid

--ResourceId

String

否

资源组ID。如何查询专有资源组ID,详情请参见https://help.aliyun.com/document_detail/2651299.html

--ShowOwn

Boolean

否

是否只返回当前登录者所创建的RayHistoryServer

--SortBy

String

否

按返回的以下字段排序。
DisplayName
GmtCreateTime
UserId
ResourceId
Status
GmtModifyTime





--StartTime

String

否

开始时间

--Status

String

否

RayHistoryServer 状态:
Creating:创建中。
Queuing:排队中。
Running:运行中。
Stopped:已停止。
Failed:已失败




--StoragePath

String

否

Ray 日志存储路径

--UserIdForFilter

String

否

按用户ID过滤

--Username

String

否

按用户名称过滤

--WorkspaceId

String

否

工作空间ID。如何获取工作空间ID,请参见https://help.aliyun.com/document_detail/449124.html。

示例

aliyun pai-dlc GET /api/v1/rayhistoryservers --region cn-hangzhou --Status running --Order desc --PageSize 10 --EndTime '2020-11-09T16:00:00Z' --SortBy GmtCreateTime --UserIdForFilter 123456789 --WorkspaceId 268 --StartTime '2020-11-08T16:00:00Z' --ModifiedAfter '2020-11-09T16:00:00Z' --IdPrefix '按ID前缀过滤' --StoragePath 'oss://bucket-test-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/tmp' --PageNumber 1 --ResourceId quotaxxx --Username myusername --DisplayName test --ShowOwn true --PaymentType Postpaid --header "Content-Type=application/json"

ListSignals

命令描述

查询指定作业的所有信号记录

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/jobs/{JobId}/signals

语法

aliyun pai-dlc ListSignals
    [--JobId <string>]
    [--Order <string>]
    [--PageNumber <string>]
    [--PageSize <string>]
    [--SortBy <string>]
    [--Status <string>]
    [--Token <string>]
    [options]

参数

参数

类型

必填

说明

--JobId

String

否

作业 Id

--Order

String

否

排序顺序

--PageNumber

String

否

当前页数

--PageSize

String

否

分页大小

--SortBy

String

否

排序字段

--Status

String

否

信号状态

--Token

String

否

用于鉴权的临时令牌

示例

aliyun pai-dlc GET /api/v1/jobs/dlc-20210126170216-mtl37ge7gkvdz/signals --region cn-hangzhou --Status Succeeded --Order desc --PageSize 20 --PageNumber 1 --SortBy GmtCreateTime --Token 'eyXXXX-XXXX.XXXXX' --header "Content-Type=application/json"

ListTensorboards

命令描述

查询已创建的Tensorboard列表

HTTP 方法:GET

protocol:HTTPS

url:/api/v1/tensorboards

语法

aliyun pai-dlc ListTensorboards
    [--Accessibility <string>]
    [--DisplayName <string>]
    [--EndTime <string>]
    [--JobId <string>]
    [--Order <string>]
    [--PageNumber <int>]
    [--PageSize <int>]
    [--PaymentType <string>]
    [--QuotaId <string>]
    [--ShowOwn <bool>]
    [--SortBy <string>]
    [--SourceId <string>]
    [--SourceType <string>]
    [--StartTime <string>]
    [--Status <string>]
    [--TensorboardId <string>]
    [--UserId <string>]
    [--Username <string>]
    [--Verbose <bool>]
    [--WorkspaceId <string>]
    [options]

参数

参数

类型

必填

说明

--Accessibility

String

否

任务的可见性。
PUBLIC:在此工作空间中,对所有人可见。
PRIVATE:在此工作空间中,仅对您和管理员可见

--DisplayName

String

否

Tensorboard展示名称

--EndTime

String

否

查询区间的截止时间。使用Tensorboard的创建UTC时间来过滤。若为空,则默认为当前时间

--JobId

String

否

根据DLC任务ID来过滤Tensorboard任务。参见https://help.aliyun.com/document_detail/459676.html获取任务ID

--Order

String

否

排序顺序。
desc:降序。
asc:升序

--PageNumber

Integer

否

分页查询,指定当前需要返回的页码,起始值为1

  • 约束:

    • 最大值:1000

    • 最小值:1

--PageSize

Integer

否

分页查询中,指定每页返回的Tensorboard数量

  • 约束:

    • 最大值:100

    • 最小值:1

--PaymentType

String

否

Tensorboard任务的付费类型。
Free代表使用了免费资源的Tensorboard任务。
Postpaid代表使用了后付费资源的Tensorboard任务

--QuotaId

String

否

资源配额ID。
当前仅白名单用户可以使用资源配额资源创建Tensorboard任务,若需要使用该功能,请和我们联系。
当前仅当Tensorboard任务使用资源配额的资源时,该值有效

--ShowOwn

Boolean

否

是否只返回当前登录者所创建的Tensorboard

--SortBy

String

否

按返回的以下字段排序。
DisplayName:任务名称。
GmtCreateTime:任务创建时间

--SourceId

String

否

数据来源ID。参见https://help.aliyun.com/document_detail/459676.html获取任务ID

--SourceType

String

否

数据来源。目前仅支持DLC训练任务,即job

--StartTime

String

否

查询区间的起始时间。使用Tensorboard的创建UTC时间来过滤。若为空,则默认为当前时间的7天之前

--Status

String

否

Tensorboard状态:
Creating:创建中。
Running:运行中。
Stopped:已停止。
Succeeded:已成功。
Failed:已失败




--TensorboardId

String

否

根据Tensorboard ID,来过滤Tensorboard列表

--UserId

String

否

用户ID

--Username

String

否

用户名

--Verbose

Boolean

否

是否显示详情。
true:显示详情。
false:不显示详情

--WorkspaceId

String

否

工作空间ID。根据工作空间ID来获取Tensorboard列表。参见https://help.aliyun.com/document_detail/449124.html获取工作空间ID。

示例

aliyun pai-dlc GET /api/v1/tensorboards --region cn-hangzhou --Status Running --Order desc --QuotaId 'quota12***
' --Verbose true --EndTime '2020-11-09T14:45:00Z' --PageSize 50 --Accessibility PRIVATE --SortBy GmtCreateTime --SourceType job --SourceId 'dlc-xxxxxx' --WorkspaceId 380 --StartTime '2020-11-08T16:00:00Z' --TensorboardId 'tensorboard-xxx' --PageNumber 1 --Username 'she****mo' --UserId '161****3000' --DisplayName TestTensorboard --ShowOwn false --PaymentType Postpaid --JobId 'dlc-xxx' --header "Content-Type=application/json"

SetJobTemplateDefaultVersion

命令描述

设置模板默认版本

contentType:application/json

HTTP 方法:PUT

protocol:HTTPS

requestBodyType:json

url:/api/v1/jobtemplates/{TemplateId}/defaultversion

语法

aliyun pai-dlc SetJobTemplateDefaultVersion
    --TemplateId <string>
    [--body <string>]
    [options]

参数

参数

类型

必填

说明

--TemplateId

String

是

模板 ID

  • 约束:

    • 最大长度:128

--body

String

否

请求Body参数

示例

aliyun pai-dlc PUT /api/v1/jobtemplates/tplmceolmf20000/defaultversion --region cn-hangzhou --header "Content-Type=application/json" --body '{"Version":2}'

StartRayHistoryServer

命令描述

启动 Ray History Server

HTTP 方法:POST

protocol:HTTPS

url:/api/v1/rayhistoryservers/{RayHistoryServerId}/start

语法

aliyun pai-dlc StartRayHistoryServer
    [--RayHistoryServerId <string>]
    [options]

参数

参数

类型

必填

说明

--RayHistoryServerId

String

否

请求的 Ray History Server ID

示例

aliyun pai-dlc POST /api/v1/rayhistoryservers/rhsxxx/start --region cn-hangzhou --header "Content-Type=application/json"

StartTensorboard

命令描述

启动一个Tensorboard

HTTP 方法:PUT

protocol:HTTPS

url:/api/v1/tensorboards/{TensorboardId}/start

语法

aliyun pai-dlc StartTensorboard
    --TensorboardId <string>
    [--WorkspaceId <string>]
    [options]

参数

参数

类型

必填

说明

--TensorboardId

String

是

Tensorboard ID。如何获取Tensorboard ID,请参见https://help.aliyun.com/document_detail/459689.html

  • 约束:

    • 最大长度:256

    • 最小长度:1

--WorkspaceId

String

否

工作空间ID。如何获取工作空间ID,请参见https://help.aliyun.com/document_detail/449124.html。

示例

aliyun pai-dlc PUT /api/v1/tensorboards/tensorboard-20210114104214-vf9lowjt3pso/start --region cn-hangzhou --header "Content-Type=application/json"

StopJob

命令描述

停止一个正在运行的任务

HTTP 方法:POST

protocol:HTTPS

url:/api/v1/jobs/{JobId}/stop

语法

aliyun pai-dlc StopJob
    [--JobId <string>]
    [options]

参数

参数

类型

必填

说明

--JobId

String

否

任务ID。如何获取任务ID,请参见https://help.aliyun.com/document_detail/459676.html

示例

aliyun pai-dlc POST /api/v1/jobs/dlc-20210126170216-xxxxxx/stop --region cn-hangzhou --header "Content-Type=application/json"

StopRayHistoryServer

命令描述

停止 Ray History Server

HTTP 方法:POST

protocol:HTTPS

url:/api/v1/rayhistoryservers/{RayHistoryServerId}/stop

语法

aliyun pai-dlc StopRayHistoryServer
    [--RayHistoryServerId <string>]
    [options]

参数

参数

类型

必填

说明

--RayHistoryServerId

String

否

请求的 Ray History Server ID

示例

aliyun pai-dlc POST /api/v1/rayhistoryservers/rhsxxx/stop --region cn-hangzhou --header "Content-Type=application/json"

StopTensorboard

命令描述

停止一个Tensorboard

HTTP 方法:PUT

protocol:HTTPS

url:/api/v1/tensorboards/{TensorboardId}/stop

语法

aliyun pai-dlc StopTensorboard
    --TensorboardId <string>
    [--WorkspaceId <string>]
    [options]

参数

参数

类型

必填

说明

--TensorboardId

String

是

Tensorboard ID。如何获取Tensorboard ID,请参见https://help.aliyun.com/document_detail/459689.html

  • 约束:

    • 最大长度:256

    • 最小长度:1

--WorkspaceId

String

否

工作空间ID。如何获取工作空间ID,请参见https://help.aliyun.com/document_detail/449124.html。

示例

aliyun pai-dlc PUT /api/v1/tensorboards/tensorboard-20210114104214-vf9lowjt3pso/stop --region cn-hangzhou --header "Content-Type=application/json"

TagResources

命令描述

新增标签接口

contentType:application/json

HTTP 方法:POST

protocol:HTTPS

requestBodyType:json

url:/api/v1/tags

语法

aliyun pai-dlc TagResources
    [--body <string>]
    [options]

参数

参数

类型

必填

说明

--body

String

否

请求 body

示例

aliyun pai-dlc POST /api/v1/tags --region cn-hangzhou --header "Content-Type=application/json" --body '{"ResourceId":["dlcxxxxxx"],"ResourceType":"Job","RegionId":"cn-hangzhou"}'

UntagResources

命令描述

为指定的资源列表统一解绑标签

HTTP 方法:DELETE

protocol:HTTPS

url:/api/v1/tags

语法

aliyun pai-dlc UntagResources
    [--All <string>]
    --ResourceId <array>
    --ResourceType <string>
    [--TagKey <array>]
    [options]

参数

参数

类型

必填

说明

--All

String

否

是否解绑实例上的所有标签,取值:
true:解绑实例上的所有标签。
false:不解绑实例上的所有标签。
默认值为 false


--ResourceId

List

是

资源 ID,最多 50 个子项

--ResourceType

String

是

资源类型

--TagKey

List

否

对应标签键列表,最多包含 20 个子项

示例

aliyun pai-dlc DELETE /api/v1/tags --region cn-hangzhou --ResourceId '["dlcxxxxxx"]' --ResourceType Job --header "Content-Type=application/json"

UpdateJob

命令描述

更新一个任务的配置信息,例如修改一个排队中任务的优先级

contentType:application/json

HTTP 方法:PUT

protocol:HTTPS

requestBodyType:json

url:/api/v1/jobs/{JobId}

语法

aliyun pai-dlc UpdateJob
    [--JobId <string>]
    [--body <string>]
    [options]

参数

参数

类型

必填

说明

--JobId

String

否

任务ID。如何获取任务ID,请参见https://help.aliyun.com/document_detail/459676.html

--body

String

否

任务配置

示例

aliyun pai-dlc PUT /api/v1/jobs/dlc0000000000000 --region cn-hangzhou --header "Content-Type=application/json" --body '{"JobSpecs":[{"HyperNodeSchedulingConfig":{"QualityPolicy":"AlwaysRequire","MinAvailable":1},"QuotaId":"quota12345","ServiceSpec":{"ExtraPorts":[8081],"ServiceMode":"PerRole","DefaultPort":8080},"AssignNodeSpec":{"AntiAffinityNodeNames":"lingjxxxxxxxx","AntiAffinityHyperNodes":[{"HyperNodeName":"mg1234567","NodeNames":"lingjxxxxxxxx"}],"EnableAssignNode":true,"HyperNodes":[{"HyperNodeName":"mg1234567","NodeNames":"lingjxxxxxxxx"}],"NodeNames":"lingjxxxxxxxx"},"Driver":"535.54.03","Image":"registry-vpc.cn-hangzhou.aliyuncs.com/cloud-dsw/tensorflow:1.12PAI-gpu-py36-cu101-ubuntu18.04","PodCount":1,"SystemDisk":{"Category":"cloud_essd","PerformanceLevel":"PL1","Size":200},"SpotSpec":{"SpotDiscountLimit":0.8,"SpotPriceLimit":0.4744,"SpotStrategy":"SpotWithPriceLimit"},"ConsiderInSuccessPolicy":true,"IsCheif":true,"ResourceConfig":{"GPUType":"Tesla-V100-16G","Memory":"10Gi","CPU":"10","SharedMemory":"5Gi","GPU":"3"},"IsChief":true,"ImageConfig":{"DockerRegistry":"docker****registry.com","Username":" username","Auth":"example-string","Password":"password"},"UseSpotInstance":false,"EcsSpec":"ecs.c6.large","RestartPolicy":"ExitCode","UserCommand":"python train.py","Type":"Worker","ElasticSpotSpecs":[{"SpotDiscountLimit":0.8,"SpotPriceLimit":0.4744,"InstanceType":"ecs.gn6e-c12g1.3xlarge","SpotStrategy":"SpotWithPriceLimit"}],"AutoScalingSpec":{"AutoscalingMetricSpec":{"MetricName":"POD_CPU_UTIL","TargetValue":80,"Tolerance":"0.1","StabilizationWindowSeconds":60},"ScalingStrategy":"Default","MinReplicas":1,"MaxReplicas":10,"PodsToDelete":["pod-a"]},"LocalMountSpecs":[{"MountPath":"/mnt/data","MountMode":"Filesystem","LocalPath":"/local/a"}],"OversoldType":"AcceptQuotaOverSold","ExtraPodSpec":{"InitContainers":[{"WorkingDir":"/root","Args":["-v"],"Command":["curl www.aliyun.com"],"SecurityContext":{"RunAsUser":1000,"Capabilities":{"Add":["NET_ADMIN"],"Drop":["NET_ADMIN"]},"Privileged":true,"RunAsGroup":1000,"SeccompProfile":{"Type":"Unconfined","LocalhostProfile":"my-profiles/profile-allow.json"}},"Resources":{"Limits":{"key":"{'"'"'cpu'"'"': '"'"'1'"'"', '"'"'memory'"'"': '"'"'1000Mi'"'"'}"},"Requests":{"key":"{'"'"'cpu'"'"': '"'"'1'"'"', '"'"'memory'"'"': '"'"'1000Mi'"'"'}"}},"Env":[{"Value":"true","Name":"ENABLE_DEBUG"}],"Image":"registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0","Name":"data-init"}],"PodAnnotations":{"key":"example-annotation"},"SideCarContainers":[{"WorkingDir":"/root","Args":["-v"],"Command":["curl www.aliyun.com"],"SecurityContext":{"RunAsUser":1000,"Capabilities":{"Add":["NET_ADMIN"],"Drop":["NET_ADMIN"]},"Privileged":true,"RunAsGroup":1000,"SeccompProfile":{"Type":"Unconfined","LocalhostProfile":"my-profiles/profile-allow.json"}},"Resources":{"Limits":{"key":"{'"'"'cpu'"'"': '"'"'1'"'"', '"'"'memory'"'"': '"'"'1000Mi'"'"'}"},"Requests":{"key":"{'"'"'cpu'"'"': '"'"'1'"'"', '"'"'memory'"'"': '"'"'1000Mi'"'"'}"}},"Env":[{"Value":"true","Name":"ENABLE_DEBUG"}],"Image":"registry.cn-hangzhou.aliyuncs.com/pai-dlc/curl:v1.0.0","Name":"data-init"}],"Lifecycle":{"PreStop":{"Exec":{"Command":["/bin/sh"]}},"PostStart":{"Exec":{"Command":["echo"]}}},"MainContainerSecurityContext":{"RunAsUser":1000,"Capabilities":{"Add":["NET_ADMIN"],"Drop":["NET_ADMIN"]},"Privileged":true,"RunAsGroup":1000,"SeccompProfile":{"Type":"Unconfined","LocalhostProfile":"my-profiles/profile-allow.json"}},"SharedVolumeMountPaths":["/root/share/"],"PodLabels":{"key":"example-lable"}},"StartupDependencies":[{"Type":"Worker","MinReplicas":"1","OnPhase":"ServiceReady"}]}],"UserCommand":"sleep 1d","Description":"This is a training job","Accessibility":"PUBLIC","Priority":5}'

UpdateJobTemplate

命令描述

更新任务模板

contentType:application/json

HTTP 方法:PUT

protocol:HTTPS

requestBodyType:json

url:/api/v1/jobtemplates/{TemplateId}

语法

aliyun pai-dlc UpdateJobTemplate
    --TemplateId <string>
    [--body <string>]
    [options]

参数

参数

类型

必填

说明

--TemplateId

String

是

任务模板的唯一标识

  • 约束:

    • 最大长度:128

--body

String

否

请求Body参数

示例

aliyun pai-dlc PUT /api/v1/jobtemplates/tplmceolmf20000 --region cn-hangzhou --header "Content-Type=application/json"

UpdateTensorboard

命令描述

更新一个Tensorboard

HTTP 方法:PUT

protocol:HTTPS

url:/api/v1/tensorboards/{TensorboardId}

语法

aliyun pai-dlc UpdateTensorboard
    [--Accessibility <string>]
    [--MaxRunningTimeMinutes <int>]
    [--Priority <string>]
    --TensorboardId <string>
    [--WorkspaceId <string>]
    [options]

参数

参数

类型

必填

说明

--Accessibility

String

否

任务的可见性,取值如下:
PUBLIC:在此工作空间中,对所有人可见。
PRIVATE:在此工作空间中,仅对您和管理员可见

--MaxRunningTimeMinutes

Integer

否

最长运行时长,单位为:分钟

--Priority

String

否

Tensorboard 任务的调度优先级,取值范围为 1~9;1 为最低优先级,9 为最高优先级

--TensorboardId

String

是

Tensorboard ID。如何获取Tensorboard ID,请参见https://help.aliyun.com/document_detail/459689.html

  • 约束:

    • 最大长度:256

    • 最小长度:1

--WorkspaceId

String

否

工作空间ID。如何获取工作空间ID,请参见https://help.aliyun.com/document_detail/449124.html。

示例

aliyun pai-dlc PUT /api/v1/tensorboards/tensorboard-20210114104214-vf9lowjt3pso --region cn-hangzhou --header "Content-Type=application/json"

全局选项

以下为 CLI 通用选项,各选项的适用范围以说明为准。

选项

说明

--cli-dry-run

使用 --cli-dry-run 在执行校验后以人类可读格式输出请求详情,跳过实际运行

--cli-input-json

使用 --cli-input-json foo.json 从 JSON 对象读取产品 API 参数,命令行显式参数覆盖文件值

--cli-output

设置宿主 CLI Help、本地错误和更新检查的输出格式(json)

--cli-query

使用 --cli-query <jmespath> 通过 JMESPath 表达式过滤输出结果

--cli-sign-version

短横线命令的 OpenAPI 签名版本:当前仅支持 v4;设为空值可清空并恢复默认签名(aliyun configure set 可写入 Profile)

--language

使用 --language [en|zh] 来指定语言

--output -o

使用 --output cols=Field1,Field1 [rows=jmesPath] 使用表格方式打印输出

--profile -p

使用 --profile <profileName> 指定操作的配置集

--region

使用 --region <regionId> 来指定访问大区

--version --api-version

使用 --version <YYYY-MM-DD> 来指定访问的API版本

--yes -y

跳过安全策略的确认提示(用于非交互式/Agent 场景)