from arcapix.fs.gpfs.policy import PlacementPolicy
from arcapix.fs.gpfs.rule import MigrateRule

# load placement policy for mmfs1
policy = PlacementPolicy('mmfs1')

# create a new migrate rule for 'sata1'
r = MigrateRule(source='sata1', threshold=(90, 50))

# add rule to start of the policy
policy.rules.insert(r, 0)

# save changes
policy.save()

[(5, 'arcapix.fs.gpfs.policy.PlacementPolicy', 'PlacementPolicy', False, 'from arcapix.fs.gpfs.policy import PlacementPolicy\n'), (8, 'arcapix.fs.gpfs.rule.MigrateRule', 'MigrateRule', False, 'from arcapix.fs.gpfs.rule import MigrateRule\n')]