PBX GUI - Backup Module GraphQL APIs
This wiki is to capture the Backup module provided GraphQL APIs.
Please find below list of APIs supported by backup module.
llapseCore module APIs are useful to create , modify , delete extensions and fetch the values of existing configured extensions.
Add Backup
Creating and running a backup into Freepbx/PBXact system.
API Name addBackup API.
API Parameters -
Name | Required | Type | Default | Description |
---|---|---|---|---|
name | Mandatory | String |
| Name for the backup |
description | Optional | String |
| Description for the backup |
backupModules | Mandatory | List |
| Modules to backup please provide the rawname. (Ex. ["amd","adv_recovery"]) or additionally you can add all Ex.(['all]) |
notificationEmail | Optional | String |
| Email address to send notifications, Multiple email addresses need to be separated by comma |
inlineLogs | Optional | String |
| When set to Yes logs will be added to the body of the email, when set to No logs will be added as an attachment, default no |
emailType | Optional | String |
| When to email default both |
storageLocation | Mandatory | List |
| Select one or more storage locations. Storage locations can be added/configured with the Filestore module. Ex. ['SSH_123_2345_214','SSH_12324_23214']. the list can be found on fetchFilestoreLocations api from file store. |
appendBackupName | Optional | Boolean | False | When set to true , Backp files will store like filestore-path/backup-job-name/backup-file and if set to false then backup file will store into filestore-path/backup-file, default false |
enableBackupSchedule | Optional | Boolean | False | Enable scheduled backups, default false |
scheduleBackup | Optional | String |
| When should this backup run. when enableBackupSchedule is set to true please provide this field. please enter a cron values. |
updatesToKeep | Optional | ID | 1 | How many updates to keep. If this number is 3, the last 3 will be kept. 0 is unlimited |
Query Parameters
status
message
id |
API Request
1. Api to add Backup
GQLAPI: /admin/api/api/gql
parameters:
mutation {
addBackup(input: {
name: "testbackup",
description: "testing backup to add a backup",
backupModules: ["all"],
storageLocation: ["dropbox_wqeqwe"]
enableBackupSchedule : true
scheduleBackup : "0 * * * *"
}) {
status
message
id
}
} |
API Response
{
"data": {
"addBackup": {
"status": true,
"message": "Backup has been performed/schedules",
"id": "d35390e8-0000-defg-abcd-6f5c7c94b1234"
}
}
} |
Update Backup
Updating and running a backup into Freepbx/PBXact system.
API Name updateBackup API.
Name | Required | Type | Default | Description |
---|---|---|---|---|
id | Mandatory | String |
| Id of the backup |
name | Mandatory | String |
| Name for the backup |
description | Optional | String |
| Description for the backup |
backupModules | Mandatory | List |
| Modules to backup please provide the rawname. (Ex. ["amd","adv_recovery"]) or additionally you can add all Ex.(['all]) |
notificationEmail | Optional | String |
| Email address to send notifications, Multiple email addresses need to be separated by comma |
inlineLogs | Optional | String |
| When set to Yes logs will be added to the body of the email, when set to No logs will be added as an attachment, default no |
emailType | Optional | String |
| When to email default both |
storageLocation | Mandatory | List |
| Select one or more storage locations. Storage locations can be added/configured with the Filestore module. Ex. ['SSH_123_2345_214','SSH_12324_23214']. the list can be found on fetchFilestoreLocations api from file store. |
appendBackupName | Optional | Boolean | False | When set to true , Backp files will store like filestore-path/backup-job-name/backup-file and if set to false then backup file will store into filestore-path/backup-file, default false |
enableBackupSchedule | Optional | Boolean | False | Enable scheduled backups, default false |
scheduleBackup | Optional | String |
| When should this backup run. when enableBackupSchedule is set to true please provide this field. please enter a cron values. |
updatesToKeep | Optional | ID | 1 | How many updates to keep. If this number is 3, the last 3 will be kept. 0 is unlimited |
Query Parameters
status
message
id |
API Request
1. Api to update Backup
GQLAPI: /admin/api/api/gql
parameters:
mutation {
updateBackup(input: {
id:"d35390e8-0l0ore-defg-abcd-6f5c7c94b1234"
name: "testbackup",
description: "testing backup to update a backup",
backupModules: ["all"],
storageLocation: ["dropbox_wqeqwe"]
enableBackupSchedule : true
scheduleBackup : "0 * * * *"
}) {
status
message
id
}
} |
API Response
{
"data": {
"updateBackup": {
"status": true,
"message": "Backup has been updated",
"id": "d35390e8-0l0ore-defg-abcd-6f5c7c94b1234"
}
}
} |
Delete Backup
Deleting a backup into Freepbx/PBXact system.
API Name deleteBackup API.
API Parameters -
Name | Required | Type | Default | Description |
---|---|---|---|---|
backupId | Mandatory | String |
| Id of the backup |
Query Parameters
status
message |
API Request
1. Api to delete Backup
GQLAPI: /admin/api/api/gql
parameters:
query{
deleteBackup(backupId: "d35390e8-0l0ore-defg-abcd-6f5c7c94b1234") {
status
message
}
} |
API Response
{
"data": {
"deleteBackup": {
"status": true,
"message": "Backup deleted successfully"
}
}
} |
Restore Backup
API Name restoreBackup
API Parameters -
Name | Required | Type | Default | Description |
---|---|---|---|---|
name | Mandatory | ID |
| Name of the Restore input file |
Query Parameters
status
message
transaction_id |
API Request
GQLAPI: /admin/api/api/gql
Parameters:
mutation {
restoreBackup(input: {
name: "testbackup"
}) {
status message transaction_id
}
} |
API Response
{
"data": {
"restoreBackup": {
"status": true,
"message": "Restore process has been initiated. Kindly check the fetchApiStatus api with the transaction id.",
"transaction_id": "322"
}
}
} |
Fetch All backup files
API Name : fetchAllBackups
API Parameters: none
API Parameters to query
Query Parameters
status
message
fileDetails{
id
type
file
framework
timestamp
name
instancename
} |
API Request
GQLAPI: /admin/api/api/gql
query{
fetchAllBackups{
status message fileDetails{
id
type
file
framework
timestamp
name
instancename
}
}
} |
API Response
{
"data": {
"fetchBackupFiles": {
"status": true,
"message": "List of backup files",
"fileDetails": [
{
"id":"SSH_1234567890",
"type":"SSH",
"file":"20200330-34567-345678-15.0.16.51-456789.tar.gz",
"framework":"15.0.16.51",
"timestamp":"234432234",
"name":"20200330-2345324-42342342-15.0.16.51-234234234.tar.gz",
"instancename":"warmspare"
}
]
}
} |
Fetch All backup Configurations
API Name : fetchAllBackupConfigurations
API Parameters: none
API Parameters to query
Query Parameters
status
message
backupConfigurations{
id
name
description
} |
API Request
GQLAPI: /admin/api/api/gql
query{
fetchAllBackupConfigurations{
status message backupConfigurations{
id
name
description
}
}
} |
API Response
{
"data": {
"fetchAllBackupConfigurations": {
"status": true,
"message": "List of backup configurations",
"backupConfigurations": [
{
"id": "011223344537d1ca-1122-1122",
"name": "testbackup22",
"description": "testing backup to add a backup"
}
]
}
}
} |
Run Backup
running a backup into Freepbx/PBXact system.
API Name runBackup API.
API Parameters -
Name | Required | Type | Default | Description |
---|---|---|---|---|
id | Mandatory | String |
| Id of the backup |
API Parameters to query
Query Parameters
status
message
transaction_id |
API Request
GQLAPI: /admin/api/api/gql
mutation {
runBackup(input:{ id: "68baf123-db78-46b0-ad48-6d2fece23e16"})
{
status
message
transaction_id
}
} |
API Response
{
"data": {
"runBackup": {
"status": true,
"message": "Backup process has been initiated. Kindly check the fetchApiStatus api with the transaction id.",
"transaction_id": "20"
}
}
} |