import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
task_id_list = client.cloud.gpu_baremetal.clusters.create(
project_id=1,
region_id=7,
flavor="g3-ai-32-192-1500-l40s-48-1",
image_id="3793c250-0b3b-4678-bab3-e11afbc29657",
name="gpu-cluster-1",
servers_count=3,
servers_settings={
"interfaces": [{
"type": "external"
}]
},
)
print(task_id_list.tasks)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
taskIDList, err := client.Cloud.GPUBaremetal.Clusters.New(context.TODO(), cloud.GPUBaremetalClusterNewParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(7),
Flavor: "g3-ai-32-192-1500-l40s-48-1",
ImageID: "3793c250-0b3b-4678-bab3-e11afbc29657",
Name: "gpu-cluster-1",
ServersCount: 3,
ServersSettings: cloud.GPUBaremetalClusterNewParamsServersSettings{
Interfaces: []cloud.GPUBaremetalClusterNewParamsServersSettingsInterfaceUnion{{
OfExternal: &cloud.GPUBaremetalClusterNewParamsServersSettingsInterfaceExternal{},
}},
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", taskIDList.Tasks)
}
curl --request POST \
--url https://api.gcore.com/cloud/v3/gpu/baremetal/{project_id}/{region_id}/clusters \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"flavor": "g3-ai-32-192-1500-l40s-48-1",
"image_id": "3793c250-0b3b-4678-bab3-e11afbc29657",
"name": "gpu-cluster-1",
"servers_count": 3,
"servers_settings": {
"interfaces": [
{
"type": "<string>",
"ip_family": "ipv4",
"name": "eth0",
"port_security_enabled": true,
"security_groups": [
{
"id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98"
}
]
}
],
"credentials": {
"password": "securepassword",
"ssh_key_name": "my-ssh-key",
"username": "admin"
},
"file_shares": [
{
"id": "a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a",
"mount_path": "/mnt/vast"
}
],
"security_groups": [
{
"id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98"
}
],
"user_data": "eyJ0ZXN0IjogImRhdGEifQ=="
},
"tags": {}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
flavor: 'g3-ai-32-192-1500-l40s-48-1',
image_id: '3793c250-0b3b-4678-bab3-e11afbc29657',
name: 'gpu-cluster-1',
servers_count: 3,
servers_settings: {
interfaces: [
{
type: '<string>',
ip_family: 'ipv4',
name: 'eth0',
port_security_enabled: true,
security_groups: [{id: 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'}]
}
],
credentials: {password: 'securepassword', ssh_key_name: 'my-ssh-key', username: 'admin'},
file_shares: [{id: 'a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a', mount_path: '/mnt/vast'}],
security_groups: [{id: 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'}],
user_data: 'eyJ0ZXN0IjogImRhdGEifQ=='
},
tags: {}
})
};
fetch('https://api.gcore.com/cloud/v3/gpu/baremetal/{project_id}/{region_id}/clusters', 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/v3/gpu/baremetal/{project_id}/{region_id}/clusters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'flavor' => 'g3-ai-32-192-1500-l40s-48-1',
'image_id' => '3793c250-0b3b-4678-bab3-e11afbc29657',
'name' => 'gpu-cluster-1',
'servers_count' => 3,
'servers_settings' => [
'interfaces' => [
[
'type' => '<string>',
'ip_family' => 'ipv4',
'name' => 'eth0',
'port_security_enabled' => true,
'security_groups' => [
[
'id' => 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'
]
]
]
],
'credentials' => [
'password' => 'securepassword',
'ssh_key_name' => 'my-ssh-key',
'username' => 'admin'
],
'file_shares' => [
[
'id' => 'a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a',
'mount_path' => '/mnt/vast'
]
],
'security_groups' => [
[
'id' => 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'
]
],
'user_data' => 'eyJ0ZXN0IjogImRhdGEifQ=='
],
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v3/gpu/baremetal/{project_id}/{region_id}/clusters")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flavor\": \"g3-ai-32-192-1500-l40s-48-1\",\n \"image_id\": \"3793c250-0b3b-4678-bab3-e11afbc29657\",\n \"name\": \"gpu-cluster-1\",\n \"servers_count\": 3,\n \"servers_settings\": {\n \"interfaces\": [\n {\n \"type\": \"<string>\",\n \"ip_family\": \"ipv4\",\n \"name\": \"eth0\",\n \"port_security_enabled\": true,\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ]\n }\n ],\n \"credentials\": {\n \"password\": \"securepassword\",\n \"ssh_key_name\": \"my-ssh-key\",\n \"username\": \"admin\"\n },\n \"file_shares\": [\n {\n \"id\": \"a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a\",\n \"mount_path\": \"/mnt/vast\"\n }\n ],\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ],\n \"user_data\": \"eyJ0ZXN0IjogImRhdGEifQ==\"\n },\n \"tags\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v3/gpu/baremetal/{project_id}/{region_id}/clusters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"flavor\": \"g3-ai-32-192-1500-l40s-48-1\",\n \"image_id\": \"3793c250-0b3b-4678-bab3-e11afbc29657\",\n \"name\": \"gpu-cluster-1\",\n \"servers_count\": 3,\n \"servers_settings\": {\n \"interfaces\": [\n {\n \"type\": \"<string>\",\n \"ip_family\": \"ipv4\",\n \"name\": \"eth0\",\n \"port_security_enabled\": true,\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ]\n }\n ],\n \"credentials\": {\n \"password\": \"securepassword\",\n \"ssh_key_name\": \"my-ssh-key\",\n \"username\": \"admin\"\n },\n \"file_shares\": [\n {\n \"id\": \"a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a\",\n \"mount_path\": \"/mnt/vast\"\n }\n ],\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ],\n \"user_data\": \"eyJ0ZXN0IjogImRhdGEifQ==\"\n },\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}Create bare metal GPU cluster
Create a new bare metal GPU cluster with the specified configuration.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
task_id_list = client.cloud.gpu_baremetal.clusters.create(
project_id=1,
region_id=7,
flavor="g3-ai-32-192-1500-l40s-48-1",
image_id="3793c250-0b3b-4678-bab3-e11afbc29657",
name="gpu-cluster-1",
servers_count=3,
servers_settings={
"interfaces": [{
"type": "external"
}]
},
)
print(task_id_list.tasks)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
taskIDList, err := client.Cloud.GPUBaremetal.Clusters.New(context.TODO(), cloud.GPUBaremetalClusterNewParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(7),
Flavor: "g3-ai-32-192-1500-l40s-48-1",
ImageID: "3793c250-0b3b-4678-bab3-e11afbc29657",
Name: "gpu-cluster-1",
ServersCount: 3,
ServersSettings: cloud.GPUBaremetalClusterNewParamsServersSettings{
Interfaces: []cloud.GPUBaremetalClusterNewParamsServersSettingsInterfaceUnion{{
OfExternal: &cloud.GPUBaremetalClusterNewParamsServersSettingsInterfaceExternal{},
}},
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", taskIDList.Tasks)
}
curl --request POST \
--url https://api.gcore.com/cloud/v3/gpu/baremetal/{project_id}/{region_id}/clusters \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"flavor": "g3-ai-32-192-1500-l40s-48-1",
"image_id": "3793c250-0b3b-4678-bab3-e11afbc29657",
"name": "gpu-cluster-1",
"servers_count": 3,
"servers_settings": {
"interfaces": [
{
"type": "<string>",
"ip_family": "ipv4",
"name": "eth0",
"port_security_enabled": true,
"security_groups": [
{
"id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98"
}
]
}
],
"credentials": {
"password": "securepassword",
"ssh_key_name": "my-ssh-key",
"username": "admin"
},
"file_shares": [
{
"id": "a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a",
"mount_path": "/mnt/vast"
}
],
"security_groups": [
{
"id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98"
}
],
"user_data": "eyJ0ZXN0IjogImRhdGEifQ=="
},
"tags": {}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
flavor: 'g3-ai-32-192-1500-l40s-48-1',
image_id: '3793c250-0b3b-4678-bab3-e11afbc29657',
name: 'gpu-cluster-1',
servers_count: 3,
servers_settings: {
interfaces: [
{
type: '<string>',
ip_family: 'ipv4',
name: 'eth0',
port_security_enabled: true,
security_groups: [{id: 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'}]
}
],
credentials: {password: 'securepassword', ssh_key_name: 'my-ssh-key', username: 'admin'},
file_shares: [{id: 'a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a', mount_path: '/mnt/vast'}],
security_groups: [{id: 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'}],
user_data: 'eyJ0ZXN0IjogImRhdGEifQ=='
},
tags: {}
})
};
fetch('https://api.gcore.com/cloud/v3/gpu/baremetal/{project_id}/{region_id}/clusters', 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/v3/gpu/baremetal/{project_id}/{region_id}/clusters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'flavor' => 'g3-ai-32-192-1500-l40s-48-1',
'image_id' => '3793c250-0b3b-4678-bab3-e11afbc29657',
'name' => 'gpu-cluster-1',
'servers_count' => 3,
'servers_settings' => [
'interfaces' => [
[
'type' => '<string>',
'ip_family' => 'ipv4',
'name' => 'eth0',
'port_security_enabled' => true,
'security_groups' => [
[
'id' => 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'
]
]
]
],
'credentials' => [
'password' => 'securepassword',
'ssh_key_name' => 'my-ssh-key',
'username' => 'admin'
],
'file_shares' => [
[
'id' => 'a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a',
'mount_path' => '/mnt/vast'
]
],
'security_groups' => [
[
'id' => 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'
]
],
'user_data' => 'eyJ0ZXN0IjogImRhdGEifQ=='
],
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v3/gpu/baremetal/{project_id}/{region_id}/clusters")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flavor\": \"g3-ai-32-192-1500-l40s-48-1\",\n \"image_id\": \"3793c250-0b3b-4678-bab3-e11afbc29657\",\n \"name\": \"gpu-cluster-1\",\n \"servers_count\": 3,\n \"servers_settings\": {\n \"interfaces\": [\n {\n \"type\": \"<string>\",\n \"ip_family\": \"ipv4\",\n \"name\": \"eth0\",\n \"port_security_enabled\": true,\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ]\n }\n ],\n \"credentials\": {\n \"password\": \"securepassword\",\n \"ssh_key_name\": \"my-ssh-key\",\n \"username\": \"admin\"\n },\n \"file_shares\": [\n {\n \"id\": \"a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a\",\n \"mount_path\": \"/mnt/vast\"\n }\n ],\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ],\n \"user_data\": \"eyJ0ZXN0IjogImRhdGEifQ==\"\n },\n \"tags\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v3/gpu/baremetal/{project_id}/{region_id}/clusters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"flavor\": \"g3-ai-32-192-1500-l40s-48-1\",\n \"image_id\": \"3793c250-0b3b-4678-bab3-e11afbc29657\",\n \"name\": \"gpu-cluster-1\",\n \"servers_count\": 3,\n \"servers_settings\": {\n \"interfaces\": [\n {\n \"type\": \"<string>\",\n \"ip_family\": \"ipv4\",\n \"name\": \"eth0\",\n \"port_security_enabled\": true,\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ]\n }\n ],\n \"credentials\": {\n \"password\": \"securepassword\",\n \"ssh_key_name\": \"my-ssh-key\",\n \"username\": \"admin\"\n },\n \"file_shares\": [\n {\n \"id\": \"a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a\",\n \"mount_path\": \"/mnt/vast\"\n }\n ],\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ],\n \"user_data\": \"eyJ0ZXN0IjogImRhdGEifQ==\"\n },\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}Authorizations
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
Project ID
1
Region ID
7
Body
Cluster flavor ID
"g3-ai-32-192-1500-l40s-48-1"
System image ID
"3793c250-0b3b-4678-bab3-e11afbc29657"
Cluster name
63^[a-zA-Z0-9][a-zA-Z 0-9._\-]{1,61}[a-zA-Z0-9._]$"gpu-cluster-1"
Number of servers in the cluster
3
Configuration settings for the servers in the cluster
Show child attributes
Show child attributes
Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
Show child attributes
Show child attributes
{ "my-tag": "my-tag-value" }
Response
OK
List of task IDs representing asynchronous operations. Use these IDs to monitor operation progress:
GET /v1/tasks/{task_id}- Check individual task status and details Poll task status until completion (FINISHED/ERROR) before proceeding with dependent operations.
["d478ae29-dedc-4869-82f0-96104425f565"]