v1
Double column
API
CLI
JS Client

Addons /

Backup addon

Initiates a backup for the given 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}
    • name

      string
      The name of the backup. If not provided, a default name will be generated containing the current date.
      min length
      3
      max length
      39
      pattern
      ^[a-zA-Z0-9]+((-|\s|\/|:)[a-zA-Z0-9]+)*$
    • backupType

      string
      The type of backup to perform. Defaults to `snapshot`.
      one of
      dump, snapshot
    • compressionType

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

      [array]
      List of destinations for which a backup should additionally be created. 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

Response body

  • {object}
    Response object.
    • data

      {object} required
      Result data.
      • id

        string required
        The identifier for the backup.
      • name

        string required
        The name of the backup.
      • status

        string required
        The current status of the backup.
        one of
        scheduled, in-progress, completed, aborting, aborted, failed, not-supported
      • createdAt

        string required
        The time the backup was initiated.
      • completedAt

        string
        The time the backup was completed.
      • config

        {object} required
        Data about the backup configuration.
        • source

          {object}
          Data about the source of the backup.
          • type

            string
            The type of backup.
            one of
            fileUpload, liveInstance, snapshot, externalDump, sameAddon
        • size

          string required
          The size of the backup, in bytes
        • addonVersion

          string
          The version of the addon at the time of the backup. If the backup type is `snapshot`, the addon will be restored to this version when the backup is restored.
      • lastRestore

        {object}
        Details about the most recent restore of this backup.
        • restoreTimestamp

          string required
          The time the backup was initiated.
        • status

          string required
          The current status of the restore.
          one of
          scheduled, in-progress, completed, aborting, aborted, failed, not-supported
        • completedAt

          string
          The time the restore was completed.
API
CLI
JS Client

POST /v1/projects/{projectId}/addons/{addonId}/backups

Example request

Request body
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"Example Backup","backupType":"snapshot","compressionType":"gz","additionalDestinations":[{"retentionTime":7}]}' \
  https://api.northflank.com/v1/projects/{projectId}/addons/{addonId}/backups

Example response

200 OK

Details about the newly created backup.

JSON

{
  "data": {
    "id": "example-backup",
    "name": "Example Backup",
    "status": "completed",
    "createdAt": "2021-01-20T11:19:53.175Z",
    "completedAt": "2021-01-20T11:19:54.494Z",
    "config": {
      "source": {
        "type": "snapshot"
      },
      "size": "1234",
      "addonVersion": "4.4.8"
    },
    "lastRestore": {
      "restoreTimestamp": "2021-01-20T11:19:54.494Z",
      "status": "completed",
      "completedAt": "2021-01-20T11:19:54.494Z"
    }
  }
}

© 2024 Northflank Ltd. All rights reserved.