-
Notifications
You must be signed in to change notification settings - Fork 2
02. REST API
The provided Penelope API can handle both POST, PATCH and GET requests. They are used for different methods, though. When creating new backups you have to use POST and include all backup specifications. Depending on what action you want to carry out, you can make use of the following API request types:
Returns all project role bindings of the currently logged in user.
POST /api/users/me
The create request allows you to create a backup, either a one shot or repeating backup sequences.
POST /api/backups
Name | Required | Description |
---|---|---|
type | required | The type of backup which should be created BigQuery or CloudStorage . |
strategy | required | The strategy for the backup which can be Snapshot or Mirror . |
project | required | The GCP project for which a backup should be created. |
target | required | Options for target backup. |
snapshot_options | optional | Options for a Snapshot backup. |
mirror_options | optional | Options for a Mirror backup. |
bigquery_options | optional | Specified options when type of backup is BigQuery . |
gcs_options | optional | Specified options when type of backup is CloudStorage . |
The GET request allows you to get all backups from one GCP project.
GET /api/backups
Name | Required | Description |
---|---|---|
project | required | The GCP project of the backups. |
Returns a single backup, specified by the id parameter.
GET /api/backups/:id
Name | Required | Description |
---|---|---|
id | required | The ID of the desired backup. |
Updates a single backup, specified by the id parameter.
PATCH /api/backups/:id
Name | Required | Description |
---|---|---|
id | required | The ID of the desired backup. |
Calculates the cost of a single backup, specified by the parameters.
POST /api/backups/calculate
Name | Required | Description |
---|---|---|
type | required | The type of backup which should be created BigQuery or CloudStorage . |
strategy | required | The strategy for the backup which can be Snapshot or Mirror . |
project | required | The GCP project for which a backup should be created. |
target | required | Options for target backup. |
snapshot_options | optional | Options for a Snapshot backup. |
mirror_options | optional | Options for a Mirror backup. |
bigquery_options | optional | Specified options when type of backup is BigQuery . |
gcs_options | optional | Specified options when type of backup is CloudStorage . |
Lists all google cloud storage buckets from a GCP project, specified by the id parameter.
GET /api/buckets/:id
Name | Required | Description |
---|---|---|
id | required | The ID of the desired GCP project. |
Lists all big query datasets from a GCP project, specified by the id parameter.
GET /api/datasets/:id
Name | Required | Description |
---|---|---|
id | required | The ID of the desired GCP project. |
Lists restore actions for a backup. An addition, all previous jobs including the specified job can be chosen.
GET /api/restore/:id
Name | Required | Description |
---|---|---|
jobIDForTimestamp | optional | When specified, it returns the restore action for the specified and all previous jobs. |
These are special api endpoint for triggering backup tasks. You may want to set up cron jobs to trigger these tasks regularly and automatically.
GET /api/tasks/prepare_backup_jobs
GET /api/tasks/run_new_jobs
GET /api/tasks/check_jobs_status
GET /api/tasks/check_jobs_stuck
GET /api/tasks/cleanup_expired_sinks