Арендовать инстанс
curl --request POST \
--url https://api.qudata.ai/v0/instances/create \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"offer_id": "<string>",
"template_id": "<string>",
"reserve_period": "month"
}
'import requests
url = "https://api.qudata.ai/v0/instances/create"
payload = {
"offer_id": "<string>",
"template_id": "<string>",
"reserve_period": "month"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({offer_id: '<string>', template_id: '<string>', reserve_period: 'month'})
};
fetch('https://api.qudata.ai/v0/instances/create', 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.qudata.ai/v0/instances/create",
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([
'offer_id' => '<string>',
'template_id' => '<string>',
'reserve_period' => 'month'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.qudata.ai/v0/instances/create"
payload := strings.NewReader("{\n \"offer_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"reserve_period\": \"month\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.qudata.ai/v0/instances/create")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"offer_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"reserve_period\": \"month\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qudata.ai/v0/instances/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"offer_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"reserve_period\": \"month\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": [
{
"id": "<string>",
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"actual_offer": {
"id": "<string>",
"gpu_name": "<string>",
"configuration": {
"ram": {
"amount": 123
},
"disk": {
"amount": 123
},
"cpu_name": "<string>",
"vcpu": 123,
"cpu_cores": 123,
"cpu_freq": 123,
"memory_speed": 123,
"ethernet_in": 123,
"ethernet_out": 123,
"capacity": 123,
"max_cuda_version": 123
},
"in_stock": true,
"rentable": true,
"provider": {
"id": "<string>",
"name": "<string>",
"translit_name": "<string>",
"country": "<string>",
"logo": "<string>",
"meta_title": "<string>",
"meta_description": "<string>",
"use_vpn": true
},
"gpu_amount": 123,
"gpu_translit_name": "<string>",
"vram": 123,
"prices": [],
"location": {
"city": "<string>",
"country": "<string>",
"region": "<string>"
},
"extra": {},
"url": "<string>",
"is_third_party": false,
"offers_amount": 0,
"countries_amount": 0,
"disk_prices": [],
"available_until": "2023-11-07T05:31:56Z",
"real_price": 123,
"disk_real_price": 123
},
"actual_template": {
"id": "<string>",
"image": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"name": "<string>",
"description": "<string>",
"readme": "<string>",
"image_tag": "latest",
"docker_private": {
"registry": "<string>",
"login": "<string>",
"password": "<string>"
},
"env_variables": {},
"command": "<string>",
"ports": {},
"ssh_enabled": false,
"ssh_username": "root",
"ui_available": false,
"ui_path": "<string>",
"ui_port": 123,
"min_storage_gb": 123,
"gpus": [],
"url": "<string>",
"picture": "<string>",
"is_private": false,
"template_version": 0
},
"hoster_id": "<string>",
"host_id": "<string>",
"third_party_id": "<string>",
"cloud_id": "<string>",
"total_cost": 0,
"total_uptime": 0,
"storage_gb": 0,
"initialized_at": "2023-11-07T05:31:56Z",
"prepaid_until": "2023-11-07T05:31:56Z",
"is_prepaid": false,
"uptime_price": 0,
"pause_price": 0,
"gpu_util": 0,
"cpu_util": 0,
"ram_util": 0,
"mem_util": 0,
"inet_in": 0,
"inet_out": 0,
"status": "pending",
"message": "<string>",
"logs": "<string>",
"ports": {},
"address": "<string>",
"ssh_enabled": false,
"ssh_port": 123,
"ssh_host": "<string>",
"ssh_username": "<string>",
"ssh_password": "<string>",
"ssh_keys": [],
"ui_available": false,
"ui_url": "<string>",
"tunnel_host": "<string>",
"tunnel_token": "<string>",
"red_flagged": false,
"label": true,
"deployment_data": {
"base_url": "<string>"
},
"is_raw": true
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Инстансы
Арендовать инстанс
Арендует выбранный сервер и запускает на нём указанный шаблон
POST
/
v0
/
instances
/
create
Арендовать инстанс
curl --request POST \
--url https://api.qudata.ai/v0/instances/create \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"offer_id": "<string>",
"template_id": "<string>",
"reserve_period": "month"
}
'import requests
url = "https://api.qudata.ai/v0/instances/create"
payload = {
"offer_id": "<string>",
"template_id": "<string>",
"reserve_period": "month"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({offer_id: '<string>', template_id: '<string>', reserve_period: 'month'})
};
fetch('https://api.qudata.ai/v0/instances/create', 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.qudata.ai/v0/instances/create",
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([
'offer_id' => '<string>',
'template_id' => '<string>',
'reserve_period' => 'month'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.qudata.ai/v0/instances/create"
payload := strings.NewReader("{\n \"offer_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"reserve_period\": \"month\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.qudata.ai/v0/instances/create")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"offer_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"reserve_period\": \"month\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qudata.ai/v0/instances/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"offer_id\": \"<string>\",\n \"template_id\": \"<string>\",\n \"reserve_period\": \"month\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": [
{
"id": "<string>",
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"actual_offer": {
"id": "<string>",
"gpu_name": "<string>",
"configuration": {
"ram": {
"amount": 123
},
"disk": {
"amount": 123
},
"cpu_name": "<string>",
"vcpu": 123,
"cpu_cores": 123,
"cpu_freq": 123,
"memory_speed": 123,
"ethernet_in": 123,
"ethernet_out": 123,
"capacity": 123,
"max_cuda_version": 123
},
"in_stock": true,
"rentable": true,
"provider": {
"id": "<string>",
"name": "<string>",
"translit_name": "<string>",
"country": "<string>",
"logo": "<string>",
"meta_title": "<string>",
"meta_description": "<string>",
"use_vpn": true
},
"gpu_amount": 123,
"gpu_translit_name": "<string>",
"vram": 123,
"prices": [],
"location": {
"city": "<string>",
"country": "<string>",
"region": "<string>"
},
"extra": {},
"url": "<string>",
"is_third_party": false,
"offers_amount": 0,
"countries_amount": 0,
"disk_prices": [],
"available_until": "2023-11-07T05:31:56Z",
"real_price": 123,
"disk_real_price": 123
},
"actual_template": {
"id": "<string>",
"image": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"user_id": "<string>",
"name": "<string>",
"description": "<string>",
"readme": "<string>",
"image_tag": "latest",
"docker_private": {
"registry": "<string>",
"login": "<string>",
"password": "<string>"
},
"env_variables": {},
"command": "<string>",
"ports": {},
"ssh_enabled": false,
"ssh_username": "root",
"ui_available": false,
"ui_path": "<string>",
"ui_port": 123,
"min_storage_gb": 123,
"gpus": [],
"url": "<string>",
"picture": "<string>",
"is_private": false,
"template_version": 0
},
"hoster_id": "<string>",
"host_id": "<string>",
"third_party_id": "<string>",
"cloud_id": "<string>",
"total_cost": 0,
"total_uptime": 0,
"storage_gb": 0,
"initialized_at": "2023-11-07T05:31:56Z",
"prepaid_until": "2023-11-07T05:31:56Z",
"is_prepaid": false,
"uptime_price": 0,
"pause_price": 0,
"gpu_util": 0,
"cpu_util": 0,
"ram_util": 0,
"mem_util": 0,
"inet_in": 0,
"inet_out": 0,
"status": "pending",
"message": "<string>",
"logs": "<string>",
"ports": {},
"address": "<string>",
"ssh_enabled": false,
"ssh_port": 123,
"ssh_host": "<string>",
"ssh_username": "<string>",
"ssh_password": "<string>",
"ssh_keys": [],
"ui_available": false,
"ui_url": "<string>",
"tunnel_host": "<string>",
"tunnel_token": "<string>",
"red_flagged": false,
"label": true,
"deployment_data": {
"base_url": "<string>"
},
"is_raw": true
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Авторизации
Тело
application/json
⌘I