Retrieval of Reflective Information

Open
#99 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
api, authorization

Research direction

Start with the issue's get_write_access example and the Workload.builder(), apply_workload(), and delete_workload() calls to understand the current access probe. Review the linked Ankaios dashboard request for the required reflective information and define what names, permissions, and completion behavior the SDK should expose.

Written by the indexing model from the issue text.

Description

enhancement

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
Dominant language
Python
Stars
8
Forks
4
Avg merge
2d 3h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipse-ankaios/ank-sdk-python

All issues in eclipse-ankaios/ank-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.