Querying Algorithm Details
Function
This API is used to obtain the details of a specified algorithm on ModelArts.
This API applies to the following scenario: When you need to view the detailed configuration and attributes of a specific algorithm, you can use this API to obtain the algorithm details. Before using this API, ensure that you have obtained the algorithm ID and have the permission to view algorithm details. After the query is complete, the platform returns the details, including the algorithm name, description, and version. If the algorithm ID does not exist or you do not have the operation permission, the API will return an error message.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET /v2/{project_id}/algorithms/{algorithm_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: The value can contain 1 to 64 characters. Letters, digits, and hyphens (-) are allowed. Range: N/A Default Value: N/A |
algorithm_id |
Yes |
String |
Definition: Algorithm ID Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
metadata |
metadata object |
Definition: Algorithm metadata, which describes basic algorithm information. |
job_config |
job_config object |
Definition: Algorithm configuration, such as the boot file. |
resource_requirements |
Array of resource_requirements objects |
Definition: Algorithm resource constraints. This parameter is optional. After this parameter is set, the console filters available public resource pools when the algorithm is used in training jobs. |
advanced_config |
advanced_config object |
Definition: Advanced algorithm policy. |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Definition: Algorithm UUID. You do not need to set this parameter when creating an algorithm. Range: N/A |
name |
String |
Definition: Algorithm name. The value must contain 1 to 64 characters consisting of only digits, letters, underscores (_), and hyphens (-). Range: N/A |
description |
String |
Definition: Algorithm description, which consists of 0 to 256 characters. The default value is NULL. Range: N/A |
workspace_id |
String |
Definition: Workspace where a specified algorithm is located. The default value is 0. 0 is the default workspace. Range: N/A |
ai_project |
String |
Definition: AI project to which a specified algorithm belongs. The default value is default-ai-project. The AI project has been brought offline. Ignore it. Range: N/A |
user_name |
String |
Range: N/A |
domain_id |
String |
Definition: Domain ID of a user. Range: N/A |
source |
String |
Definition: Algorithm source type. Range: N/A |
api_version |
String |
Definition: Algorithm API version, which shows whether it is new or old. Range: N/A |
is_valid |
String |
Definition: Algorithm availability. Range: N/A |
state |
String |
Definition: Algorithm status. Range: N/A |
tags |
Array of Map<String,String> objects |
Definition: Algorithm tag. |
attr_list |
Array of strings |
Definition: Algorithm attributes. |
version_num |
Integer |
Definition: Number of algorithm versions. The default value is 0. Range: N/A |
size |
Integer |
Definition: Algorithm size. Range: N/A |
create_time |
Long |
Definition: Algorithm creation timestamp. Range: N/A |
update_time |
Long |
Definition: Algorithm update timestamp. Range: N/A |
Parameter |
Type |
Description |
---|---|---|
code_dir |
String |
Definition: Algorithm code directory, for example, /usr/app/. This parameter must be used together with boot_file. Range: N/A |
boot_file |
String |
Definition: Code boot file of the algorithm, which must be stored in the code directory, for example, /usr/app/boot.py. This parameter must be used with code_dir. Range: N/A |
command |
String |
Definition: Container boot command of a custom image algorithm. Range: N/A |
parameters |
Array of ParameterResp objects |
Definition: Running parameters of an algorithm. |
inputs |
Array of inputs objects |
Definition: Data input of an algorithm. |
outputs |
Array of outputs objects |
Definition: Data output of an algorithm. |
engine |
engine object |
Definition: Algorithm engine. |
code_tree |
Array of code_tree objects |
Definition: Algorithm directory tree. |
parameters_customization |
Boolean |
Definition: Specifies whether the algorithm allows hyperparameter customization during training job creation. Range: |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition: Parameter name. Range: N/A |
value |
String |
Definition: Parameter value. Range: N/A |
description |
String |
Definition: Parameter description. Range: N/A |
constraint |
constraint object |
Definition: Parameter attribute. |
i18n_description |
i18n_description object |
Definition: Internationalization description. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Definition: Parameter type. Range: N/A |
editable |
Boolean |
Definition: Whether the parameter can be edited. Range: |
required |
Boolean |
Definition: Whether the parameter is mandatory. Range: |
sensitive |
Boolean |
Definition: Whether the parameter is sensitive. This function is unavailable currently. Range: |
valid_type |
String |
Definition: Valid type. Range: N/A |
valid_range |
Array of strings |
Definition: Valid range. |
Parameter |
Type |
Description |
---|---|---|
language |
String |
Definition: Internationalization language. The options are as follows: Range: N/A |
description |
String |
Definition: Internationalization language description. Range: N/A |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition: Name of the data input channel. Range: N/A |
description |
String |
Definition: Description of the data input channel. Range: N/A |
remote_constraints |
Array of remote_constraints objects |
Definition: Data input constraint. |
Parameter |
Type |
Description |
---|---|---|
data_type |
String |
Definition: Data input type, including the data storage location and dataset. Range: N/A |
attributes |
Array of Map<String,String> objects |
Definition: Attributes when the data input type is a dataset. The value can be: |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition: Name of the data output channel. Range: N/A |
description |
String |
Definition: Description of the data output channel. Range: N/A |
Parameter |
Type |
Description |
---|---|---|
engine_id |
String |
Definition: Engine ID selected for an algorithm. Range: N/A |
engine_name |
String |
Definition: Engine version name selected for an algorithm. If engine_id is specified, leave this parameter blank. Range: N/A |
engine_version |
String |
Definition: Engine version name selected for an algorithm. If engine_id is specified, leave this parameter blank. Range: N/A |
image_url |
String |
Definition: Custom image URL selected for an algorithm. Range: N/A |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition: Name of the current directory in the algorithm directory tree. Range: N/A |
children |
Object |
Definition: Subfiles and subdirectories in the current directory of the algorithm directory tree. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Definition: Resource constraints. Range: |
value |
Array of strings |
Definition: Value of the resource constraint key. |
operator |
String |
Definition: Relationship between keys and values. Currently, only in is supported. For example, flavor_type in [CPU,GPU]. Range: N/A |
Parameter |
Type |
Description |
---|---|---|
auto_search |
auto_search object |
Definition: Hyperparameter search policy. |
Parameter |
Type |
Description |
---|---|---|
skip_search_params |
String |
Definition: Hyperparameter parameters that need to be skipped. Range: N/A |
reward_attrs |
Array of reward_attrs objects |
Definition: Search metrics. |
search_params |
Array of search_params objects |
Definition: Search parameters. |
algo_configs |
Array of algo_configs objects |
Definition: Search algorithm configurations. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition: Metric name. Range: N/A |
mode |
String |
Definition: Search mode. Range: |
regex |
String |
Definition: Regular expression of a metric. Range: N/A |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Definition: Search algorithm name. Range: N/A |
params |
Array of AutoSearchAlgoConfigParameterResp objects |
Definition: Search algorithm parameters. |
Example Requests
The following shows how to query the algorithm whose UUID is 2e5451fe-913f-4492-821a-2981031382f7.
GET https://endpoint/v2/{project_id}/algorithms/2e5451fe-913f-4492-821a-2981031382f7
Example Responses
Status code: 200
ok
{ "metadata" : { "id" : "2e5451fe-913f-4492-821a-2981031382f7", "name" : "TestModelArtsalgorithm", "description" : "This is a ModelArts algorithm", "create_time" : 1636600721742, "workspace_id" : "0", "ai_project" : "default-ai-project", "user_name" : "", "domain_id" : "xxxxxxxxxxxxxxxxxxxxxxxxxx", "source" : "custom", "api_version" : "", "is_valid" : true, "state" : "", "size" : 4791, "tags" : null, "attr_list" : null, "version_num" : 0, "update_time" : 0 }, "job_config" : { "code_dir" : "/algo-test/pytorch/work1/code/", "boot_file" : "/algo-test/pytorch/work1/code/test-pytorch.py", "command" : "", "parameters" : [ { "name" : "test-parameter", "description" : "", "i18n_description" : null, "value" : "10", "constraint" : { "type" : "String", "editable" : true, "required" : false, "sensitive" : false, "valid_type" : "None", "valid_range" : [ ] } } ], "parameters_customization" : true, "inputs" : [ { "name" : "data_url", "description" : "name to translate" } ], "outputs" : [ { "name" : "train_url", "description" : "name to translate" } ], "engine" : { "engine_id" : "pytorch-cp36-1.3.0", "engine_name" : "PyTorch", "engine_version" : "PyTorch-1.3.0-python3.6" }, "code_tree" : { "name" : "code/", "children" : [ { "name" : "test-pytorch.py" } ] } }, "resource_requirements" : null, "advanced_config" : { } }
Status Codes
Status Code |
Description |
---|---|
200 |
ok |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot