-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Description
It would be nice to have a feature, to find out the name, read write access, i.e. reflective information on the workload that the python sdk is called from.
As requested by FelixMoelders/ankaios-dashboard#36 it is necessary to find out whether the calling sdk has write access.
Currently I retrieve the information with an anti-pattern:
def get_write_access(self):
write_access = {"writeAccess": True}
try:
workload = Workload.builder().workload_name("access_test").agent_name("access_test_agent").runtime("podman").runtime_config("").restart_policy("NEVER").build()
self.ankaios.apply_workload(workload)
self.ankaios.delete_workload("access_test")
except AnkaiosException as e:
print("Ankaios exception: ", e)
if "Access denied" in str(e):
write_access = {"writeAccess": False}
return write_access
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request