Skip to main content
GET
/
cloud
/
v1
/
tasks
/
{task_id}
Get task
curl --request GET \
  --url https://api.gcore.com/cloud/v1/tasks/{task_id} \
  --header 'Authorization: <api-key>'
import requests

url = "https://api.gcore.com/cloud/v1/tasks/{task_id}"

headers = {"Authorization": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: '<api-key>'}};

fetch('https://api.gcore.com/cloud/v1/tasks/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v1/tasks/{task_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.gcore.com/cloud/v1/tasks/{task_id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.gcore.com/cloud/v1/tasks/{task_id}")
.header("Authorization", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.gcore.com/cloud/v1/tasks/{task_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "created_on": "2019-06-25T08:42:42Z",
  "id": "26986bc0-748a-4448-b836-0a2aa465eb06",
  "task_type": "create_vm",
  "user_id": 123,
  "acknowledged_at": "<string>",
  "acknowledged_by": 123,
  "client_id": 123,
  "created_resources": {
    "ai_clusters": [
      "<string>"
    ],
    "api_keys": [
      "<string>"
    ],
    "caas_containers": [
      "<string>"
    ],
    "clusters": [
      "<string>"
    ],
    "ddos_profiles": [
      123
    ],
    "faas_functions": [
      "<string>"
    ],
    "faas_namespaces": [
      "<string>"
    ],
    "file_shares": [
      "<string>"
    ],
    "floatingips": [
      "<string>"
    ],
    "healthmonitors": [
      "<string>"
    ],
    "images": [
      "<string>"
    ],
    "inference_instances": [
      "<string>"
    ],
    "instances": [
      "<string>"
    ],
    "k8s_clusters": [
      "<string>"
    ],
    "k8s_pools": [
      "<string>"
    ],
    "l7polices": [
      "<string>"
    ],
    "l7rules": [
      "<string>"
    ],
    "laas_topic": [
      "<string>"
    ],
    "listeners": [
      "<string>"
    ],
    "loadbalancers": [
      "<string>"
    ],
    "members": [
      "<string>"
    ],
    "networks": [
      "<string>"
    ],
    "pools": [
      "<string>"
    ],
    "ports": [
      "<string>"
    ],
    "postgresql_clusters": [
      "<string>"
    ],
    "projects": [
      123
    ],
    "registry_registries": [
      "<string>"
    ],
    "registry_users": [
      "<string>"
    ],
    "routers": [
      "<string>"
    ],
    "secrets": [
      "<string>"
    ],
    "security_group_rules": [
      "<string>"
    ],
    "security_groups": [
      "<string>"
    ],
    "servergroups": [
      "<string>"
    ],
    "snapshots": [
      "<string>"
    ],
    "subnets": [
      "<string>"
    ],
    "volumes": [
      "<string>"
    ]
  },
  "data": "<unknown>",
  "error": "<string>",
  "finished_on": "<string>",
  "job_id": "<string>",
  "lifecycle_policy_id": 123,
  "project_id": 123,
  "region_id": 123,
  "request_id": "<string>",
  "schedule_id": "<string>",
  "updated_on": "<string>",
  "user_client_id": 123
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

task_id
string
required

Task ID

Response

200 - application/json

OK

created_on
string | null
required

Created timestamp

Example:

"2019-06-25T08:42:42Z"

id
string
required

The task ID

Example:

"26986bc0-748a-4448-b836-0a2aa465eb06"

state
enum<string>
required

The task state

Available options:
ERROR,
FINISHED,
NEW,
RUNNING
Example:

"RUNNING"

task_type
string
required

The task type

Example:

"create_vm"

user_id
integer
required

The user ID that initiated the task

Example:

123

acknowledged_at
string | null

If task was acknowledged, this field stores acknowledge timestamp

acknowledged_by
integer | null

If task was acknowledged, this field stores user_id of the person

Example:

123

client_id
integer | null

The client ID

Example:

123

created_resources
CreatedResources · object | null

If the task creates resources, this field will contain their IDs

data
any

Task parameters

Example:
{
"block_device_config": [
{
"boot_index": 0,
"image_id": "f01fd9a0-9548-48ba-82dc-a8c8b2d6f2f1",
"name": "volume for vm1",
"size": 1,
"source": "image",
"type_name": "standard"
}
],
"flavor_name": "g1s-shared-1-0.5",
"keypair_name": null,
"name": "cirroz1",
"network_config": null,
"reservation_id": "01d4925e-f5db-414a-9808-74e08aa4a741",
"security_groups": null
}
detailed_state
enum<string> | null

Task detailed state that is more specific to task type

Available options:
CLUSTER_CLEAN_UP,
CLUSTER_REBUILD,
CLUSTER_RESIZE,
CLUSTER_RESUME,
CLUSTER_SERVER_REBUILD,
CLUSTER_SUSPEND,
ERROR,
FINISHED,
IPU_SERVERS,
NETWORK,
POPLAR_SERVERS,
POST_DEPLOY_SETUP,
VIPU_CONTROLLER
error
string | null

The error value

finished_on
string | null

Finished timestamp

job_id
string | null

Job ID

lifecycle_policy_id
integer | null

Lifecycle policy ID

project_id
integer | null

The project ID

Example:

123

region_id
integer | null

The region ID

Example:

123

request_id
string | null

The request ID

schedule_id
string | null

Schedule ID

updated_on
string | null

Last updated timestamp

user_client_id
integer | null

Client, specified in user's JWT

Example:

123