Skip to main content

Job cluster API

In Hadoop Eco, clusters typically switch to the Terminated state once a specific task is completed, making them unavailable for further use. However, with the job cluster API, you can repeatedly schedule tasks on clusters already in the Terminated state.

The job cluster API enhances cluster reusability, allowing repeated task execution on existing clusters without creating new clusters each time, enabling efficient cluster management.

The job cluster API operates through the following process:

  1. Cluster selection: Select a cluster for rework from the console. This must be an existing cluster in the Terminated state.

  2. Issue Open API Key: To use the job cluster API, you must issue an Open API Key from the KakaoCloud console for the respective cluster. This key is essential for accessing and controlling the cluster through API calls.

    • When issuing an Open API Key, a security group exclusive to the Open API cluster is automatically created. If the API Key is deleted, the security group is also removed.
  3. Call the job cluster API: Use the issued Open API Key to call the job cluster API. This allows you to schedule and execute new tasks on a Terminated cluster.

Prepare API usage

To call the job cluster API, you must get an access key and obtain the Open API Key for the Hadoop Eco cluster from the console.

Create job cluster

Repeatedly execute task scheduling on a cluster currently in the Terminated state.

Request

Request Syntax

(kr-central-2) region cluster creation request syntax
curl -X POST 'https://hadoop-eco.kr-central-2.kakaocloud.com/v2/hadoop-eco/clusters/{cluster-id}' \
--header 'Hadoop-Eco-Api-Key: {hadoop-eco-api-key}' \
--header 'Credential-ID: {credential-id}' \
--header 'Credential-Secret: {credential-secret}' \
--header 'Content-Type: application/json' \
--data-raw '{
"workerCnt": 2,
"workerVolumeSize": 50,
"configHdfsReplication": 2,
"configHdfsBlockSize": 128,
"userTaskDeployMode": "cluster",
"userTaskExecOpts": "--driver-cores 1 --driver-memory 1024m --executor-cores 1 --num-executors 4 --executor-memory 2048m",
"userTaskExecParams": "-sparkApplicationParams=testParams"
}'

API call method

MethodRequest URL
POST (kr-central-2)https://hadoop-eco.kr-central-2.kakaocloud.com/v2/hadoop-eco/clusters/{cluster-id}/requests/{request-id}
TypeParameterData typeDescription
URL{cluster-id}*StringCluster ID
- Available from KakaoCloud console > Analytics > Hadoop Eco > Left menu > Cluster information

Request header

RequestTypeDescription
{credential-id}*StringUser's access key ID
- Available from KakaoCloud console > Top-right profile > Access key
{credential-secret}*StringUser's secret access key
- Only available when issuing the access key
- If the secret access key is lost, issue a new access key
{hadoop-eco-api-key}*StringOpen API key
- Issuable from KakaoCloud console > Analytics > Hadoop Eco > Left menu
 Select a cluster > Top-right menu Cluster tasks > Issue Open API Key
- Refer to Issue Open API Key for details

Request elements

These are not mandatory values but can be used when changes to the existing cluster configuration are needed.

RequestTypeDescription
workerCntIntegerNumber of Hadoop Eco worker nodes
- Range: 1 ~ 1,000
workerVolumeSizeIntegerBlock storage size for Hadoop Eco worker nodes
- Range: 50 ~ 5120GB
configHdfsReplicationIntegerNumber of Hadoop Eco HDFS replications
- Range: 1 ~ 500
configHdfsBlockSizeIntegerBlock size for Hadoop Eco HDFS
- Range: 1 ~ 1024MB
userTaskDeployModeStringHadoop Eco Spark Job Deploy mode
- Modes: client, cluster
userTaskExecOptsStringHadoop Eco Hive configuration parameters
userTaskExecParamsStringHadoop Eco Job application parameters

Response

Response Syntax

Create cluster Response Syntax
{
"clusterId": "58ceed05-e4f5-4a85-b9a6-e9b79ae8dcdf",
"clusterName": "test-cluster",
"requestId": "req-f02cf9abc130410ab365e77511db4318",
"clusterMainSettingValues": {
"workerCnt": 1,
"workerVolumeSize": 50,
"configHdfsReplication": 1,
"configHdfsBlockSize": 128,
"jobType": "hive",
"userTaskDeployMode": true,
"userTaskExecOpts": "",
"userTaskExecParams": ""
}
}

