Skip to content
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

Added Environment Variable client #251

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ In this guide, we will dive deeper into each of these topic.
### [Using Conductor in your Application](conductor_apps.md)





## Using Conductor clients to manage resources
### [Metadata Client for Workflow & Task Definitions](docs/metadata/README.md)
### [Workflow Client for Workflow Executions](docs/workflow/README.md)
### [Task Client for Task Executions](docs/task/README.md)
### [Scheduler Client for Schedule Management](docs/schedule/README.md)
### [Secret Client for Managing Secrets](docs/secret/README.md)
### [Environment Variable Client for managing Environment Variables](docs/env_variable/README.md)
### [Authorization Client for managing Users, Groups, Applications and Permissions](docs/authorization/README.md)
44 changes: 44 additions & 0 deletions docs/env_variable/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Environment Variable Management

## Env Variable Client

### Initialization
```python
from conductor.client.configuration.configuration import Configuration
from conductor.client.configuration.settings.authentication_settings import AuthenticationSettings
from conductor.client.orkes.orkes_env_variable_client import OrkesEnvVariableClient

configuration = Configuration(
server_api_url=SERVER_API_URL,
debug=False,
authentication_settings=AuthenticationSettings(key_id=KEY_ID, key_secret=KEY_SECRET)
)

env_variable_client = OrkesEnvVariableClient(configuration)
```

### Saving Environment Variable

```python
env_variable_client.save_env_variable("VAR_NAME", "VAR_VALUE")
```

### Get Environment Variable

#### Get a specific variable

```python
value = env_variable_client.get_env_variable("VAR_NAME")
```

#### Get all variable

```python
var_names = env_variable_client.get_all_env_variables()
```

### Delete Environment Variable

```python
env_variable_client.delete_env_variable("VAR_NAME")
```
20 changes: 20 additions & 0 deletions src/conductor/client/env_variable_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from abc import ABC, abstractmethod
from typing import Dict


class EnvVariableClient(ABC):
@abstractmethod
def save_env_variable(self, name: str, value: str):
pass

@abstractmethod
def get_env_variable(self, name: str) -> str:
pass

@abstractmethod
def get_all_env_variables(self) -> Dict:
pass

@abstractmethod
def delete_env_variable(self, name: str):
pass
Loading
Loading