-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from airflow-plugins/develop-rc0.0.2
Develop rc0.0.2
- Loading branch information
Showing
16 changed files
with
1,903 additions
and
1,258 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
# marketo_plugin | ||
# Plugin - Marketo to S3 | ||
|
||
This plugin moves data from the [Marketo](http://developers.marketo.com/rest-api/) API to S3 based on the specified object | ||
|
||
## Hooks | ||
### MarketoHook | ||
This hook handles the authentication and request to Marketo. This extends the HttpHook. | ||
|
||
### S3Hook | ||
[Core Airflow S3Hook](https://pythonhosted.org/airflow/_modules/S3_hook.html) with the standard boto dependency. | ||
|
||
## Operators | ||
### MarketoToS3Operator | ||
This operator composes the logic for this plugin. It fetches the Marketo specified object and saves the result in a S3 Bucket, under a specified key, in | ||
njson format. The parameters it can accept include the following. | ||
|
||
#### NOTE: The only currently supported + tested output format is json. There are references to avro in this code but support for that format had to be delayed. | ||
|
||
`marketo_conn_id` The Airflow connection id used to store the Marketo credentials. | ||
`marketo_endpoint` The endpoint to retreive data for. Possible values include: | ||
- activities | ||
- campaigns | ||
- leads | ||
- programs | ||
- lead_lists | ||
- `start_at` The starting date parameter. Ignored by all endpoints but leads. | ||
- `end_at` The ending date parameter. Ignored by all endpoints but leads. | ||
- `payload` Payload variables -- all are optional | ||
- `output_format` The output format of the data. Possible values include: | ||
- json | ||
- avro | ||
Defaults to json. | ||
- `s3_conn_id` The Airflow connection id used to store the S3 credentials. | ||
- `s3_bucket` The S3 bucket to be used to store the Marketo data. | ||
- `s3_key` The S3 key to be used to store the Marketo data. |
This file contains 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from MarketoPlugin.schemas.activities import activities | ||
from MarketoPlugin.schemas.campaigns import campaigns | ||
from MarketoPlugin.schemas.lead_lists import lead_lists | ||
from MarketoPlugin.schemas.leads import leads | ||
from MarketoPlugin.schemas.programs import programs | ||
|
||
|
||
schema = {'activities': activities, | ||
'campaigns': campaigns, | ||
'lead_lists': lead_lists, | ||
'leads': leads, | ||
'programs': programs} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
activities = {"name": "activities", | ||
"type": "record", | ||
"fields": [{"name": "activity_date", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "activity_type_id", | ||
"type": ["null", "int"], | ||
"default": "null"}, | ||
{"name": "attributes", | ||
"type": { | ||
"type": "array", | ||
"items": [ | ||
{"name": "attribute", | ||
"type": "record", | ||
"fields": [ | ||
{"name": "name", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "value", | ||
"type": ["null", "string"], | ||
"default": "null"} | ||
]}]} | ||
}, | ||
{"name": "campaign_id", | ||
"type": ["null", "int"], | ||
"default": "null"}, | ||
{"name": "id", | ||
"type": ["null", "int"], | ||
"default": "null"}, | ||
{"name": "lead_id", | ||
"type": ["null", "int"], | ||
"default": "null"}, | ||
{"name": "marketo_guid", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "primary_attribute_value", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "primary_attribute_value_id", | ||
"type": ["null", "int"], | ||
"default": "null"} | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
campaigns = {"name": "campaigns", | ||
"type": "record", | ||
"fields": [{"name": "active", | ||
"type": ["null", "boolean"], | ||
"default": "null"}, | ||
{"name": "created_at", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "description", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "name", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "program_id", | ||
"type": ["null", "int"], | ||
"default": "null"}, | ||
{"name": "program_name", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "type", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "updated_at", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "workspace_name", | ||
"type": ["null", "string"], | ||
"default": "null"} | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
lead_lists = {"name": "lead_lists", | ||
"type": "record", | ||
"fields": [{"name": "created_at", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "description", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "id", | ||
"type": ["null", "int"], | ||
"default": "null"}, | ||
{"name": "name", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "program_name", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "updated_at", | ||
"type": ["null", "string"], | ||
"default": "null"}, | ||
{"name": "workspace_name", | ||
"type": ["null", "string"], | ||
"default": "null"} | ||
]} |
Oops, something went wrong.