add blob_reflect

This commit is contained in:
Jack Robison 2018-03-22 16:54:29 -04:00
parent 3085e28490
commit cb069ca002
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 19 additions and 1 deletions

View file

@ -25,7 +25,7 @@ at anytime.
*
### Added
*
* `blob_reflect` command to send specific blobs to a reflector server
*
### Removed

View file

@ -3074,6 +3074,24 @@ class Daemon(AuthJSONRPCServer):
response = yield self._render_response(blob_hashes_for_return)
defer.returnValue(response)
def jsonrpc_blob_reflect(self, blob_hashes, reflector_server=None):
"""
Reflects specified blobs
Usage:
blob_reflect (<blob_hashes>...) [--reflector_server=<reflector_server>]
Options:
--reflector_server=<reflector_server> (str) : reflector address
Returns:
(list) reflected blob hashes
"""
d = reupload.reflect_blob_hashes(blob_hashes, self.session.blob_manager, reflector_server)
d.addCallback(lambda r: self._render_response(r))
return d
def jsonrpc_blob_reflect_all(self):
"""
Reflects all saved blobs