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.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
modelarts:aiAlgorithm:get
Read
aiAlgorithm *
-
-
-
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: N/A Range: The value can contain 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed. Default Value: N/A |
| algorithm_id | Yes | String | Definition: algorithm ID, which can be obtained from the response returned by the API for creating an algorithm or the API for obtaining the algorithm list. 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, which specifies whether and how the algorithm supports three types of advanced training features: elastic training, shared GPU training, and automated hyperparameter search. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition: Algorithm ID. You do not need to set this parameter when creating an algorithm. Range: N/A |
| name | String | Definition: Algorithm name. Range: The value must contain 1 to 64 characters consisting of only digits, letters, underscores (_), and hyphens (-). |
| description | String | Definition: Algorithm description. Range: The value can contain 0 to 256 characters. |
| workspace_id | String | Definition: Workspace where a specified algorithm is located. The value 0 indicates the default workspace. Range: N/A |
| ai_project | String | Definition: AI project to which a specified algorithm belongs. 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 | Boolean | Definition: Algorithm availability. Range |
| state | String | Definition: Algorithm status. Range: N/A |
| tags | Array of Map<String,String> objects | Definition: algorithm tag, in key/value format. The key is the tag name, and the value is the tag value. |
| attr_list | Array of strings | Definition: Algorithm attributes. |
| version_num | Integer | Definition: Number of algorithm versions. Range: N/A |
| size | Integer | Definition: algorithm size, in bytes. Range: N/A |
| create_time | Long | Definition: Algorithm creation timestamp, which is a Unix timestamp in milliseconds. Range: N/A |
| update_time | Long | Definition: Algorithm update timestamp, which is a Unix timestamp in milliseconds. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| code_dir | String | Definition: Algorithm code directory, Example value: /usr/app/ 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. 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 | CodeTreeNode object | 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: |
| 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: - Choice: Enumerated values - Range: Range values - None: None |
| valid_range | Array of strings | Definition: Valid range. |
| Parameter | Type | Description |
|---|---|---|
| language | String | Definition: Internationalization language. Range: |
| 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. For example, obs indicates the data storage location (OBS), and modelarts_dataset indicates a ModelArts dataset. The dataset function will be brought offline soon. 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 name selected for an algorithm. Range: N/A |
| engine_version | String | Definition: Engine version name selected for an algorithm. 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 | Array of CodeTreeNode objects | 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: Key-value relationship. Range: in (the inclusion relationship between the key and value), for example, flavor_type in [CPU,GPU]. |
| 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