feat(api): add CronClient for /crontab endpoints#17
Draft
Conversation
6 tasks
Agent-Logs-Url: https://github.com/rtCamp/wp-cloud-atomic-sdk/sessions/4131e6b4-ea2a-471a-a10b-a12a5f671135 Co-authored-by: rtBot <43742164+rtBot@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add CronClient resource for /crontab endpoints
feat(api): add CronClient for /crontab endpoints
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
CronClientto cover the three previously unwrapped/crontab/{site}/*endpoints, modelled onedge_cache.py.New:
atomic_sdk/api/cron.pylist(site_id|domain)→GET /crontab/{site}/listadd(schedule, command, site_id|domain)→POST /crontab/{site}/add; raisesValueErroron emptyscheduleorcommandremove(cron_id, site_id|domain)→POST /crontab/{site}/removefind(cron_id=…|command=…, site_id|domain)— client-side filter overlist()clear(site_id|domain)— destructive list+remove-all; returns removed IDsAll methods raise
ValueErrorwhen neithersite_idnordomainis provided. 4xx/5xx errors surface via inherited_requesttranslation — no bespoke try/except.Schedule semantics and platform constraints (8 h max runtime, no stacking, 3-concurrent limit,
site-cron-resultswebhook on failure) are documented in docstrings.atomic_sdk/client.pyCronClientimported and attached asself.cron, alphabetically betweenclientandcustom_certificates.examples/cron/01_manage_cron.pyBoth
examples/README.mdand the top-levelREADME.mdupdated to include Cron in the supported-resources list.