Example: Basic Code to use Python to Copy Split Definition (Whitelists, Targeting Rules and Treatments) from source Workspace/Environment to a target Workspace/Environment. The script will create the target Split in the target Workspace, then add the Split Definition.
If the target Split already exist, comment out the line that creates the target split.
Script will use the REST Admin API to perform the actions.
- Python 2.7.15
- requests 2.18.1
How to use:
- Class wrapper for Admin API is:
- Update the following variables in Main.py:
sourceSplitName, sourceWorkspaceName, sourceEnvironmentName
targetSplitName, targetWorkspaceName, targetEnvironmentName, targetSplitDescription, targetTrafficTypeName
Admin API Key
Please note each Split has a unique hash key used to calculate treatments when percentage distribution rule is used, i.e. users bucketing will be different in each Split, and their experience might change from the old to the new Split.