Shopify / pyoozie

Library for querying and scheduling with Apache Oozie
https://py-oozie.readthedocs.io
MIT License
11 stars 12 forks source link

Reorganize to keep most elements at the top-level and specific elements in xml or api #10

Closed cfournie closed 7 years ago

cfournie commented 7 years ago

Let's try to enable usage to look like:

import pyoozie
import pyoozie.xml
import pyoozie.api

workflow_app_path = '...'

coord_xml = pyoozie.CoordinatorBuilder(
    name='coordinator-name',
    workflow_xml_path=workflow_app_path
    secret_feature=pzoozie.xml.SecretFeature()).build()

client = pyoozie.OozieClient(
    url='https://..',
    user='oozie',
    advanced_feature=pyoozie.api.AdvancedFeature())

coord_path = '...'

hdfs_client = '...'
hdfs_client.write(path=coord_path, data=coord_xml)

coord_config = {
    'user.name': 'oozie',
}

coordinator = oozie_client.jobs_submit_coordinator(
    coord_path,
    coord_config)

print(coordinator.coord_job_id)
assert coordinator.status.is_active
cfournie commented 7 years ago

We went in a different direction: flat top-level repos.