Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Frontend Migration]: Add API endpoint /api/config/scheduling/ #723

Closed
MerlinScheurer opened this issue May 19, 2024 · 3 comments
Closed
Labels
backend react migration Tracking our new React based frontend

Comments

@MerlinScheurer
Copy link
Collaborator

MerlinScheurer commented May 19, 2024

Domain

Backend

Description

Is your feature request related to a problem? Please describe.

Data for the page /settings/scheduling/ is missing in the api endpoints.

Describe the solution you'd like

The Api endpoint /api/config/scheduling/ has been implemented simmilar to /api/config/user/

Additional context

/api/config/scheduling/ ( POST, GET )

GET response body & POST body:

{
 "update_subscribed": {
   "crontab": {
     "minute": 0,
     "hour": 0,
     "day_of_week": 0
   }
 },
 "check_reindex": {
   "crontab": {
     "minute": 0,
     "hour": 0,
     "day_of_week": 0
   },
   "task_config": {
     "days": 0
   }
 },
 "thumbnail_check": {
   "crontab": {
     "minute": 0,
     "hour": 0,
     "day_of_week": 0
   }
 },
 "download_pending": {
   "crontab": {
     "minute": 0,
     "hour": 0,
     "day_of_week": 0
   }
 },
 "run_backup": {
   "crontab": {
     "minute": 0,
     "hour": 0,
     "day_of_week": 0
   },
   "task_config": {
     "rotate": false
   }
 },
 "notifications": {
   "items": [
     {
       "task": "",
       "notification": {
         "title": "",
         "urls": [""]
       }
     }
   ]
 },
 "scheduler_form": {
   "update_subscribed": {
     "errors": ["error?"]
   },
   "download_pending": {
     "errors": ["error?"]
   },
   "check_reindex": {
     "errors": ["error?"]
   },
   "thumbnail_check": {
     "errors": ["error?"]
   },
   "run_backup": {
     "errors": ["error?"]
   }
 }
}
@MerlinScheurer MerlinScheurer added the react migration Tracking our new React based frontend label May 19, 2024
@bbilly1
Copy link
Member

bbilly1 commented Aug 3, 2024

Implemented at /api/task/schedule/<task-name>/, see doc string here:

class ScheduleView(ApiBaseView):
"""resolves to /api/task/schedule/<task-name>/
POST: create/update schedule for task with config
- example: {"schedule": "0 0 *", "config": {"days": 90}}
DEL: delete schedule for task
"""

@MerlinScheurer
Copy link
Collaborator Author

How do i GET the schedule?

bbilly1 added a commit that referenced this issue Aug 23, 2024
@bbilly1
Copy link
Member

bbilly1 commented Aug 23, 2024

Implemented both:

  • GET /api/task/schedule/<task-name>/: single schedule by task name
  • GET /api/task/schedule/: all schedules

example response:

{
    "name": "check_reindex",
    "schedule": "0 13 *",
    "schedule_human": "At 01:00 PM Europe/Zurich",
    "last_run_at": "2024-08-01T17:16:04.913573+02:00",
    "config": {
        "days": 91
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend react migration Tracking our new React based frontend
Projects
Development

No branches or pull requests

2 participants