fleet/tools/calendar
Victor Lyuboslavsky 5a6c407e1b
Calendar webhook will retry if it receives response 429 (#18067)
#18044 
Calendar webhook will retry if it receives response 429 Too Many
Requests. Webhook request will retry for 30 minutes with a 1 minute max
delay between retries.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-04-05 12:44:56 -05:00
..
delete-events Calendar webhook will retry if it receives response 429 (#18067) 2024-04-05 12:44:56 -05:00
move-events Calendar webhook will retry if it receives response 429 (#18067) 2024-04-05 12:44:56 -05:00
calendar.go Adding calendar test server and other fixes. (#17751) 2024-03-26 13:39:37 -05:00
README.md Calendar helper scripts for testing (#17798) 2024-03-26 13:39:37 -05:00

Helper methods for Google calendar

To delete all downtime events from a Google Calendar, use delete-events/delete-events.go

To move all downtime events from multiple Google Calendars to a specific time, use move-events/move-events.go

Calendar server for load testing

Test calendar server that provides a REST API for managing events. Since we may not have access to a real calendar server (such as Google Calendar API), this server will be used to test the calendar feature during load testing.

Start the server like:

go run calendar.go --port 8083 --db ./calendar.db

The server uses a SQLite database to store events. This database can be modified during testing.

On the fleet server, configure Google Calendar API key where client_email is the specified value and the private_key is the base URL of the calendar server:

{
    "client_email": "calendar-load@example.com",
    "private_key": "http://localhost:8083"
}

Useful tricks

To update all the events in SQLite database to start at the current time, do SQL query:

UPDATE events SET start = unixepoch('now'), end = unixepoch('now', '+30 minutes');