compute

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

Start, stop or restart one service inside a server.

सभी compute एंडपॉइंट्स

सभी डेवलपर दस्तावेज़

प्रमाणन

बेरर टोकन के रूप में एक API कुंजी भेजें। कुंजी के पास sites.view अनुमति होनी चाहिए; इसके बिना एक कुंजी को 404 के बजाय 403 के साथ अस्वीकार कर दिया जाता है।

यह एंडपॉइंट कोई संगठन आईडी नहीं लेता है। आपकी कुंजी पहले से ही उस संगठन की पहचान करती है जिससे वह संबंधित है, और प्रतिक्रिया उसी के दायरे में है।

इसे आज़माएँ

कोणार्कित ब्रैकेट्स में दी गई किसी भी चीज़ को अपने मानों से बदलें, और की प्लेसहोलर को अपने डैशबोर्ड की एक की से बदलें।

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…
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 may…

प्रतिक्रिया

नामप्रकारआवश्यकयह क्या है
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…

त्रुटियाँ जो यह एंडपॉइंट लौटा सकता है

401 · 403 · 404 · 422 · 429 · 503