文档

ListModelVersions - 获取模型版本列表

更新时间:

获取模型版本列表。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求语法

GET /api/v1/models/{ModelId}/versions

请求参数

名称类型必填描述示例值
PageNumberinteger

模型版本列表的页码。起始值为 1,默认为 1。

1
PageSizeinteger

分页查询时设置的每页行数。默认为 10。

10
Orderstring

分页查询时,对指定的排序字段进行升序或降序。默认 ASC。

  • ASC:升序。
  • DESC:降序。
DESC
SortBystring

分页查询时的排序字段。目前 GmtCreateTime 字段用于排序。

GmtCreateTime
VersionNamestring

配置模型版本名称,来过滤模型版本列表。

1.0.1
FormatTypestring

配置模型格式,来过滤模型版本列表。取值如下:

  • OfflineModel
  • SavedModel
  • Keras H5
  • Frozen Pb
  • Caffe Prototxt
  • TorchScript
  • XGBoost
  • PMML
  • AlinkModel
  • ONNX
SavedModel
FrameworkTypestring

配置模型框架,来过滤模型版本列表,取值如下:

  • Pytorch -XGBoost
  • Keras
  • Caffe
  • Alink
  • Xflow
  • TensorFlow
TensorFlow
ModelIdstring

模型 ID。如何获取模型 ID,请参见 ListModels

model-dajbueh******
SourceTypestring

根据模型来源类型,来过滤模型版本列表。取值如下:

  • Custom(默认值):自定义。
  • PAIFlow:PAI 工作流。
  • TrainingService:PAI 训练服务。
PAIFlow
SourceIdstring

来源 ID。

  • 来源类型为 Custom 时,该字段不做限制。
  • 来源为 PAIFlow、TrainingService 时,格式为
region=<region_id>,workspaceId=<workspace_id>,kind=<kind>,id=<id>

其中:

  • region 为阿里云区域 ID。
  • workspacceId 为工作空间 ID。
  • kind:为类型。取值:PipelineRun(PAIFlow 工作流);ServiceJob(训练服务)。
  • id:为唯一标识。
region=cn-shanghai,workspaceId=13**,kind=PipelineRun,id=run-sakdb****jdf
Labelstring

标签串。用于列表过滤,标签中 Key 或 Value 中,有指定字符串的,都会被过滤出来。

key1
ApprovalStatusstring

根据准入状态来过滤模型版本列表,取值如下:

  • Pending:待定。
  • Approved:允许上线。
  • Rejected:不允许上线。
Approved

返回参数

名称类型描述示例值
object

返回体。

RequestIdstring

请求 ID。

473469C7-AA6F-4DC5-B3DB-A3DC***3C83E
Versionsarray

模型版本列表。

ModelVersion

模型版本。

TotalCountlong

模型版本列表总数。

15

示例

正常返回示例

JSON格式

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC***3C83E",
  "Versions": [
    {
      "VersionName": "0.1.0",
      "GmtCreateTime": "2021-01-21T17:12:35Z",
      "GmtModifiedTime": "2021-01-21T17:12:35Z",
      "UserId": "155770209******",
      "OwnerId": "155770209******",
      "Uri": "oss://mybucket.oss-cn-beijing.aliyuncs.com/mypath/",
      "VersionDescription": "情感分析。",
      "Labels": [
        {
          "Key": "env",
          "Value": "test"
        }
      ],
      "FormatType": "SavedModel",
      "FrameworkType": "TensorFlow",
      "Options": "{}",
      "Metrics": {
        "Results": [
          {
            "Dataset": {
              "DatasetId": "d-sdkjanksaklerhfd"
            },
            "Metrics": {
              "cer": 0.175
            }
          },
          {
            "Dataset": {
              "Uri": "oss://xxxx/"
            },
            "Metrics": {
              "cer": 0.172
            }
          }
        ]
      },
      "TrainingSpec": {},
      "InferenceSpec": {
        "processor": "tensorflow_gpu_1.12"
      },
      "EvaluationSpec": {
        "test": "test",
        "test2": 1
      },
      "SourceType": "PAIFlow",
      "SourceId": "region=cn-shanghai,workspaceId=13**,kind=PipelineRun,id=run-sakdb****jdf",
      "ApprovalStatus": "Approved",
      "ExtraInfo": {
        "CoverUris": [
          "https://e***u.oss-cn-hangzhou.aliyuncs.com/st****017.preview.png"
        ],
        "TrainedWords": [
          "albedo_overlord"
        ]
      }
    }
  ],
  "TotalCount": 15
}

错误码

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2023-10-16API 内部配置变更,不影响调用看变更集
变更项变更内容
API 内部配置变更,不影响调用
  • 本页导读 (1)
文档反馈