Help Center/ AI DataLake/ API Reference/ Application Cases/ Creating a Compute Resource
Updated on 2026-11-06 GMT+08:00

Creating a Compute Resource

Overview

This section describes the complete process of creating and viewing compute resources by calling APIs.

This process assumes that the end tenant has been authorized on the console to use AI DataLake and has created a workspace. For how to call this API, see Calling an API.

Prerequisites

  • AI DataLake authorization has been completed.
  • You have obtained the ID of the workspace where the resource is to be created.

Procedure

  • API information

    URI format: POST /v2/workspaces/{workspace_id}/computes

    {workspace_id}: ID of the workspace where the compute resource is located.

    For details, see Creating a Compute Resource.

  • Request example

    POST /v2/workspaces/{workspace_id}/computes

    Request body:
    {
      "name" : "compute-01",
      "description": "Test compute resource",
      "capacity" : [ {
        "type" : "CPU",
        "capacity" : 64,
        "spec_code" : "aidatalake.cpu.x86.general.1c4g"
      } ],
      "charge_mode" : "postPaid"
    }
  • Response example
    {
      "id" : "03141229-84cd-xxxx-xxxx-dd124320c125",
      "name" : "compute-01",
      "description": "Test compute resource",
      "charge_mode" : "postPaid",
      "capacity" : [ {
        "type" : "CPU",
        "capacity" : 64,
        "spec_code" : "aidatalake.cpu.x86.general.1c4g"
      } ],
      "status" : "PREPARING",
      "creator" : {
        "domain_name" : "test_domain",
        "domain_id" : "0676610f3a0xxxxxxxx50bea7ddf18c1",
        "user_name" : "test_user",
        "user_id" : "019e19fb78887xxxxxxxx4174cd5a002"
      }
    }

Viewing a Compute Resource Pool

  • API information

    URI format: GET /v2/workspaces/{workspace_id}/computes/{compute_id}

    {workspace_id}: ID of the workspace where the compute resource is located.

    For details, see Viewing Details of a Compute Resource.

  • Request example

    GET /v2/workspaces/{workspace_id}/computes/{compute_id}

  • Response example
    {
      "id" : "03141229-84cd-xxxx-xxxx-dd124320c125",
      "name" : "compute-01",
      "description": "Test compute resource",
      "charge_mode" : "postPaid",
      "capacity" : [ {
        "type" : "CPU",
        "capacity" : 64,
        "spec_code" : "aidatalake.cpu.x86.general.1c4g"
      } ],
      "update_time" : "2025-01-10T03:37:12.000+00:00",
      "create_time" : "2025-01-10T03:37:12.000+00:00",
      "status" : "RUNNING",
      "creator" : {
        "domain_name" : "test_domain",
        "domain_id" : "0676610f3a0xxxxxxxx50bea7ddf18c1",
        "user_name" : "test_user",
        "user_id" : "019e19fb78887xxxxxxxx4174cd5a002"
      }
    }