Depụta sava niile
Weghachite ndepụta nke sava niile dị na akaụntụ gị.
Paịmatị Ajụjụ
| Paramita |
Ụdị |
A chọrọ |
Nkọwa |
status |
eriri |
Mba |
Nyocha site na ọnọdụ sava: na-arụ ọrụ, kwụsịtụrụ, kwụsịtụrụ |
location |
eriri |
Mba |
Nyocha site na ebe ebe nchekwa data |
Arịrịọ Ihe Nlereanya
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);
Ihe Nlereanya Azịza
{
"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"
}
]
}
Koodu Ọnọdụ Nzaghachi
| 200 |
Enwetara ndepụta sava nke ọma |
| 401 |
Enweghị ikike - Akara API na-ezighi ezi ma ọ bụ na-efu |
Mepụta sava ọhụrụ
Tinye sava VPS ọhụrụ nwere nhazi akọwapụtara.
Rịọ maka paramita ahụ
| Paramita |
Ụdị |
A chọrọ |
Nkọwa |
name |
eriri |
Ee |
Aha sava (a na-anabata mkpụrụedemede, akara ngosi) |
plan_id |
ọnụọgụgụ |
Ee |
NJ nke atụmatụ VPS |
os_id |
ọnụọgụgụ |
Ee |
ID nke sistemụ arụmọrụ |
location |
eriri |
Ee |
Koodu ebe ebe nchekwa data |
hostname |
eriri |
Mba |
Aha onye nhazi sava (FQDN) |
ssh_key_id |
ọnụọgụgụ |
Mba |
NJ igodo SSH iji wụnye |
backups_enabled |
Boolean |
Mba |
Mee ka ndabere akpaka rụọ ọrụ (ndabara: ụgha) |
Arịrịọ Ihe Nlereanya
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);
Ihe Nlereanya Azịza
{
"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."
}
Koodu Ọnọdụ Nzaghachi
| 201 |
Emepụtara sava nke ọma |
| 400 |
Arịrịọ Na-adịghị Mma - Paramita Na-adịghị Mma |
| 401 |
Enweghị ikike - Akara API na-ezighi ezi ma ọ bụ na-efu |
| 402 |
Ịkwụ ụgwọ achọrọ - Ekele ezughị oke |
Nweta nkọwa nke sava
Weghachite ozi zuru ezu gbasara sava kpọmkwem.
Usoro Ụzọ
| Paramita |
Ụdị |
A chọrọ |
Nkọwa |
server_id |
ọnụọgụgụ |
Ee |
NJ sava pụrụ iche |
Arịrịọ Ihe Nlereanya
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);
Ihe Nlereanya Azịza
{
"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"
}
Koodu Ọnọdụ Nzaghachi
| 200 |
Enwetara nkọwa sava nke ọma |
| 401 |
Enweghị ikike - Akara API na-ezighi ezi ma ọ bụ na-efu |
| 404 |
Achọtaghị - Sava adịghị adị |
Melite sava
Melite nhazi sava. A chọrọ ubi niile.
Usoro Ụzọ
| Parameter |
Type |
Required |
Description |
server_id |
integer |
Yes |
NJ sava pụrụ iche |
Rịọ maka paramita ahụ
| Paramita |
Ụdị |
A chọrọ |
Nkọwa |
name |
eriri |
Ee |
Aha sava |
hostname |
eriri |
Ee |
Aha onye nhazi sava (FQDN) |
backups_enabled |
Boolean |
Ee |
Mee ka ndabere akpaka rụọ ọrụ/gbanyụọ ndabere |
Arịrịọ Ihe Nlereanya
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())
Koodu Ọnọdụ Nzaghachi
| 200 |
Emelitere sava nke ọma |
| 400 |
Arịrịọ Na-adịghị Mma - Paramita Na-adịghị Mma |
| 404 |
Achọtaghị - Sava adịghị adị |
Melite nkesa nke ọma
Melite ubi sava ụfọdụ. Naanị ubi enyere ka a ga-emelite.
Arịrịọ Ihe Nlereanya
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())
Hichapụ ihe nkesa
Hichapụ sava kpamkpam. Agaghị ewepụ ihe a.
Arịrịọ Ihe Nlereanya
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)
Koodu Ọnọdụ Nzaghachi
| 204 |
Ehichapụrụ sava nke ọma |
| 404 |
Achọtaghị - Sava adịghị adị |
Malite sava
Gbanye ihe nkesa kwụsịrị.
Arịrịọ Ihe Nlereanya
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);
Ihe Nlereanya Azịza
{
"status": "success",
"message": "Server is starting",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "starting"
}
}
Koodu Ọnọdụ Nzaghachi
| 200 |
E zigara iwu mmalite sava nke ọma |
| 400 |
Arịrịọ Na-adịghị Mma - Sava na-agba ọsọ |
| 404 |
Achọtaghị - Sava adịghị adị |
Kwụsị sava
Jiri obiọma mechie sava na-agba ọsọ.
Arịrịọ Ihe Nlereanya
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())
Ihe Nlereanya Azịza
{
"status": "success",
"message": "Server is stopping",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "stopping"
}
}
Malitegharịa sava
Malitegharịa sava na-agba ọsọ nke ọma.
Arịrịọ Ihe Nlereanya
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())
Ihe Nlereanya Azịza
{
"status": "success",
"message": "Server is rebooting",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "rebooting"
}
}
Koodu Ọnọdụ Nzaghachi
| 200 |
E zigara iwu mmaliteghachi sava nke ọma |
| 400 |
Arịrịọ Na-adịghị Mma - Sava anaghị agba ọsọ |
| 404 |
Achọtaghị - Sava adịghị adị |