Last active
October 18, 2018 23:40
-
-
Save giacaglia/44073c70fbd34445e87736b914d7096e to your computer and use it in GitHub Desktop.
Start Dataflow Job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def start_dataflow_pipeline(): | |
bucket = ‘fb_bucket’ | |
BODY = { | |
“jobName”: ‘fb_ | |
catalog_upload’, | |
“gcsPath”: “gs://{bucket}/catalog_up”.format(bucket=bucket), | |
“environment”: { | |
“tempLocation”: “gs://{bucket}/temp”.format(bucket=bucket), | |
“zone”: “us-central1-f” | |
} | |
} | |
credentials = GoogleCredentials.get_application_default() | |
service = build(‘dataflow’, ‘v1b3’, credentials=credentials) | |
dfrequest = service.projects().templates().create(projectId=settings.PROJECT_ID, body=BODY) | |
dfresponse = dfrequest.execute() | |
return dfresponse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment