# What this PR does This reverts commits7c4b40a046andcdb22285db. See https://github.com/grafana/oncall-private/pull/2361 for more details.
1.9 KiB
Fake Data Generator Script
This script can be used to easily populate fake data into your local Grafana/OnCall setup. Currently the script is capable of generating the following objects:
- teams
- users
- schedules
- schedule on call shifts
Prerequisites
- Create/active a Python 3.11 virtual environment
pip install -r requirements.txt- Must have a local version of Grafana and OnCall up and running
- Generate an API key inside of Grafana OnCall
How to run
Note: The below flag values assume you are running a grafana container locally via the docker-compose setup.
The reason why there is a few separate steps involved is that we need to first create teams and users in the Grafana
instance. Later on, in order to create OnCall schedules/oncall-shifts, we need the OnCall user ID to do so. There is
currently no way to trigger a Grafana -> OnCall data sync via the public API, hence the manual step in the middle
to have data synced between Grafana and OnCall.
-
Create teams and users in Grafana. The
teamsandusersflags represent the number of teams and users you would like to create respectively:# by default this will generate 10 teams and 1000 users python main.py generate_teams_and_usersSee
python main.py generate_teams_and_users -hfor more information on how to run the command. -
Head to your OnCall setup, and trigger a Grafana -> OnCall data sync by visiting the plugin page.
-
Create schedules and on call shifts in OnCall. The
schedulesflag represents the number of OnCall schedules you would like to generate. Note that one on call shift is created for each schedule:# by default this will generate 100 schedules python main.py generate_schedules_and_oncall_shifts --oncall-api-token=<oncall-api-key>See
python main.py generate_schedules_and_oncall_shifts -hfor more information on how to run the command.