Querying the Algorithm List
Function
This API is used to obtain the list of all algorithms on ModelArts.
This API applies to the following scenarios: When you need to view all available algorithms on the platform, you can call this API to obtain the algorithm list. Before using this API, ensure that you have the permission to view the algorithm list. After the query is complete, the platform returns an algorithm list. Information such as the algorithm name and ID is displayed. If you do not have the permission to perform operations, 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:list
List
-
-
-
-
URI
GET /v2/{project_id}/algorithms
| 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 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| offset | No | Integer | Definition: Start page for pagination display Constraints: The minimum value is 0. For example, if this parameter is set to 0, the query starts from the first page. Range: N/A Default Value: 0 |
| limit | No | Integer | Definition: Number of records on each page for obtaining algorithms. Constraints: The value ranges from 1 to 50. Range: N/A. Default Value: N/A |
| sort_by | No | String | Definition: Metric for sorting algorithms to be queried Constraints: N/A Range: N/A Default Value: create_time is used for sorting by default. |
| order | No | String | Definition: Order of queried algorithms Constraints: N/A Range: Default Value: desc |
| searches | No | String | Definition: Filter criteria for querying algorithms, for example, fuzzy match by the algorithm name: searches = name:algorithm-. Constraints: Multi-condition query is supported. Format: searches=key1:value1,key2:value2. Range: N/A. Default Value: N/A |
| workspace_id | No | String | Definition: Workspace ID. Constraints: If no workspaces are available, the default value is 0. If a workspace is created and used, use the actual value. For details about how to obtain the ID, see Querying the Workspace List. Range: N/A Default Value: N/A |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| total | Integer | Definition: Total number of algorithms of the current user. Range: N/A |
| count | Integer | Definition: Total number of algorithms that meet the search criteria of the current user. Range: N/A |
| limit | Integer | Definition: Maximum number of obtained algorithms of the current user. Range: 1 to 50. |
| offset | Integer | Definition: Offset of all algorithm obtained of the current user. Range: N/A |
| sort_by | String | Definition: Fields used to sort obtained algorithms of the current user. Range: N/A |
| order | String | Definition: Order of queried algorithms of the current user. Range: |
| group_by | String | Definition: Grouping mode of obtained algorithms of the current user. Range: N/A |
| items | Array of AlgorithmResponse objects | Definition: Details of the algorithms that meet the search criteria of the current user. |
| 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 all algorithms in jobs whose names contain TestModelArtsalgorithm and maximum number of algorithms is set to 1.
GET https://endpoint/v2/{project_id}/algorithms?limit=1&searches=name%3ATestModelArtsalgorithm Example Responses
Status code: 200
ok
{
"total" : 1,
"count" : 1,
"limit" : 1,
"offset" : 0,
"sort_by" : "create_time",
"order" : "desc",
"group_by" : "",
"items" : [ {
"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