Example:
Basic code to use Python to retrieve list of feature flags names and their status for given workspace and environment names.
Script will use the REST Admin API to perform the actions. Will return list of feature flags names and the rollout status value.
How to use:
- Class wrapper for Admin API, installation instructions in this link: Python Admin API Library Wrapper
- Update the following variables in code below:
workspaceName, environmentName
Admin API key
from splitapiclient.main import get_client
#############################################
workspaceName="Default"
#############################################
client = get_client({'apikey': 'ADMIN API KEY'})
ws = client.workspaces.find(workspaceName)
for sp in client.splits.list(ws.id):
if sp._rolloutStatus != {}:
print (sp.name+", "+str(sp._rolloutStatus['name']))
Comments
0 comments
Please sign in to leave a comment.