Rhestru Pob Gweinydd
Adalwch restr o'r holl weinyddion yn eich cyfrif.
Paramedrau'r Ymholiad
| Paramedr |
Math |
Angenrheidiol |
Disgrifiad |
status |
llinyn |
Na |
Hidlo yn ôl statws y gweinydd: gweithredol, wedi'i atal, wedi'i atal |
location |
llinyn |
Na |
Hidlo yn ôl lleoliad canolfan ddata |
Cais Enghraifft
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);
Ymateb Enghraifft
{
"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"
}
]
}
Codau Statws Ymateb
| 200 |
Adalwyd rhestr gweinyddion yn llwyddiannus |
| 401 |
Heb awdurdod - Tocyn API annilys neu ar goll |
Creu Gweinydd Newydd
Defnyddio gweinydd VPS newydd gyda chyfluniad penodol.
Paramedrau Corff y Cais
| Paramedr |
Math |
Angenrheidiol |
Disgrifiad |
name |
llinyn |
Ie |
Enw'r gweinydd (alffaniwmerig, cysylltnodau'n cael eu caniatáu) |
plan_id |
cyfanrif |
Ie |
ID y cynllun VPS |
os_id |
cyfanrif |
Ie |
ID y system weithredu |
location |
llinyn |
Ie |
Cod lleoliad y ganolfan ddata |
hostname |
llinyn |
Na |
Enw gwesteiwr y gweinydd (FQDN) |
ssh_key_id |
cyfanrif |
Na |
ID allwedd SSH i'w osod |
backups_enabled |
boolaidd |
Na |
Galluogi copïau wrth gefn awtomatig (diofyn: ffug) |
Cais Enghraifft
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);
Ymateb Enghraifft
{
"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."
}
Codau Statws Ymateb
| 201 |
Crëwyd y gweinydd yn llwyddiannus |
| 400 |
Cais Gwael - Paramedrau annilys |
| 401 |
Heb awdurdod - Tocyn API annilys neu ar goll |
| 402 |
Taliad Angenrheidiol - Credydau Annigonol |
Cael Manylion y Gweinydd
Adalw gwybodaeth fanwl am weinydd penodol.
Paramedrau Llwybr
| Paramedr |
Math |
Angenrheidiol |
Disgrifiad |
server_id |
cyfanrif |
Ie |
ID gweinydd unigryw |
Cais Enghraifft
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);
Ymateb Enghraifft
{
"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"
}
Codau Statws Ymateb
| 200 |
Adalwyd manylion y gweinydd yn llwyddiannus |
| 401 |
Heb awdurdod - Tocyn API annilys neu ar goll |
| 404 |
Heb ei Ganfod - Nid yw'r Gweinydd yn bodoli |
Gweinydd Diweddaru
Diweddaru ffurfweddiad y gweinydd. Mae'r holl feysydd yn ofynnol.
Paramedrau Llwybr
| Parameter |
Type |
Required |
Description |
server_id |
integer |
Yes |
ID gweinydd unigryw |
Paramedrau Corff y Cais
| Paramedr |
Math |
Angenrheidiol |
Disgrifiad |
name |
llinyn |
Ie |
Enw'r gweinydd |
hostname |
llinyn |
Ie |
Enw gwesteiwr y gweinydd (FQDN) |
backups_enabled |
boolaidd |
Ie |
Galluogi/analluogi copïau wrth gefn awtomatig |
Cais Enghraifft
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())
Codau Statws Ymateb
| 200 |
Diweddarwyd y gweinydd yn llwyddiannus |
| 400 |
Cais Gwael - Paramedrau annilys |
| 404 |
Heb ei Ganfod - Nid yw'r Gweinydd yn bodoli |
Diweddaru'r Gweinydd yn Rhannol
Diweddaru meysydd penodol y gweinydd. Dim ond y meysydd a ddarperir fydd yn cael eu diweddaru.
Cais Enghraifft
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())
Dileu Gweinydd
Dileu gweinydd yn barhaol. Ni ellir dadwneud y weithred hon.
Cais Enghraifft
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)
Codau Statws Ymateb
| 204 |
Dilewyd y gweinydd yn llwyddiannus |
| 404 |
Heb ei Ganfod - Nid yw'r Gweinydd yn bodoli |
Dechrau'r Gweinydd
Trowch weinydd sydd wedi stopio ymlaen.
Cais Enghraifft
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);
Ymateb Enghraifft
{
"status": "success",
"message": "Server is starting",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "starting"
}
}
Codau Statws Ymateb
| 200 |
Gorchymyn cychwyn gweinydd wedi'i anfon yn llwyddiannus |
| 400 |
Cais Gwael - Mae'r gweinydd eisoes yn rhedeg |
| 404 |
Heb ei Ganfod - Nid yw'r Gweinydd yn bodoli |
Stopio'r Gweinydd
Cau gweinydd sy'n rhedeg i lawr yn rasol.
Cais Enghraifft
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())
Ymateb Enghraifft
{
"status": "success",
"message": "Server is stopping",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "stopping"
}
}
Ailgychwyn y Gweinydd
Ailgychwyn gweinydd sy'n rhedeg yn rasol.
Cais Enghraifft
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())
Ymateb Enghraifft
{
"status": "success",
"message": "Server is rebooting",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "rebooting"
}
}
Codau Statws Ymateb
| 200 |
Gorchymyn ailgychwyn y gweinydd wedi'i anfon yn llwyddiannus |
| 400 |
Cais Gwael - Nid yw'r gweinydd yn rhedeg |
| 404 |
Heb ei Ganfod - Nid yw'r Gweinydd yn bodoli |