Updated on 2026-11-06 GMT+08:00

Creating an Endpoint

Overview

This section describes how to create and view an endpoint 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.
  • The ID of the workspace where the endpoint is to be created has been obtained.
  • If you create an endpoint in reserved resource or hybrid mode, you also need to obtain the compute resource ID. If you create an endpoint in pay-per-use mode, you do not need to obtain the compute resource ID.

Procedure

  • API information

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

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

    For details, see Creating an Endpoint.

  • Request example

    POST /v2/workspaces/{workspace_id}/endpoints

    Request body:
    {
      "compute_id" : "0150a336-dda9-xxxx-xxxx-af02ec424a5e",
      "name" : "spark-job-test",
      "display_name" : "spark-job-test",
      "resource_type" : "RESERVED",
      "engine" : {
        "type" : "SparkJob",
        "spark_config" : { },
        "scheduling_config" : {
          "max_concurrent_jobs" : 300,
          "scheduling_policy" : "RANDOM"
        },
        "staging_config" : {
          "obs" : {
            "bucket_name" : "ai4db",
            "agency_name" : "aidatalake-spark"
          }
        }
      },
      "capacity" : [ {
        "type" : "CPU",
        "maximum_capacity" : 1000,
        "minimum_capacity" : 0,
        "use_ondemand_resource" : false,
        "spec_code" : "aidatalake.cpu.x86.general.1c2g"
      } ],
      "credential" : {
        "agency_name" : "aidatalake-spark"
      }
    }
  • Response example
    {
      "id" : "2b3c4d5e6f7890abcdef1234567890ab",
      "name" : "spark-job-test",
      "display_name" : "spark-job-test",
      "description" : "SparkJob test endpoint",
      "status" : "CREATING",
      "engine" : {
        "type" : "SparkJob",
        "spark_config" : { },
        "scheduling_config" : {
          "max_concurrent_jobs" : 300,
          "scheduling_policy" : "RANDOM"
        }
      },
      "resource_type" : "RESERVED",
      "compute_id" : "0150a336-dda9-xxxx-xxxx-af02ec424a5e",
      "capacity" : [ {
        "type" : "CPU",
        "maximum_capacity" : 1000,
        "minimum_capacity" : 0,
        "use_ondemand_resource" : false,
        "spec_code" : "aidatalake.cpu.x86.general.1c2g"
      } ],
      "create_time" : "2025-01-10T03:37:12.000+00:00",
      "update_time" : "2025-01-10T03:37:12.000+00:00",
      "creator" : {
        "domain_name" : "test",
        "domain_id" : "0676610f3a0xxxxxxxx50bea7ddf18c1",
        "user_id" : "019e19fb78887xxxxxxxx4174cd5a002",
        "user_name" : "developer"
      }
    }

Viewing Endpoint Details

  • API information

    URI format: GET /v2/workspaces/{workspace_id}/endpoints/{endpoint_id}

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

    For details, see Querying Details of an Endpoint.

  • Request example

    GET /v2/workspaces/{workspace_id}/endpoints/{endpoint_id}

  • Response example
    {
      "id" : "2b3c4d5e6f7890abcdef1234567890ab",
      "name" : "spark-job-test",
      "display_name" : "spark-job-test",
      "description" : "SparkJob test endpoint",
      "status" : "RUNNING",
      "engine" : {
        "type" : "SparkJob",
        "spark_config" : { },
        "scheduling_config" : {
          "max_concurrent_jobs" : 300,
          "scheduling_policy" : "RANDOM"
        }
      },
      "resource_type" : "RESERVED",
      "compute_id" : "0150a336-dda9-xxxx-xxxx-af02ec424a5e",
      "capacity" : [ {
        "type" : "CPU",
        "maximum_capacity" : 1000,
        "minimum_capacity" : 0,
        "use_ondemand_resource" : false,
        "spec_code" : "aidatalake.cpu.x86.general.1c2g"
      } ],
      "create_time" : "2025-01-10T03:37:12.000+00:00",
      "update_time" : "2025-01-10T03:37:12.000+00:00",
      "creator" : {
        "domain_name" : "test",
        "domain_id" : "0676610f3a0xxxxxxxx50bea7ddf18c1",
        "user_id" : "019e19fb78887xxxxxxxx4174cd5a002",
        "user_name" : "developer"
      }
    }