compute

POST /v1/compute/servers/{serverId}/services/action

Start, stop or restart one service inside a server.

සියලුම compute අන්ත ලක්ෂ්‍ය

සත්‍යාපනය

බෙරර් ටෝකනයක් ලෙස API යතුරක් යවන්න. යතුරෙහි sites.view අවසරය තිබිය යුතුය; එය නොමැති යතුරක් 404 ලෙස නොව 403 ලෙස ප්‍රතික්ෂේප කෙරේ.

මෙම අවසාන ලක්ෂ්‍යය සඳහා සංවිධාන හැඳුනුම්පතක් (organisation id) අවශ්‍ය නොවේ. ඔබගේ යතුර මඟින් එය අයත් වන සංවිධානය දැනටමත් හඳුනා ගන්නා අතර, ප්‍රතිචාරය ඒ වෙත සීමා වේ.

උත්සාහ කරන්න

<අගයන්> සමඟ කෝණික වරහන් තුළ ඇති ඕනෑම දෙයක් සහ ඔබේ උපකරණ පුවරුවෙන් ලබාගත් යතුරක් සමඟ key ස්ථාන දායකය ප්‍රතිස්ථාපනය කරන්න.

curl -X POST https://api.zinndigital.com/v1/compute/servers/{serverId}/services/action \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "unit": <string>, "action": <string<start, stop, restart>> }'

පද්ධතියට පිවිස සිටිනවාද? ඔබගේ උපකරණ පුවරුවේ ඇති API කොන්සෝලය මඟින් ඔබේ සැබෑ ආයතනික හැඳුනුම්පත සහ ඔබේම යතුර පුරවා, සජීවී API වෙත ඉල්ලීම ක්‍රියාත්මක කරන බැවින් ඔබට සැබෑ ප්‍රතිචාරය දැකගත හැක. මෙම අග්‍රලක්ෂ්‍යය API කොන්සෝලය තුළ විවෘත කරන්න

විස්තර

Acts on a single service unit inside the machine - Apache, MariaDB, ProFTPD - while the machine itself stays up. This is the difference between a customer whose site is down fixing it themselves in ten seconds and a customer opening a ticket. ⛔ **Not the same blast radius as `setComputeServerPower`.** That one moves the whole machine; this moves one unit inside a machine that keeps running. Stopping a web server or a database still takes every website on that box off the air, so the operation is audit-logged with the real actor. ⛔ **`unit` must be a service the machine is currently running.** The engine checks the name against the machine's own live service list before sending anything, so an arbitrary systemd unit - `sshd.service`, a firewall, the enrolment agent - is refused with a `422` that names what is available instead. The list this endpoint's sibling `listComputeServerServices` returns is exactly the set that may be named here. The response carries the provider's own confirmation sentence, which is worth showing to the customer verbatim. `404` for a server that is not the caller's; `422` for a machine that is not `active`, a unit it does not run, or a verb outside start/stop/restart. Requires `sites.view` **and** `sites.restart`.

පරාමිතීන්

නමවර්ගයඅත්‍යවශ්‍යයිඑය කුමක්ද
serverId (path)Uuidඔව්The server's id, as `listComputeServers` reports it. **Ours** (UUIDv7), minted when the order row was written — never the provider's own identifier for the machine.

ඉල්ලුම් පත්‍ර ශරීරය

නමවර්ගයඅත්‍යවශ්‍යයිඑය කුමක්ද
unitstringඔව්The service unit to act on, exactly as `listComputeServerServices` reports it (`httpd.service`, `mariadb.service`, `proftpd.service`). ⛔ Must be a unit the machine is **currentl…
actionstring<start, stop, restart>ඔව්⛔ A closed vocabulary. `reload`, `enable` and `disable` are deliberately absent: they have never been proven against a provider, and a verb we have not proven is a button that m…

පsspil

නමවර්ගයඅත්‍යවශ්‍යයිඑය කුමක්ද
messagestringඔව්The provider's own confirmation sentence — *"Service proftpd.service was stopped successfully."* — passed through verbatim, because it is more specific than anything we would su…

මෙම අවසාන ලක්ෂ්‍යය ආපසු ලබා දිය හැකි දෝෂ

401 · 403 · 404 · 422 · 429 · 503