What
Add endpoints to return information about workspace autostop/autostart times:
GET /workspaces/:id/autostart
GET /workspaces/:id/autostop
Both of these endpoints will return the following information (example):
{
"schedule": "CRON_TZ=Europe/Dublin 30 9 * * 1-5",
"next": "2022-04-18T09:30:00Z"
}
Why
To support #861 and to show the information in the UI, we will need to poll the workspace object to retrieve the schedule in case it changes. Instead of this, we can return this information directly from coderd.
(Also for the TDD session at the engineering off-site.)