YouTrack InCloud 2018.3 Help

Database Backup

The two REST API resources that are described here let you manage the backups of your YouTrack database.

Resource

/api/admin/databaseBackup/

Returned entity

This root resource does not return any entity. This is a common ancestor for two sub-resources that actually return entities and let you operate backup settings and files.

Sub-resources

List of Backups

Resource

/api/admin/databaseBackup/backups

Returned entity

BackupFile. For description of the entity attributes, see the Supported Fields section.

Supported methods

Supported Fields

This table describes attributes of the BackupFile entity.

  • To receive an attribute in the response from server, specify it explicitly in the fields parameter of a request.

Field

Type

Description

creationDate

Long

Stores the timestamp of the moment when the backup file was created.

error

String?

Stores the error message that is returned in the case of backup failure.

file

java.io.File

Stores the pathname of the backup file.

id

string

Stores an entity ID of the backup file.

link

string

Stores a download URL for the backup file.

name

string

Stores the name of the backup file.

size

string

Stores the size of the backup file.

Read the List of Backup Files

Request syntax

GET /api/admin/databaseBackup/backups[?fields=<fields>

Request parameters:

Parameter

Type

Description

fields

string

A list of fields that should be returned in the response. If no fields specified, only the entity ID is returned.

Sample request

curl -X GET \ 'https://example.myjetbrains.com/youtrack/api/admin/databaseBackup/backups?fields=creationDate,file,error,link,name,size,id' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json'

Sample response body

[ { "name": "2018-09-05-22-27-16.tar.gz", "size": 9291043, "creationDate": 1536175642000, "link": "backupFile/2018-09-05-22-27-16.tar.gz", "file": "/mnt/disk0/example/backup/2018-09-05-22-27-16.tar.gz", "error": null, "id": "2018-09-05-22-27-16.tar.gz" } ]

Database Backup Settings

Resource:

/api/admin/databaseBackup/settings/

Returned entity

DatabaseBackupSettings

Supported methods

Supported fields

This table describes attributes of the DatabaseBackupSettings entity.

  • To receive an attribute in the response from server, specify it explicitly in the fields parameter of a request.

  • To update an attribute, provide it in the body of a POST request.

Field

Type

Description

archiveFormat

BackupFileType

Stores the current selected format of backup files. Supported values are TAR_GZ or ZIP.

availableDiskSpace

Long

Read-only. Stores the size of available disk space.

backupStatus

BackupStatus

Stores the current status of the backup.

id

String

Stores entity ID of the DatabaseBackupSettings.

Read Backup Settings

Request syntax:

GET /api/admin/databaseBackup/settings?[fields=<fields>]

Request parameters:

Parameter

Type

Description

fields

string

A list of DatabaseBackupSettings attributes that should be returned in the response body. If no fields specified, only entity ID is returned.

Sample request

curl -X GET \ 'https://example.myjetbrains.com/youtrack/api/admin/databaseBackup/settings?fields=archiveFormat,availableDiskSpace,backupStatus%28backupCancelled,backupError%28date,errorMessage%29,backupInProgress,stopBackup%29' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -H 'Postman-Token: 9e98c00b-a805-4764-aec0-15d3a13400a7'

Sample response body

{ "archiveFormat": "TAR_GZ", "backupStatus": { "backupInProgress": false, "stopBackup": false, "backupError": null, "backupCancelled": false }, "availableDiskSpace": 163780067328 }

Update Backup Settings

For YouTrack InCloud, updating the backup settings actually means creating a new backup.

Request syntax:

POST /api/admin/databaseBackup/settings?[fields=<fields>]

Request parameters:

Parameter

Type

Description

fields

string

A list of DatabaseBackupSettings attributes that should be returned in the response body. If no fields specified, only entity ID is returned.

Sample request

The following sample request initiates a new back up.

curl -X POST \ 'https://example.myjetbrains.com/youtrack/api/admin/databaseBackup/settings?fields=archiveFormat,availableDiskSpace,backupStatus%28backupCancelled,backupError%28date,errorMessage%29,backupInProgress,stopBackup%29' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer perm:am9obi5kb2U=.UG9zdG1hbiBKb2huIERvZQ==.jJe0eYhhkV271j1lCpfknNYOEakNk7' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "backupStatus": { "backupInProgress": true, "stopBackup": false, "backupError": null, "backupCancelled": false } }'

Sample response body

In response to the sample request, the server sends the following data in the response body:

{ "archiveFormat": "TAR_GZ", "backupStatus": { "backupInProgress": true, "stopBackup": false, "backupError": null, "backupCancelled": false }, "availableDiskSpace": 163739054080 }
Last modified: 12 October 2018