Skip to content

Add flag for subject version permanent delete #1555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def get_versions(self, subject_name):

return self._rest_client.get('subjects/{}/versions'.format(_urlencode(subject_name)))

def delete_version(self, subject_name, version):
def delete_version(self, subject_name, version, permanent=False):
"""
Deletes a specific version registered to ``subject_name``.

Expand All @@ -569,6 +569,8 @@ def delete_version(self, subject_name, version):

version (int): Version number

permanent (bool): True for a hard delete, False (default) for a soft delete

Returns:
int: Version number which was deleted

Expand All @@ -582,6 +584,10 @@ def delete_version(self, subject_name, version):
response = self._rest_client.delete('subjects/{}/versions/{}'.
format(_urlencode(subject_name),
version))
if permanent:
self._rest_client.delete('subjects/{}/versions/{}?permanent=true'.
format(_urlencode(subject_name),
version))
return response

def set_compatibility(self, subject_name=None, level=None):
Expand Down