eclipse-ankaios / eclipse-ankaios/ank-sdk-python

Retrieval of Reflective Information

Open
#99 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
8
Forks
4
Avg merge
2d 3h
Merged PRs (30d)
1

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 https://github.com/FelixMoelders/ankaios-dashboard/issues/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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.