In [1]:
import urllib
import ovation.lab.workflows as workflows

from ovation.session import connect

from tqdm import tqdm_notebook as tqdm
from pprint import pprint


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-2b5ee53e73ff> in <module>()
      1 import urllib
----> 2 import ovation.lab.workflows as workflows
      3 
      4 from ovation.session import connect
      5 

ImportError: No module named 'ovation.lab.workflows'

In [ ]:
s = connect(input('Email: '), api='https://services-staging.ovation.io', token='/api/v1/sessions')

Upload Activity results

Workflow activities are (optionally) uniquely labeled by the Workflow Definition. This label allows clients to upload metadata and files to activities by label. In this example, we create a new XX activity within an existing workflow.


In [ ]:
# TODO source, destination
metadata = {'custom_attributes': {'my-attribute': 1}}
resources = {'resource-label': '/Users/barry/Desktop/Ovation Demo Files/results.txt'}

In [ ]:
workflow_id = input('Workflow ID: ')

In [ ]:
activity_label = input('Activity label: ')

For illustration, we view the Workflow, showing links.activity_label.related, the URL where create_activity will POST the new Activity data


In [ ]:
workflow = s.get(s.path('workflows', workflow_id))
pprint(workflow.workflow)

Now, let's create the activity.


In [ ]:
activity = workflows.create_activity(s, workflow_id, activity_label, data=metadata, resources=resources, progress=tqdm)