Querying the Details About a Model

Function

This API is used to query details about a model based on the model ID.

URI

GET /v1/{project_id}/models/{model_id}

Table 1 describes the required parameters.
Table 1 Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

model_id

Yes

String

Model ID

Request Body

None

Response Body

Table 2 describes the response parameters.
Table 2 Parameters

Parameter

Type

Description

model_id

String

Model ID

model_name

String

Model name

model_version

String

Model version

create_at

Long

Time when a model is created, in milliseconds calculated from 1970.1.1 0:0:0 UTC

tenant

String

Tenant to which a model belongs

project

String

Project to which a model belongs

owner

String

User to which a model belongs

source_location

String

OBS path where the model is located or the SWR image location

source_job_id

String

ID of the source training job

source_job_version

String

Version of the source training job

source_type

String

Model source type. If a model is deployed through ExeML, the value is auto. If a model is deployed through a training job or an OBS model file, this parameter is left blank.

model_type

String

Model type. The value can be TensorFlow, MXNet, Spark_MLlib, Scikit_Learn, XGBoost, Image, or PyTorch.

model_size

Long

Model size, in bytes

model_status

String

Model status

runtime

String

Model runtime environment

description

String

Model description

execution_code

String

OBS path for storing the execution code. The name of the execution code file is fixed to customize_service.py.

schema_doc

String

Download address of the model schema file

image_address

String

image path generated after model packaging

input_params

params array

Collection of input parameters of a model. For details, see Table 3.

output_params

params array

Collection of output parameters of a model. For details, see Table 3.

dependencies

dependency array

Package required for running the inference code and model. For details, see Table 4.

model_metrics

String

Model precision

apis

String

All input and output apis parameter information of a model, which is obtained from the model preview

model_source

String

Model source. Options:

  • auto: ExeML
  • algos: built-in algorithm
  • custom: custom model

tunable

Boolean

Whether a model can be tuned. Options:

  • true: yes
  • false: no

market_flag

Boolean

Whether a model is subscribed from the marketplace. Options:

  • true: yes
  • false: no

publishable_flag

Boolean

Whether a model can be published to the marketplace. Options:

  • true: yes
  • false: no

model_docs

GuideDoc array

List of template documents. For details, see Table 7.

health

Object

Model health check interface information. For details, see Table 8.

model_algorithm

String

Model algorithm type. The value can be predict_analysis, object_detection, or image_classification.

model_labels

String array

Model label array.

labels_map

Object

Model label map. The key is fixed to labels, and the value is the model label array.

workspace_id

String

ID of the workspace to which a service belongs. The default value is 0, indicating the default workspace.

install_type

String array

Supported service type for deployment.

specification

Object

Minimum model deployment specifications. For details, see Table 9.

config

String

Model configurations.

Table 3 params parameters

Parameter

Type

Description

url

String

API URL

method

String

Request method, for example, post

protocol

String

Request protocol, for example, HTTP

param_name

String

Parameter name, which contains a maximum of 64 characters

param_type

String

Parameter type. The value can be int, string, float, timestamp, date, or file.

min

Number

This parameter is optional when param_type is set to int or float. By default, this parameter is left blank.

max

Number

This parameter is optional when param_type is set to int or float. By default, this parameter is left blank.

param_desc

String

Parameter description, which contains a maximum of 100 characters. By default, this parameter is left blank.

Table 4 dependency parameters

Parameter

Type

Description

installer

String

Installer

packages

package array

Collection of dependency packages. For details, see Table 5.

Table 5 package parameters

Parameter

Type

Description

package_name

String

Name of a dependency package

package_version

String

Version of a dependency package

restraint

String

Version restriction. The value can be EXACT, ATLEAST, or ATMOST.

Table 6 metric parameters

Parameter

Type

Description

f1

Double

F1 score

recall

Double

Recall

precision

Double

Precision

accuracy

Double

Accuracy

Table 7 GuideDoc parameters

Parameter

Type

Description

doc_name

String

Document name

doc_url

String

HTTP(S) link of the document

Table 8 Health parameters

Parameter

Type

Description

url

String

URL of the health check interface

protocol

String

Request protocol of the health check interface. Only HTTP is supported.

initial_delay_seconds

String

After an instance is started, a health check starts after seconds configured in initial_delay_seconds.

timeout_seconds

String

Health check timeout

Table 9 Specification parameters

Parameter

Type

Description

min_cpu

String

Minimum CPU

min_gpu

String

Minimum GPU

min_memory

String

Minimum memory capacity

Samples

The following shows how to query details about a model based on the model ID.

Status Code

For details about the status code, see Table 1.

Error Codes

See Error Codes.