in datahub/implement.py [0:0]
def reset_subscription_offset(self, project_name, topic_name, sub_id, offsets):
if check_empty(project_name):
raise InvalidParameterException(ErrorMessage.PARAMETER_EMPTY % 'project_name')
if check_empty(topic_name):
raise InvalidParameterException(ErrorMessage.PARAMETER_EMPTY % 'topic_name')
if check_empty(sub_id):
raise InvalidParameterException(ErrorMessage.PARAMETER_EMPTY % 'sub_id')
if check_empty(offsets):
raise InvalidParameterException(ErrorMessage.PARAMETER_EMPTY % 'offsets')
if not check_type(offsets, dict):
raise InvalidParameterException(ErrorMessage.INVALID_TYPE % ('offsets', dict.__name__))
for (k, v) in offsets.items():
if isinstance(v, dict):
offsets[k] = OffsetBase.from_dict(v)
url = Path.OFFSETS % (project_name, topic_name, sub_id)
request_param = ResetSubscriptionOffsetParams(offsets)
self._rest_client.put(url, data=request_param.content())