Response Elements

ResponseDescription
clusterIdID of the created cluster
clusterNameName of the created cluster
requestIdRequest ID
clusterMainSettingValues▼Configuration details
    workerCntNumber of Hadoop Eco worker nodes
    workerVolumeSizeBlock storage size for Hadoop Eco worker nodes
    configHdfsReplicationNumber of Hadoop Eco HDFS replications
    configHdfsBlockSizeBlock size for Hadoop Eco HDFS
    jobTypeJob type
- Types: Spark, Hive
    userTaskDeployModeHadoop Eco Spark Job Deploy mode
    userTaskExecOptsHadoop Eco Spark or Hive Job configuration parameters
    userTaskExecParamsHadoop Eco Spark Application parameters
Status codes
HTTP StatusDescription
200    Success
202Cluster task (creation) in progress
400Request information error
401, 403Authentication failed, forbidden
404Cluster not found

Retrieve job cluster details

You can retrieve the status of a cluster issued with an Open API Key.

Request

Request Syntax

(kr-central-2) region cluster status retrieval request syntax
curl -X GET 'https://hadoop-eco.kr-central-2.kakaocloud.com/v2/hadoop-eco/clusters/{cluster-id}/requests/{request-id}' \
--header 'Hadoop-Eco-Api-Key: {hadoop-eco-api-key}' \
--header 'Credential-ID: {credential-id}' \
--header 'Credential-Secret: {credential-secret}' \
--header 'Content-Type: application/json'

curl -X GET 'https://hadoop-eco.kr-central-2.kakaocloud.com/v2/hadoop-eco/clusters/{cluster-id}/requests/{request-id}?verbose=true' \
--header 'Hadoop-Eco-Api-Key: {hadoop-eco-api-key}' \
--header 'Credential-ID: {credential-id}' \
--header 'Credential-Secret: {credential-secret}' \
--header 'Content-Type: application/json'

API call method

MethodRequest URL
GET (Kr-central-1)https://hadoop-eco.kr-central-1.kakaoi.io/v2/hadoop-eco/clusters/{cluster-id}/requests/{request-id}
GET (Kr-central-2)https://hadoop-eco.kr-central-2.kakaocloud.com/v2/hadoop-eco/clusters/{cluster-id}/requests/{request-id}
PathTypeDescription
{cluster-id}*StringCluster ID
- Available from KakaoCloud console > Analytics > Hadoop Eco > Left menu > Cluster information
{request-id}*StringrequestId value received in the response after Job cluster creation

Query parameters

RequestTypeDescription
verboseBooleanIf the verbose option is enabled, the status of master/worker nodes can also be retrieved
- Options: true, false

Request Header

RequestTypeDescription
{credential-id}*StringUser's access key ID
- Available from KakaoCloud console > Top-right profile > Access key
{credential-secret}*StringUser's secret access key
- Only available when issuing the access key
- If the secret access key is lost, issue a new access key
{hadoop-eco-api-key}*StringOpen API key
- Issuable from KakaoCloud console > Analytics > Hadoop Eco > Left menu
 Select a cluster > Top-right menu Cluster tasks > Issue Open API Key
- Refer to Issue Open API Key for details

Response

Response syntax

