|
1 | | -# CloudBees Feature Management provider for OpenFeature |
| 1 | +# CloudBees Feature Management provider for OpenFeature |
| 2 | + |
| 3 | +[](https://www.repostatus.org/#wip) |
| 4 | +[](https://cloud-native.slack.com/archives/C0344AANLA1) |
| 5 | +[](https://github.com/open-feature/spec/tree/v0.3.0) |
| 6 | +[](https://github.com/open-feature/python-sdk/) |
| 7 | +[](https://pypi.org/project/rox/) |
| 8 | + |
| 9 | +This is the [CloudBees](https://www.cloudbees.com/products/feature-management) provider implementation for [OpenFeature](https://openfeature.dev/) for the [Python SDK](https://github.com/open-feature/python-sdk). |
| 10 | + |
| 11 | +OpenFeature provides a vendor-agnostic abstraction layer on Feature Flag management. |
| 12 | + |
| 13 | +This provider allows the use of CloudBees Feature Management as a backend for Feature Flag configurations. |
| 14 | + |
| 15 | +## Requirements |
| 16 | +- python 3.8 or higher |
| 17 | + |
| 18 | +## Installation |
| 19 | + |
| 20 | +### Add it to your build |
| 21 | + |
| 22 | +```bash |
| 23 | +pip install cloudbees-openfeature-provider-python |
| 24 | +``` |
| 25 | + |
| 26 | +### Confirm peer dependencies are installed |
| 27 | +```bash |
| 28 | +pip install openfeature-sdk |
| 29 | +``` |
| 30 | + |
| 31 | + |
| 32 | +### Configuration |
| 33 | + |
| 34 | +Follow the instructions on the [Python SDK project](https://github.com/open-feature/python-sdk) for how to use the Python SDK. |
| 35 | + |
| 36 | +You can configure the CloudBees provider by doing the following: |
| 37 | + |
| 38 | +```python |
| 39 | +from openfeature import api |
| 40 | +from openfeature.api import EvaluationContext |
| 41 | +from cloudbees.provider import CloudbeesProvider |
| 42 | + |
| 43 | +appKey = 'INSERT_APP_KEY_HERE' |
| 44 | +provider = CloudbeesProvider(appKey) |
| 45 | +api.set_provider(provider) |
| 46 | +client = api.get_client() |
| 47 | +value = client.get_boolean_value("enabled-new-feature", False) |
| 48 | +``` |
0 commit comments