API ya modirisi
Modirisi API o laola didirisiwa tse e leng tsa moreki yo o netefaditsweng. Tsela nngwe le nngwe e na le sekoupu: letshwao la akhaonto e le nngwe ga le kgone go bala kgotsa go kwala tshedimosetso ya akhaonto e nngwe, le fa e le ka sesupo se se fopholediwang.
Dintlha tsa bokhutlo
| Mokgwa | Tsela | Boikaelelo |
|---|---|---|
| WFP0X | WFP0X | Lenaane la mafelo |
| WFP0X | WFP0X | Tlhama saete |
| WFP0X | WFP0X | Dintlha tsa lefelo |
| WFP0X | WFP0X | Ntšhwafatsa diseting |
| WFP0X | WFP0X | Phimola saete |
| WFP0X | WFP0X | Buisa thulaganyo ya PHP |
| WFP0X | WFP0X | Ntšhwafatsa phimolo |
| WFP0X | WFP0X | Seta gape diphetolo |
| WFP0X | WFP0X | Dikatoloso tsa lenaane |
| WFP0X | WFP0X | Lenaane la dipolokelotshedimosetso |
| WFP0X | WFP0X | Tlhama polokelotshedimosetso |
| WFP0X | WFP0X | Lenaane la dinepe |
| WFP0X | WFP0X | Tlhotlheletsa bekapo |
| WFP0X | WFP0X | Lenaane la dithekete |
| WFP0X | WFP0X | Bula thekete |
Lenaane la mafelo
GET /api/user/sites?page=1&per_page=25
Authorization: Bearer <token>{
"ok": true,
"data": [
{
"id": 42,
"domain": "app.example.com",
"document_root": "/home/acme/sites/app.example.com/public",
"php_version": "8.3",
"ssl": { "status": "active", "expires_at": "2027-02-18T00:00:00Z" },
"disk_used_mb": 1840,
"status": "active"
}
],
"meta": { "page": 1, "per_page": 25, "total": 1 }
}Tlhama saete
POST /api/user/sites
Content-Type: application/json
{
"domain": "shop.example.com",
"php_version": "8.3",
"document_root": "/home/acme/sites/shop.example.com/public"
}Netefatso e gana domeine e e setseng e dirisiwa mo akhaontong, tokomane ya root kwa ntle ga legae la akhaonto le mofuta wa PHP o o sa tshegediweng. Go tlhama go go atlegileng go busetsa 201 ka selo sa saete.
Buisa diseting tsa PHP
GET /api/user/sites/42/php/settings{
"ok": true,
"data": {
"php_version": "8.3",
"runtime": "fpm",
"supported": [
"memory_limit", "max_execution_time", "max_input_time",
"upload_max_filesize", "post_max_size", "max_input_vars",
"display_errors", "error_reporting", "date.timezone",
"session.gc_maxlifetime"
],
"inherited": {
"memory_limit": "128M",
"max_execution_time": "60",
"post_max_size": "64M"
},
"overrides": {
"memory_limit": "256M"
},
"effective": {
"memory_limit": "256M",
"max_execution_time": "60",
"post_max_size": "64M"
},
"limits": {
"memory_limit": { "min": "64M", "max": "1G" },
"max_execution_time": { "min": 30, "max": 300 }
},
"warnings": []
}
}Ntšhwafatsa phimolo
Romela fela ditaelo tse o batlang go di fetola. Dinotlolo tse di tlogetsweng di boloka boleng jwa tsone jwa ga jaana; null e tlosa go tlola le go busetsa boswa.
PUT /api/user/sites/42/php/settings
Content-Type: application/json
{
"overrides": {
"memory_limit": "256M",
"upload_max_filesize": "128M",
"post_max_size": "128M",
"date.timezone": "Asia/Shanghai"
}
}Dipalo tse di sa direng di palelwa ka atomo — ga go sepe se se kwalwang ntle le fa taelo nngwe le nngwe e feta netefatso:
{
"ok": false,
"error": {
"code": "validation_failed",
"message": "post_max_size must be greater than or equal to upload_max_filesize",
"fields": { "post_max_size": "lt_upload_max_filesize" },
"request_id": "req_01J8Z4A2"
}
}Seta gape diphetolo tsotlhe:
POST /api/user/sites/42/php/settings/resetDikatoloso
GET /api/user/sites/42/php/extensions{
"ok": true,
"data": {
"php_version": "8.3",
"loaded": ["bcmath", "curl", "gd", "intl", "mbstring", "opcache", "openssl", "pdo_mysql", "redis", "zip"],
"available": ["imagick", "sodium", "xdebug"]
}
}Diphetogo tsa katoloso di tlhoka motsamaisi fa di tlhoka diphuthelwana tsa tsamaiso; di kope ka thekete.
Dipolokelotshedimosetso le dibekapo
POST /api/user/databases
{
"name": "shop_prod",
"user": "shop_user",
"charset": "utf8mb4"
}POST /api/user/backups/run
{
"scope": ["files", "database"],
"site_id": 42
}Ditiro tsa bekapo di busetsa sesupo sa tiro; poll GET /api/user/backups bakeng sa boemo ho ena le ho thibela kopo.
Diphoso
| Khoutu | Bokao |
|---|---|
| WFP0X | Karolo e le nngwe kgotsa go feta e gannwe |
| WFP0X | Tekanyetso ya sephuthelwana e fitlheletswe |
| WFP0X | Domeine e setse e le teng mo sekopong |
| WFP0X | Motswedi o o kwa ntle ga akhaonto ya letshwao |
| WFP0X | Thulaganyo e a siama mme ga e a laisa gape |
Amana
- PHP nako ya go dira ya bokao jwa ditaelo
- Tshobokanyo ya API ya netefatso le go tsenya ditsebe
- Motsamaisi API ya ditiro tsa dikepe