Skip to content

Commit

Permalink
Merge pull request #9 from synkd/add_delete_allocation_method
Browse files Browse the repository at this point in the history
Add delete method to Manifester class
  • Loading branch information
synkd authored Aug 9, 2022
2 parents e5e4a90 + ac9fb5c commit f344a97
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions manifester/manifester.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ def create_subscription_allocation(self):
)
return self.allocation_uuid

def delete_subscription_allocation(self):
self._access_token = None
data = {
"headers": {"Authorization": f"Bearer {self.access_token}"},
"proxies": self.manifest_data.get("proxies", settings.proxies),
"params": {"force": "true"},
}
response = simple_retry(
requests.delete,
cmd_args=[f"{self.manifest_data.url.allocations}/{self.allocation_uuid}"],
cmd_kwargs=data,
)
return response

@property
def subscription_pools(self):
if not self._subscription_pools:
Expand Down

0 comments on commit f344a97

Please sign in to comment.