Skip to main content

Backup API

All URIs are relative to http://localhost:1000

MethodHTTP requestDescription
backupPOST /backup/backup [POST]
backupAssetPOST /backup/asset/backup/asset [POST]
backupRestoreSpecificBackupPOST /backup/{backup}/restore/backup/{backup}/restore [POST]
backupRestoreSpecificBackupStreamedPOST /backup/{backup}/restore/streamed/backup/{backup}/restore/streamed [POST]
backupSpecificBackupSnapshotGET /backup/{backup}/backup/{backup} [GET]
backupSpecificCreationCancelPOST /backup/{backup}/creation/cancel/backup/{backup}/creation/cancel [POST]
backupSpecificCreationStatusGET /backup/{backup}/creation/status/backup/{backup}/creation/status [GET]
backupSpecificRestorationCancelPOST /backup/{backup}/restoration/cancel/backup/{backup}/restoration/cancel [POST]
backupSpecificRestorationStatusGET /backup/{backup}/restoration/status/backup/{backup}/restoration/status [GET]

backup​

backup()

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.BackupApi(configuration)

const body: Pieces.BackupRequest = {
// Assets (optional)
assets: ,
};

apiInstance.backup(body).then((data: void (empty response body)) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

NameTypeDescriptionNotes
assetsAssets

Return type​

void (empty response body)

HTTP request headers​

  • Content-Type: application/json
  • Accept: text/plain

HTTP response details​

Status codeDescriptionResponse headers
204No Content-
505HTTP Version Not Supported, This means that your user need to update their local os, or they cannot Backup to the Cloud.-
511Network Authentication Required, This means that you user needs to be authenticated with OS inorder to backup. The User also need to be connected to their cloud to backup.(If either of the 2 are not connected we will return a 511) TODO thinking about returning a more comprehensive value for digestion on the recieving side.-

backupAsset​

backupAsset()

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.BackupApi(configuration)

const body: Pieces.BackupAssetRequest = {
// Asset (optional)
asset: ,
};

apiInstance.backupAsset(body).then((data: void (empty response body)) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

NameTypeDescriptionNotes
assetAsset

Return type​

void (empty response body)

HTTP request headers​

  • Content-Type: application/json
  • Accept: text/plain

HTTP response details​

Status codeDescriptionResponse headers
204No Content-
505HTTP Version Not Supported, This means that your user need to update their local os, or they cannot Backup to the Cloud.-
511Network Authentication Required, This means that you user needs to be authenticated with OS inorder to backup. The User also need to be connected to their cloud to backup.(If either of the 2 are not connected we will return a 511) TODO thinking about returning a more comprehensive value for digestion on the recieving side.-

backupRestoreSpecificBackup​

Backup backupRestoreSpecificBackup()

Given a backup identifier version_timestamp. we will restore a given backup from the cloud and override your local database!!! NOTE!!!! This will NOT sync, ie all local snippets will get replaced with the restored database.

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.BackupApi(configuration)

const body: Pieces.BackupRestoreSpecificBackupRequest = {
// string | This is a identifier that is used to identify a specific backup.(version_timestamp)
backup: backup_example,
// Backup (optional)
backup2: ,
};

apiInstance.backupRestoreSpecificBackup(body).then((data: Backup) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

NameTypeDescriptionNotes
backup2Backup
backup[string]This is a identifier that is used to identify a specific backup.(version_timestamp)defaults to undefined

Return type​

Backup

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json, text/plain

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-
511Authentication Required, This means that you user needs to be authenticated with OS in order to perform this action-
505HTTP Version Not Supported, This means that your user needs to update their local os, or they cannot perform backup operations with the cloud-

backupRestoreSpecificBackupStreamed​

BackupStreamedProgress backupRestoreSpecificBackupStreamed()

This take a local database and ensure that it is backed up to the cloud. NOTE: This is a streamed version of the /backups/create. and Since the Generator is unable to generate a streamed endpoint. this is a place holder, and will need to be implemented isolated from the code generator.

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.BackupApi(configuration)

const body: Pieces.BackupRestoreSpecificBackupStreamedRequest = {
// string | This is a identifier that is used to identify a specific backup.(version_timestamp)
backup: backup_example,
// Backup (optional)
backup2: ,
};

apiInstance.backupRestoreSpecificBackupStreamed(body).then((data: BackupStreamedProgress) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

NameTypeDescriptionNotes
backup2Backup
backup[string]This is a identifier that is used to identify a specific backup.(version_timestamp)defaults to undefined

Return type​

BackupStreamedProgress

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json, text/plain

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-
511Authentication Required, This means that you user needs to be authenticated with OS in order to change the beta status-
505HTTP Version Not Supported, This means that your user needs to update their local os, or they cannot perform backup operation with the cloud-

backupSpecificBackupSnapshot​

Backup backupSpecificBackupSnapshot()

This will just get the metadata associated with a specific backup.

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.BackupApi(configuration)

const body: Pieces.BackupSpecificBackupSnapshotRequest = {
// string | This is a identifier that is used to identify a specific backup.(version_timestamp)
backup: backup_example,
};

apiInstance.backupSpecificBackupSnapshot(body).then((data: Backup) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

NameTypeDescriptionNotes
backup[string]This is a identifier that is used to identify a specific backup.(version_timestamp)defaults to undefined

Return type​

Backup

HTTP request headers​

  • Content-Type: Not defined
  • Accept: application/json, text/plain

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-
511Authentication Required, This means that you user needs to be authenticated with OS in order to change the beta status-
505HTTP Version Not Supported, This means that your user needs to update their local os, or they cannot perform backup operation with the cloud-

backupSpecificCreationCancel​

backupSpecificCreationCancel()

This is Going to cancel a create backup (streamed) or not streamed that is currently in progress. This will throw a 500 if there is not a backup in progress. TODO: ADD mofe DESCRIPITON To this.

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.BackupApi(configuration)

const body: Pieces.BackupSpecificCreationCancelRequest = {
// string | This is a identifier that is used to identify a specific backup.(version_timestamp)
backup: backup_example,
};

apiInstance.backupSpecificCreationCancel(body).then((data: void (empty response body)) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

NameTypeDescriptionNotes
backup[string]This is a identifier that is used to identify a specific backup.(version_timestamp)defaults to undefined

Return type​

void (empty response body)

HTTP request headers​

  • Content-Type: Not defined
  • Accept: text/plain

HTTP response details​

Status codeDescriptionResponse headers
204No Content-
500Internal Server Error-

backupSpecificCreationStatus​

BackupStatus backupSpecificCreationStatus()

TODO add a description:

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.BackupApi(configuration)

const body: Pieces.BackupSpecificCreationStatusRequest = {
// string | This is a identifier that is used to identify a specific backup.(version_timestamp)
backup: backup_example,
};

apiInstance.backupSpecificCreationStatus(body).then((data: BackupStatus) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

NameTypeDescriptionNotes
backup[string]This is a identifier that is used to identify a specific backup.(version_timestamp)defaults to undefined

Return type​

BackupStatus

HTTP request headers​

  • Content-Type: Not defined
  • Accept: application/json, text/plain

HTTP response details​

Status codeDescriptionResponse headers
200OK-
404Internal Server Error-
500Internal Server Error-

backupSpecificRestorationCancel​

backupSpecificRestorationCancel()

This will cancel a Restoration that is in progress and restore to the original database. Note: if there is not a restore in progress we will return a 500. TODO add

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.BackupApi(configuration)

const body: Pieces.BackupSpecificRestorationCancelRequest = {
// string | This is a identifier that is used to identify a specific backup.(version_timestamp)
backup: backup_example,
// Backup (optional)
backup2: ,
};

apiInstance.backupSpecificRestorationCancel(body).then((data: void (empty response body)) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

NameTypeDescriptionNotes
backup2Backup
backup[string]This is a identifier that is used to identify a specific backup.(version_timestamp)defaults to undefined

Return type​

void (empty response body)

HTTP request headers​

  • Content-Type: application/json
  • Accept: text/plain

HTTP response details​

Status codeDescriptionResponse headers
204No Content-
500Internal Server Error-

backupSpecificRestorationStatus​

BackupStatus backupSpecificRestorationStatus()

TODO add a description:

Example​

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.BackupApi(configuration)

const body: Pieces.BackupSpecificRestorationStatusRequest = {
// string | This is a identifier that is used to identify a specific backup.(version_timestamp)
backup: backup_example,
};

apiInstance.backupSpecificRestorationStatus(body).then((data: BackupStatus) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters​

NameTypeDescriptionNotes
backup[string]This is a identifier that is used to identify a specific backup.(version_timestamp)defaults to undefined

Return type​

BackupStatus

HTTP request headers​

  • Content-Type: Not defined
  • Accept: application/json, text/plain

HTTP response details​

Status codeDescriptionResponse headers
200OK-
404Internal Server Error-
500Internal Server Error-