Help Center> RES> API Reference> APIs (Old Version)> Job-related APIs> Submitting Ranking Jobs> Querying the Compute Node Specifications of ModelArts

Querying the Compute Node Specifications of ModelArts

Function

This API is used to query the compute node specifications of ModelArts.

URI

GET /v1/{project_id}/job-spec/train

Table 1 describes the URI parameters.
Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which is used for resource isolation.

Response

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

is_success

Boolean

Whether the request is successful

specs

List

List of compute resource specifications. For details, see Table 3.

error_code

String

Error code that indicates a request has failed. This parameter is unavailable when a request is successful.

error_msg

String

Error message that indicates a request has failed. This parameter is unavailable when a request is successful.

Table 3 specs parameters

Parameter

Type

Description

spec_id

Long

ID of the resource specifications

core

String

Number of cores of the resource specifications

cpu

String

CPU memory of the resource specifications

gpu_num

Int

Number of GPUs of the resource specifications

gpu_type

String

GPU type of the resource specifications

spec_code

String

Type of the resource specifications

max_num

Int

Maximum number of nodes that can be selected

storage

String

SSD size of the resource specifications

interface_type

Int

Interface type

no_resource

Boolean

Whether the selected resource specifications are insufficient. True indicates that no resource is available.

Example

  • Example of a successful response
    {
      "is_success": true,
      "specs": [
        {
          "spec_id": 2,
          "core": "2",
          "cpu": "8",
          "gpu_num": 0,
          "gpu_type": "",
          "spec_code": "modelarts.vm.cpu.2u",
          "max_num": 2,
          "storage": "",
          "interface_type": 3,
          "no_resource": false
        }
      ]
    }
  • Example of a failed response
    { 
        "is_success": false, 
        "error_code": "res.1006", 
        "error_msg": "The content for the request is invalid." 
    }

Status Code

For details about status codes, see Status Codes.