by: Pratyush Singh
date: 11/11/2020
The Watson Assistant Migration Tool takes the permissions assigned to various instances of Watson Assistant, and assigns them to a single instance of Watson Assistant specified under the config/permissions.ini
file. Note, this tool does not delete the old permissions.
The Migration tool is best run by the account owner, or by someone who has equivalent permissions such as administrator on the account. Additionally, to run this tool python 3.7
is required along with pip3
installed on the machine. The libraries required are found in requirements.txt
, and more detail on the assets needed to run the tool are found in the Prerequisite section. The Migration tool requires minor configuration before use which is detailed in the Configuration section.
- Install the
ibmcloud cli
python 3.*
, preferablypython 3.7
pip3
- Administrator IAM Services privileges on the account
- Navigate to IBM Cloud
- Click on "Manage" > "Access (IAM)"
- Scroll down to "My IBM Cloud API Keys" > click on "View all" > "Create API Key"
- Copy the newly created "API Key" and paste it into
api_key
field in theconfig/keys.ini
- The
account_id
is listed in "My user details" box under the "Access (IAM)". Copy and paste the account id in theaccount_id
field inconfig/keys.ini
- Leave
access_token
blank. The tool will fill that in.
Note: the specifications listed in permissions.ini
are applied to all users.
The permissions.ini
file contains the specifications for the Watson Assistant instance that the permissions are being transferred to.
- The
service_instance
is the name of the Watson Assistant instance. This is equivalent to the name of Watson Assistant under the "Resource List" in cloud.ibm.com. - (Optional) You can specify "assistant" or "skill" under
resourceType
if you would like to narrow the permissions down to the Assistant or Skill level. - (Optional) If
resourceType
is "skill", thenresource
is the skill id. IfresourceType
is "assistant", thenresource
is the assistant id.
python main.py --permissions
- The script will output "existing_permissions_output.csv" that lists the existing permissions for Watson Assistant. Additionally, the script will output "new_permissions_configuration.csv" that lists the new permissions based on the specifications in
config/permissions.ini
.