Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[LIB-757] - add possibility to restore backups
  • Loading branch information
ilu2112 committed Jun 28, 2016
commit 1a80368bd25099ab81b8d992d3df546f655f65b4
16 changes: 16 additions & 0 deletions syncano/models/backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,21 @@ class Meta:
'list': {
'methods': ['post', 'get'],
'path': '/backups/full/',
},
'restore': {
'methods': ['post'],
'path': '/restores/',
}
}

def restore(self):
properties = self.get_endpoint_data()
endpoint = self._meta.resolve_endpoint('restore', properties)
kwargs = {
'data': {
'backup': self.id
}
}
connection = self._get_connection()
connection.request('POST', endpoint, **kwargs)