Search Backups

To find a backup stored at a particular backup server, use the following request:

GET /settings/backup_servers/:id/backups_search.xml
GET /settings/backup_servers/:id/backups_search.json

XML Request Example

curl -i -X GET -u 'account_email:API_key' --url 'http://onapp.test/settings/backup_servers/2/backups_search.xml?searching='test'&size[from]=1000&size[to]=10000&period[startdate]=2016-09-21&period[enddate]=2016-09-21' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request Example

curl -i -X GET -u 'account_email:API_key' --url 'http://onapp.test/settings/backup_servers/2/backups_search.json?searching='test'&size[from]=1000&size[to]=10000&period[startdate]=2016-09-21&period[enddate]=2016-09-21' -H 'Accept: application/json' -H 'Content-type: application/json'

Where:
size – set the size [from] and [to] backup search parameters to search backups by their size. The size should be indicated in MB.
date – set the date [startdate] and [enddate]backup search parameters to search for backups created between two dates. The date should be indicated in the YYYY-MM-DD format.

Please be aware that some Unix command shells can output an error because of square brackets. To prevent the error, use the backslash escape symbol. The example curl with backslashes is as follows:

XML Request Example

curl -i -X GET -u 'account_email:API_key' --url 'http://onapp.test/settings/backup_servers/2/backups_search.xml?searching='test'&size\[from\]=1000&size\[to\]=10000&period\[startdate\]=2016-09-21&period\[enddate\]=2016-09-21' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request Example

curl -i -X GET -u 'account_email:API_key' --url 'http://onapp.test/settings/backup_servers/2/backups_search.json?searching='test'&size\[from\]=1000&size\[to\]=10000&period\[startdate\]=2016-09-21&period\[enddate\]=2016-09-21' -H 'Accept: application/json' -H 'Content-type: application/json'


XML Output Example

<backups type="array">
  <backup>
    <allow_resize_without_reboot type="boolean">true</allow_resize_without_reboot>
    <allowed_hot_migrate type="boolean">true</allowed_hot_migrate>
    <allowed_swap type="boolean">true</allowed_swap>
    <backup_server_id type="integer">1</backup_server_id>
    <backup_size type="integer">4976984</backup_size>
    <built type="boolean">true</built>
    <built_at type="datetime">2016-09-21T12:26:11Z</built_at>
    <created_at type="datetime">2016-09-21T12:08:06Z</created_at>
    <data_store_type>lvm</data_store_type>
    <id type="integer">872</id>
    <identifier>dyhy150m</identifier>
    <initiated>manual</initiated>
    <iqn nil="true"/>
    <locked type="boolean">false</locked>
    <marked_for_delete type="boolean">false</marked_for_delete>
    <min_disk_size type="integer">9</min_disk_size>
    <min_memory_size type="integer">384</min_memory_size>
    <note>zaza50patch76</note>
    <operating_system>linux</operating_system>
    <operating_system_distro>rhel</operating_system_distro>
    <target_id type="integer">9287</target_id>
    <target_type>Disk</target_type>
    <template_id type="integer">28</template_id>
    <updated_at type="datetime">2016-09-21T12:26:15Z</updated_at>
    <user_id type="integer">3</user_id>
    <volume_id nil="true"/>
    <backup_type>normal</backup_type>
    <disk_id type="integer">9287</disk_id>
  </backup>
  <backup>...</backup>
</backups>


Where:

allow_resize_without_reboot - true if the template to which the backup can be restored will support resize without reboot option, otherwise false

allowed_hot_migrate - true if the template to which the backup can be restored will support hot migration, otherwise false.

allowed_swap - true if the template to which the backup can be restored will allow swap, otherwise false.

backup_server_id - the ID of the backup server on which the backup is stored.

backup_size - the size of the backup

built - true if the backup is already built, otherwise false

built_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

data_store_type - data store type: lvm, vmware, or solidfire

id - the backup ID

identifier - the backup identifier

initiated - period when backup is initiated: days, weeks, months, or years

iqn - volume ISCSI qualified name (SolidFire-related parameter)

locked - true if the backup is being built, otherwise false

marked_for_delete - the backup is marked for deletion (for auto-backups)

min_disk_size - minimum disk size required for restoring a backup

min_memory_size -  minimum memory size required for restoring a backup

note - an optional note to the backup

operating_system - the OS of the VS from which the backup was created

operating_system_distro - the OS distribution of the VS from which the backup was created

target_id - ID of a backup target 

target_type - target for which the backup was taken; For normal backups, it is a disk. For incremental backups, it is virtual server.

template_id - the ID of the template the VS is based on

updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

user_id - the ID of a user the storage server belongs to

volume_id - data store ID

backup_type - disk backup type (normal, Days auto-backup, Weeks auto-backup, Months auto-backup, Years auto-backup)

disk_id - the ID of the backed up disk 

For details refer to Get The List Of Backup Servers section.

Note that the backup search returns only the list of backups, stored on a specified backup server, which a user has permission to see (own backups or all backups). For instructions on how to see the list of all backup servers, refer to Get The List of Backup Servers section.