# Python script for programmatic execution of the AF workflow # (and consequent publishing of UnivColoLungImages) from gov.nasa.jpl.edrn.labcas.labcas_client import LabcasClient if __name__ == '__main__': # upload these datasets #dataset_names = ['UCHSC_1467', 'UCHSC_8798'] #dataset_names = ['UCHSC_1467'] dataset_names = ['UCHSC_8798'] product_type = 'University_of_Colorado_Lung_Image' for dataset_name in dataset_names: # submit workflow # ./wmgr-client --url http://localhost:9001 --operation --sendEvent --eventName waf --metaData --key DatasetId UCHSC_1001 labcasClient = LabcasClient() wInstId = labcasClient.executeWorkflow(['urn:edrn:WafInitTask', 'urn:edrn:WafCrawlTask'], { 'DatasetName':dataset_name }, ) # monitor workflow instance labcasClient.waitForCompletion(wInstId) # list all products for given product type labcasClient.listProducts(product_type)
# --key DataCollectionDate 20160101 --key SampleProcessingProtocols 'With water and ammonia' # --key InstrumentationTechnologyCode NGS --key Manufacturer TexasInstruments # --key ModelNumber XYZ123 --key DataProcessingProtocols 'Crunching data' # --key OwnerGroup Lab005_OwnerPrincipal labcasClient = LabcasClient() workflowTasks = ['urn:edrn:NistInitTask', 'urn:edrn:NistConvertTask', 'urn:edrn:NistExecTask', 'urn:edrn:NistCrawlTask'] metadata = {'DatasetName':'Lab005_C_R03', 'LabNumber':'005', 'Method':'C', 'RoundNumber':'003', 'LeadPI':'Johns', 'DataCollectionDate':'20160101', 'NewVersion':'false' } # upload dataset without changing the version wInstId = labcasClient.executeWorkflow(workflowTasks, metadata) # monitor workflow instance labcasClient.waitForCompletion(wInstId) # upload new version of same dataset, fix MetaData metadata['NewVersion']='true' metadata['LeadPI']='Smith' wInstId = labcasClient.executeWorkflow(workflowTasks, metadata) # monitor workflow instance labcasClient.waitForCompletion(wInstId)
# Example script to execute the "labcas-test" workflow from gov.nasa.jpl.edrn.labcas.labcas_client import LabcasClient if __name__ == '__main__': # submit workflow # ./wmgr-client --url http://localhost:9001 --operation --sendEvent --eventName labcas-test --metaData --key experiment 11 --key species snakes labcasClient = LabcasClient() wInstId = labcasClient.executeWorkflow(['urn:edrn:LabcasTestInit','urn:edrn:LabcasTestTask'], {'experiment':'11', 'species':'snakes' } ) # monitor workflow instance labcasClient.waitForCompletion(wInstId) # list all files of this product type labcasClient.listProducts('LabCAS_Test_Product')