Bütün Serverləri Siyahıya Alın
Hesabınızdakı bütün serverlərin siyahısını əldə edin.
Sorğu Parametrləri
| Parametr |
Növü |
Tələb olunur |
Təsvir |
status |
sim |
Xeyr |
Server statusuna görə filtrləyin: aktiv, dayandırılmış, dayandırılmış |
location |
sim |
Xeyr |
Məlumat mərkəzinin yerləşməsinə görə filtrləyin |
Nümunə Sorğu
cURL
Python
JavaScript
PHP
curl -X GET "https://admin.vps.org/api/v1/servers/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
url = "https://admin.vps.org/api/v1/servers/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/servers/', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const servers = await response.json();
console.log(servers);
$ch = curl_init('https://admin.vps.org/api/v1/servers/');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_TOKEN',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$servers = json_decode($response, true);
curl_close($ch);
Nümunə Cavab
{
"count": 2,
"results": [
{
"id": 12345,
"name": "web-server-01",
"hostname": "web01.example.com",
"status": "active",
"ip_address": "203.0.113.10",
"location": "us-west",
"plan": {
"id": 1,
"name": "Standard VPS",
"vcpus": 2,
"memory": 4096,
"storage": 80
},
"os": {
"id": 5,
"name": "Ubuntu 22.04 LTS"
},
"created_at": "2025-01-10T14:30:00Z",
"updated_at": "2025-01-15T10:20:00Z"
},
{
"id": 12346,
"name": "db-server-01",
"hostname": "db01.example.com",
"status": "active",
"ip_address": "203.0.113.11",
"location": "us-east",
"plan": {
"id": 2,
"name": "Performance VPS",
"vcpus": 4,
"memory": 8192,
"storage": 160
},
"os": {
"id": 3,
"name": "Debian 12"
},
"created_at": "2025-01-12T09:15:00Z",
"updated_at": "2025-01-16T08:45:00Z"
}
]
}
Cavab Status Kodları
| 200 |
Server siyahısı uğurla əldə edildi |
| 401 |
İcazəsiz - Yanlış və ya çatışmayan API tokeni |
Yeni Server Yaradın
Müəyyən edilmiş konfiqurasiya ilə yeni bir VPS serveri yerləşdirin.
Əsas Parametrləri Sorğu
| Parametr |
Növü |
Tələb olunur |
Təsvir |
name |
sim |
Bəli |
Server adı (əlifba-rəqəm, defislərə icazə verilir) |
plan_id |
tam |
Bəli |
VPS planının ID-si |
os_id |
tam |
Bəli |
Əməliyyat sisteminin ID-si |
location |
sim |
Bəli |
Məlumat mərkəzinin yer kodu |
hostname |
sim |
Xeyr |
Server host adı (FQDN) |
ssh_key_id |
tam |
Xeyr |
Quraşdırılacaq SSH açar ID-si |
backups_enabled |
boolean |
Xeyr |
Avtomatik ehtiyat nüsxələrini aktivləşdirin (standart: yalan) |
Nümunə Sorğu
cURL
Python
JavaScript
PHP
curl -X POST "https://admin.vps.org/api/v1/servers/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "web-server-02",
"plan_id": 1,
"os_id": 5,
"location": "us-west",
"hostname": "web02.example.com",
"backups_enabled": true
}'
import requests
url = "https://admin.vps.org/api/v1/servers/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
data = {
"name": "web-server-02",
"plan_id": 1,
"os_id": 5,
"location": "us-west",
"hostname": "web02.example.com",
"backups_enabled": True
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/servers/', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'web-server-02',
plan_id: 1,
os_id: 5,
location: 'us-west',
hostname: 'web02.example.com',
backups_enabled: true
})
});
const server = await response.json();
console.log(server);
$data = [
'name' => 'web-server-02',
'plan_id' => 1,
'os_id' => 5,
'location' => 'us-west',
'hostname' => 'web02.example.com',
'backups_enabled' => true
];
$ch = curl_init('https://admin.vps.org/api/v1/servers/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_TOKEN',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$server = json_decode($response, true);
curl_close($ch);
Nümunə Cavab
{
"id": 12347,
"name": "web-server-02",
"hostname": "web02.example.com",
"status": "provisioning",
"ip_address": null,
"location": "us-west",
"plan": {
"id": 1,
"name": "Standard VPS",
"vcpus": 2,
"memory": 4096,
"storage": 80
},
"os": {
"id": 5,
"name": "Ubuntu 22.04 LTS"
},
"backups_enabled": true,
"created_at": "2025-01-16T15:30:00Z",
"updated_at": "2025-01-16T15:30:00Z",
"message": "Server is being provisioned. This may take 2-5 minutes."
}
Cavab Status Kodları
| 201 |
Server uğurla yaradıldı |
| 400 |
Yanlış Sorğu - Yanlış parametrlər |
| 401 |
İcazəsiz - Yanlış və ya çatışmayan API tokeni |
| 402 |
Ödəniş tələb olunur - Kreditlər kifayət deyil |
Server Məlumatlarını Əldə Edin
Müəyyən bir server haqqında ətraflı məlumat əldə edin.
Yol Parametrləri
| Parametr |
Növü |
Tələb olunur |
Təsvir |
server_id |
tam |
Bəli |
Unikal server ID-si |
Nümunə Sorğu
curl -X GET "https://admin.vps.org/api/v1/servers/12345/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
const serverId = 12345;
const response = await fetch(`https://admin.vps.org/api/v1/servers/${serverId}/`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const server = await response.json();
console.log(server);
Nümunə Cavab
{
"id": 12345,
"name": "web-server-01",
"hostname": "web01.example.com",
"status": "active",
"ip_address": "203.0.113.10",
"ipv6_address": "2001:0db8::1",
"location": "us-west",
"plan": {
"id": 1,
"name": "Standard VPS",
"vcpus": 2,
"memory": 4096,
"storage": 80,
"bandwidth": 2048
},
"os": {
"id": 5,
"name": "Ubuntu 22.04 LTS"
},
"backups_enabled": true,
"resource_usage": {
"cpu_percent": 23.5,
"memory_used": 2048,
"disk_used": 35,
"bandwidth_used": 450
},
"created_at": "2025-01-10T14:30:00Z",
"updated_at": "2025-01-16T15:45:00Z"
}
Cavab Status Kodları
| 200 |
Server məlumatları uğurla əldə edildi |
| 401 |
İcazəsiz - Yanlış və ya çatışmayan API tokeni |
| 404 |
Tapılmadı - Server mövcud deyil |
Serveri Yeniləyin
Server konfiqurasiyasını yeniləyin. Bütün sahələr doldurulmalıdır.
Yol Parametrləri
| Parameter |
Type |
Required |
Description |
server_id |
integer |
Yes |
Unikal server ID-si |
Əsas Parametrləri Sorğu
| Parametr |
Növü |
Tələb olunur |
Təsvir |
name |
sim |
Bəli |
Server adı |
hostname |
sim |
Bəli |
Server host adı (FQDN) |
backups_enabled |
boolean |
Bəli |
Avtomatik ehtiyat nüsxələrini aktivləşdirin/deaktiv edin |
Nümunə Sorğu
curl -X PUT "https://admin.vps.org/api/v1/servers/12345/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "web-server-updated",
"hostname": "web-updated.example.com",
"backups_enabled": true
}'
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
data = {
"name": "web-server-updated",
"hostname": "web-updated.example.com",
"backups_enabled": True
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
Cavab Status Kodları
| 200 |
Server uğurla yeniləndi |
| 400 |
Yanlış Sorğu - Yanlış parametrlər |
| 404 |
Tapılmadı - Server mövcud deyil |
Serveri Qismən Yeniləyin
Müəyyən server sahələrini yeniləyin. Yalnız təqdim edilmiş sahələr yenilənəcək.
Nümunə Sorğu
curl -X PATCH "https://admin.vps.org/api/v1/servers/12345/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "new-server-name"
}'
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
data = {"name": "new-server-name"}
response = requests.patch(url, headers=headers, json=data)
print(response.json())
Serveri Sil
Serveri birdəfəlik silin. Bu əməliyyat geri qaytarıla bilməz.
Nümunə Sorğu
curl -X DELETE "https://admin.vps.org/api/v1/servers/12345/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.delete(url, headers=headers)
print(response.status_code)
Cavab Status Kodları
| 204 |
Server uğurla silindi |
| 404 |
Tapılmadı - Server mövcud deyil |
Serveri Başlat
Dayanmış serveri yandırın.
Nümunə Sorğu
curl -X POST "https://admin.vps.org/api/v1/servers/12345/start/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/start/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())
const serverId = 12345;
const response = await fetch(`https://admin.vps.org/api/v1/servers/${serverId}/start/`, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const result = await response.json();
console.log(result);
Nümunə Cavab
{
"status": "success",
"message": "Server is starting",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "starting"
}
}
Cavab Status Kodları
| 200 |
Serverin başlanğıc əmri uğurla göndərildi |
| 400 |
Səhv Sorğu - Server artıq işləyir |
| 404 |
Tapılmadı - Server mövcud deyil |
Serveri Dayandırın
İşləyən serveri zərifcə söndürün.
Nümunə Sorğu
curl -X POST "https://admin.vps.org/api/v1/servers/12345/stop/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/stop/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())
Nümunə Cavab
{
"status": "success",
"message": "Server is stopping",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "stopping"
}
}
Serveri yenidən başladın
İşləyən serveri zərifcə yenidən başladın.
Nümunə Sorğu
curl -X POST "https://admin.vps.org/api/v1/servers/12345/reboot/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/reboot/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())
Nümunə Cavab
{
"status": "success",
"message": "Server is rebooting",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "rebooting"
}
}
Cavab Status Kodları
| 200 |
Serverin yenidən başlatma əmri uğurla göndərildi |
| 400 |
Səhv Sorğu - Server işləmir |
| 404 |
Tapılmadı - Server mövcud deyil |