Response syntax when verbose=false
{
"clusterId": "58ceed05-e4f5-4a85-b9a6-e9b79ae8dcdf",
"clusterName": "peb-hadoop-ga-test",
"requestId": "req-ac2aad4c128d4486bbc34fe4862737cb",
"requestStatus": "Terminate",
"requestResult": "Success"
}
Response syntax when verbose=true
{
"clusterId": "58ceed05-e4f5-4a85-b9a6-e9b79ae8dcdf",
"clusterName": "peb-hadoop-ga-test",
"requestId": "req-ac2aad4c128d4486bbc34fe4862737cb",
"requestStatus": "Terminate",
"requestResult": "Failure",
"clusterMeta": {
"cluster_version": "hde-1.1.0",
"service_check_timeout": 10,
"socket_timeout": 5,
"global_timeout": 1500,
"monitoring": false,
"cluster_id": "58ceed05-e4f5-4a85-b9a6-e9b79ae8dcdf",
"cluster_name": "peb-hadoop-ga-test",
"cluster_type": "hadoop_single",
"project": {
"id": "353094e122d6493d9899f0f2523d4cc1",
"name": "bigdata",
"domain": {
"id": "982fc392699d4385b0b1a9d10b9f2393",
"name": "kakaoenterprise"
}
},
"master_vm": {
"host_list": [
"HadoopMST-peb-hadoop-ga-test-1"
],
"flavor_id": "9b944f27-12fd-4542-8073-e477931c9365",
"flavor_name": "a1-4-std",
"key_pair": "bigdata-peb",
"network": {
"uuid": "3541a58c-3930-4dcb-8785-0032ff926b80",
"subnet_id": "be864742-c658-4f7f-8077-9b9138b86df1",
"security_group_id_list": [
"73e64d4f-cf71-4be5-8cd5-42e5cb5ccceb",
"1a21f01b-0437-40ab-a26b-979552555b50"
]
},
"block_device": {
"source_type": "image",
"uuid": "99612215-f9c2-4914-9c76-c8567285675f",
"volume_size": 50
},
"master_active": "HadoopMST-peb-hadoop-ga-test-1",
"master_standby": "HadoopMST-peb-hadoop-ga-test-1",
"master_etc": "HadoopMST-peb-hadoop-ga-test-1"
},
"worker_vm": {
"host_list": [],
"flavor_id": "9b944f27-12fd-4542-8073-e477931c9365",
"flavor_name": "a1-4-std",
"key_pair": "bigdata-peb",
"network": {
"uuid": "3541a58c-3930-4dcb-8785-0032ff926b80",
"subnet_id": "be864742-c658-4f7f-8077-9b9138b86df1",
"security_group_id_list": [
"73e64d4f-cf71-4be5-8cd5-42e5cb5ccceb",
"1a21f01b-0437-40ab-a26b-979552555b50"
]
},
"block_device": {
"source_type": "image",
"uuid": "99612215-f9c2-4914-9c76-c8567285675f",
"volume_size": 50
}
},
"user_cluster_exec_command": {
"type": "hive",
"termination_policy": "always",
"hive_query": "show databases;",
"exec_opts": "",
"exec_params": ""
}
}
}

Response Elements

ResponseDescription
clusterIdID of the created cluster
clusterNameName of the created cluster
requestIdRequest ID
requestStatusStatus of the request
requestResultResult of the request
clusterMeta▼Cluster metadata information
    cluster_versionVersion of the created cluster
    service_check_timeoutService timeout duration
    socket_timeoutSocket timeout duration
    global_timeoutGlobal timeout duration
    monitoringMonitoring enabled status
    cluster_idCluster ID
    cluster_nameCluster name
    cluster_typeCluster type
    projectProject information
    idProject ID
    nameProject name
    projectDomain information
    id(domain)Domain ID the project belongs to
    name(domain)Domain name the project belongs to
master_vm▼Master node information
    host_listList of host names
flavor_idFlavor ID
flavor_nameFlavor name
key_pairKey pair name
network▼Network information
    uuid(network)Network UUID
    subnet_id(network)Subnet ID
    security_group_id_listSecurity group IDs
block_device▼Block storage information
    source_typeBlock storage source type
    uuidUUID of the block storage
    volume_sizeSize of the block storage
master_activeActive server name of the master node
master_standbyStandby server name of the master node
master_etcEtc server name of the master node
worker_vm▼Worker node information
    host_listList of host names
    flavor_idFlavor ID
    flavor_nameFlavor name
    key_pairKey pair name
    networkNetwork information
    uuid(network)Network UUID
    subnet_id(network)Subnet ID
    security_group_id_listSecurity group IDs
user_cluster_exec_command▼User-submitted task information
    typeTask type
- Spark, Hive
    termination_policyTask termination policy
- always, onSuccess, never
    hive_queryHive task query
    exec_optsHive, Spark configuration values
    exec_paramsSpark application parameter values
Status codes
HTTP StatusDescription
200    Success
400Request information error
401, 403Authentication failed, forbidden
404Cluster not found