v1
Double column
API
CLI
JS Client

Addons /

Create addon backup schedule

Create a new backup schedule for an addon.

Required permission

Project > Addons > General > Update

Path parameters

    • projectId

      string required
      ID of the project
    • addonId

      string required
      ID of the addon

Request body

  • {object}
    • scheduling

      {object} required
      Schedule for the backup.
      • interval

        string required
        The interval between backups. Each addon can only have one backup schedule of each interval for each backup type.
        one of
        hourly, daily, weekly
      • minute

        [array] required
        An array of minutes when the backup should be performed.
        • integer
          A minute when the backup should be performed.
          min
          0
          max
          59
      • hour

        [array]
        An array of hours in 24 hour format when the backup should be performed. At these hours, a backup will be performed at each of the minutes provided in the `minute` field. Required for `daily` and `weekly` intervals and unavailable for `hourly` intervals.
        • integer
          An hour when the backup should be performed, in 24 hour format.
          min
          0
          max
          23
      • day

        [array]
        An array of days of the week when the backup should be performed, where `0` represents Monday and `6` represents Sunday. On these days, a backup will be performed at each of the minutes provided in the `minute` field whenever it is an hour from the `hour` field. Required for `weekly` intervals and unavailable for `hourly` and `daily` intervals.
        • integer
          A day of the week when the backup should be performed, where `0` represents Monday and `6` represents Sunday.
          min
          0
          max
          6
    • backupType

      string required
      The type of the backup to be performed.
      one of
      dump, snapshot
    • additionalDestinations

      [array]
      List of destinations for which a backup should be created of this backup. Only applicable for snapshot backups.
      • {object}
        • destinationId

          string required
          min length
          3
          max length
          100
          pattern
          ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$
        • retentionTime

          integer
          The time the backup is retained for, in days. `hourly` backups have a maximum retention of 7 days, `daily` backups have a maximum retention of 60 days and `weekly` backups have a maximum retention of 120 days.
          min
          1
          max
          120
        • type

          string required
          one of
          custom
    • compressionType

      string
      The compression algorithm of the backup. Only applicable for dump backups. Defaults to `gz`.
      one of
      gz, zstd
    • retentionTime

      integer required
      The time the backup is retained for, in days. `hourly` backups have a maximum retention of 7 days, `daily` backups have a maximum retention of 60 days and `weekly` backups have a maximum retention of 120 days.
      min
      1
      max
      120

Response body

  • {object}
    Response object.
    • data

      {object} required
      Result data.
      • id

        string required
        ID of the schedule.
API
CLI
JS Client

POST /v1/projects/{projectId}/addons/{addonId}/backup-schedules

Example request

Request body
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"scheduling":{"interval":"weekly","minute":[30],"hour":[18],"day":[4]},"backupType":"snapshot","additionalDestinations":[{"retentionTime":7}],"compressionType":"gz","retentionTime":7}' \
  https://api.northflank.com/v1/projects/{projectId}/addons/{addonId}/backup-schedules

Example response

200 OK

Details about the created backup schedule.

JSON

{
  "data": {
    "id": "62cc20b90956ab62a58e8474"
  }
}

© 2024 Northflank Ltd. All rights reserved.