Title: List outdated gear rules and update gear rules for project(s) with latest gear version.
Date: 6 April 2020
Description:
List all project(s) available and gear rules for the project

Topics that will be covered:

Install and import dependencies

Flywheel API Key and Client

Get a API_KEY. More on this in the Flywheel SDK doc here.

Instantiate the Flywheel API client

Show Flywheel logging information

Constants

Requirements

Before starting off, we want to check your permission on the Flywheel Instance in order to proceed in this notebook.

Tip: Group ID and Project Label can be found on top of the Project page on the Flywheel Instance as shown in the snippet below.

check_user_permission will return True if both the group and project meet the minimum requirement, else a compatible list will be printed.

Helper functions

Main script

Get list of projects to be updated

Create a list of all projects in flywheel or a subset defined in PROJECT_LABEL_SUBSET

List gear rules that use outdated gear

For each project in projects, get the gear-rules and check whether or not each gear-rule is using the latest version of the gear. If not, add it to the outdated_gears list.

Update gear rule for gear in GEAR_NAME_SUBSET for projects

For each project in projects, for each gear-rule in project, update the gear-rule with the latest gear version