ഉപയോക്തൃ API
API എന്ന ഉപയോക്താവ് ആധികാരികതയുള്ള ഉപഭോക്താവിൻ്റെ ഉറവിടങ്ങൾ കൈകാര്യം ചെയ്യുന്നു. എല്ലാ പാതയും സ്കോപ്പ് ചെയ്തിരിക്കുന്നു: ഊഹിച്ച ഐഡൻ്റിഫയർ ഉപയോഗിച്ച് പോലും ഒരു അക്കൗണ്ടിൻ്റെ ടോക്കണിന് മറ്റൊരു അക്കൗണ്ടിൻ്റെ ഡാറ്റ വായിക്കാനോ എഴുതാനോ കഴിയില്ല.
അവസാന പോയിൻ്റുകൾ
| രീതി | പാത | ഉദ്ദേശ്യം |
|---|---|---|
GET | /api/user/sites | സൈറ്റുകൾ ലിസ്റ്റ് ചെയ്യുക |
POST | /api/user/sites | ഒരു സൈറ്റ് സൃഷ്ടിക്കുക |
GET | /api/user/sites/{id} | സൈറ്റ് വിശദാംശങ്ങൾ |
PATCH | /api/user/sites/{id} | ക്രമീകരണങ്ങൾ അപ്ഡേറ്റ് ചെയ്യുക |
DELETE | /api/user/sites/{id} | ഒരു സൈറ്റ് ഇല്ലാതാക്കുക |
GET | /api/user/sites/{id}/php/settings | PHP കോൺഫിഗറേഷൻ വായിക്കുക |
PUT | /api/user/sites/{id}/php/settings | അപ്ഡേറ്റ് ഓവർറൈഡുകൾ |
POST | /api/user/sites/{id}/php/settings/reset | അസാധുവാക്കലുകൾ പുനഃസജ്ജമാക്കുക |
GET | /api/user/sites/{id}/php/extensions | വിപുലീകരണങ്ങളുടെ പട്ടിക |
GET | /api/user/databases | ഡാറ്റാബേസുകൾ ലിസ്റ്റ് ചെയ്യുക |
POST | /api/user/databases | ഒരു ഡാറ്റാബേസ് സൃഷ്ടിക്കുക |
GET | /api/user/backups | സ്നാപ്പ്ഷോട്ടുകൾ ലിസ്റ്റ് ചെയ്യുക |
POST | /api/user/backups/run | ഒരു ബാക്കപ്പ് ട്രിഗർ ചെയ്യുക |
GET | /api/user/tickets | ടിക്കറ്റുകൾ ലിസ്റ്റ് ചെയ്യുക |
POST | /api/user/tickets | ഒരു ടിക്കറ്റ് തുറക്കുക |
സൈറ്റുകൾ ലിസ്റ്റ് ചെയ്യുക
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 }
}ഒരു സൈറ്റ് സൃഷ്ടിക്കുക
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"
}അക്കൗണ്ടിൽ ഇതിനകം ഉപയോഗിച്ചിട്ടുള്ള ഒരു ഡൊമെയ്ൻ, അക്കൗണ്ട് ഹോമിന് പുറത്തുള്ള ഒരു ഡോക്യുമെൻ്റ് root, പിന്തുണയ്ക്കാത്ത PHP പതിപ്പ് എന്നിവ മൂല്യനിർണ്ണയം നിരസിക്കുന്നു. ഒരു വിജയകരമായ സൃഷ്ടി സൈറ്റ് ഒബ്ജക്റ്റിനൊപ്പം 201 നൽകുന്നു.
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": []
}
}അപ്ഡേറ്റ് ഓവർറൈഡുകൾ
നിങ്ങൾ മാറ്റാൻ ആഗ്രഹിക്കുന്ന നിർദ്ദേശങ്ങൾ മാത്രം അയയ്ക്കുക. ഒഴിവാക്കിയ കീകൾ അവയുടെ നിലവിലെ മൂല്യം നിലനിർത്തുന്നു; null ഒരു ഓവർറൈഡ് നീക്കം ചെയ്യുകയും അനന്തരാവകാശം പുനഃസ്ഥാപിക്കുകയും ചെയ്യുന്നു.
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"
}
}അസാധുവായ മൂല്യങ്ങൾ ആറ്റോമികമായി പരാജയപ്പെടുന്നു - ഓരോ നിർദ്ദേശവും മൂല്യനിർണ്ണയം കടന്നുപോകുന്നില്ലെങ്കിൽ ഒന്നും എഴുതപ്പെടുന്നില്ല:
{
"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"
}
}എല്ലാ ഓവർറൈഡുകളും പുനഃസജ്ജമാക്കുക:
POST /api/user/sites/42/php/settings/resetവിപുലീകരണങ്ങൾ
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"]
}
}വിപുലീകരണ മാറ്റങ്ങൾക്ക് സിസ്റ്റം പാക്കേജുകൾ ആവശ്യമുള്ളപ്പോൾ ഒരു അഡ്മിനിസ്ട്രേറ്റർ ആവശ്യമാണ്; ഒരു ടിക്കറ്റിലൂടെ അവരോട് അഭ്യർത്ഥിക്കുക.
ഡാറ്റാബേസുകളും ബാക്കപ്പുകളും
POST /api/user/databases
{
"name": "shop_prod",
"user": "shop_user",
"charset": "utf8mb4"
}POST /api/user/backups/run
{
"scope": ["files", "database"],
"site_id": 42
}ബാക്കപ്പ് ജോലികൾ ഒരു ജോലി ഐഡൻ്റിഫയർ നൽകുന്നു; അഭ്യർത്ഥന തടയുന്നതിനുപകരം സ്റ്റാറ്റസിനായി GET /api/user/backups വോട്ടെടുപ്പ് നടത്തുക.
പിശകുകൾ
| കോഡ് | അർത്ഥം |
|---|---|
validation_failed | ഒന്നോ അതിലധികമോ ഫീൽഡുകൾ നിരസിച്ചു |
quota_exceeded | പാക്കേജ് പരിധി എത്തി |
duplicate_domain | ഡൊമെയ്ൻ ഇതിനകം വ്യാപ്തിയിൽ നിലവിലുണ്ട് |
not_found | ടോക്കൺ അക്കൗണ്ടിന് പുറത്തുള്ള ഉറവിടം |
php_reload_failed | കോൺഫിഗറേഷൻ സാധുവാണ്, പക്ഷേ റീലോഡ് പരാജയപ്പെട്ടു |
ബന്ധപ്പെട്ട
- ഡയറക്ടീവ് സെമാൻ്റിക്സിനായി PHP റൺടൈം.
- API അവലോകനം പ്രാമാണീകരണത്തിനും പേജിനുമായി
- ഫ്ലീറ്റ് പ്രവർത്തനങ്ങൾക്കായി അഡ്മിൻ API.