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
- 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" } }
What is your overall rating for this page?
Thank 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