Home > Storage > PowerScale (Isilon) > Industry Solutions and Verticals > Media and Entertainment > PowerScale OneFS: A Metadata Driven Approach to On Demand Tiering > Trigger a SmartPoolsTree job on the parent directory
The next API call assumes that at least one File Policy has been configured to move data based on file attribute. OneFS does not move data based on a directory having extended attributes only files. However, SmartPoolsTree jobs can be set to run only on specific paths. For example, a SmartPoolsTree job can be run on the path:
/ifs/data/project/my-show/
This job causes all the OneFS File Policies (as defined in the File Pool configuration menu) to be run only against that specific path, not the entire file system. In this way, administrators can target precisely which parent directory (and their children) they want to run File Policies against and greatly reduce the time for the job to complete.
This code iterates through the paths_to_smartpoolstreejob list created above and triggers SmartPoolsTree jobs on those paths. The final print statement is unnecessary, but a response of 201 indicates success.
# Trigger SmartPoolsTree job on path
for path in paths_to_smartpoolstreejob:
body = json.dumps( { 'smartpoolstree_params' : {'recurse': True}, 'paths': ['/ifs' + path], 'allow_dup': True, 'type': 'SmartPoolsTree'})
headers = {'Content-Type' : 'application/json'}
response = session.post(papi + endpoint, data=body, headers=headers, verify=False)
print(response)