Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/api/client.py
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | def snapshot_get_branches(self, snapshot_id, branches_from=b'', | ||||
branches_count=1000, target_types=None): | branches_count=1000, target_types=None): | ||||
return self.post('snapshot/get_branches', { | return self.post('snapshot/get_branches', { | ||||
'snapshot_id': snapshot_id, | 'snapshot_id': snapshot_id, | ||||
'branches_from': branches_from, | 'branches_from': branches_from, | ||||
'branches_count': branches_count, | 'branches_count': branches_count, | ||||
'target_types': target_types | 'target_types': target_types | ||||
}) | }) | ||||
def origin_get(self, origin): | def origin_get(self, origins=None, *, origin=None): | ||||
return self.post('origin/get', {'origin': origin}) | if origin is None: | ||||
if origins is None: | |||||
raise TypeError('origin_get expected 1 argument') | |||||
else: | |||||
assert origins is None | |||||
origins = origin | |||||
warnings.warn("argument 'origin' of origin_get was renamed " | |||||
"to 'origins' in v0.0.123.", | |||||
DeprecationWarning) | |||||
return self.post('origin/get', {'origins': origins}) | |||||
def origin_search(self, url_pattern, offset=0, limit=50, regexp=False, | def origin_search(self, url_pattern, offset=0, limit=50, regexp=False, | ||||
with_visit=False): | with_visit=False): | ||||
return self.post('origin/search', {'url_pattern': url_pattern, | return self.post('origin/search', {'url_pattern': url_pattern, | ||||
'offset': offset, | 'offset': offset, | ||||
'limit': limit, | 'limit': limit, | ||||
'regexp': regexp, | 'regexp': regexp, | ||||
'with_visit': with_visit}) | 'with_visit': with_visit}) | ||||
▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines |