...
Scenario 1: Add a draft of a SFDC Lead Dump Hydrator pipeline
The marketplace has a group called 'Hydrator Pipelines'
When the user clicks on the '+' button, the UI makes a call:
...
to display all the different types of things the user can add in the CDAP marketplace. Among that list is 'Hydrator Pipelines', which the user clicks on. The UI makes another call to list the packages in the 'Hydrator Pipelines' group:
...
Code Block |
---|
GET /groups/hydrator-pluginspipelines/packages/sfdc-lead-dump/versions/1.0.1/spec { "name": "sfdc-lead-dump", "label": "SFDC Lead Dump", "description": "Reads SFDC data from a CDAP Stream, filters invalid records, and dumps the data to a CDAP Table.", "author": "Cask", "org": "Cask Data Inc.", "version": "1.0.1", "created": 1234567899, "changelog": [ "fixed a small parsing bug" ], "actions": [ { "type": "create_artifact", "arguments": [ { "name": "scope", "value": "user", "canModify": false }, { "name": "name", "value": "sfdc-plugins", "canModify": false }, { "name": "version", "value": "1.0.0", "canModify": false }, { "name": "parents", "value": "system:cdap-data-pipeline[4.0.0,4.1.0)", "canModify": false }, { "name": "jar", "value": "sfdc-plugins.jar", // file in the archive "canModify": false } ] }, { "type": "create_hydrator_draft", "arguments": [ { "name": "artifact", "value": { "scope": "system", "name": "cdap-data-pipeline", "version": "4.0.0" }, "canModify": false }, { "name": "name", "value": "SFDC Lead Dump", "canModify": true }, { "name": "config", "value": "sfdc.json", // file in the archive "canModify": false } ] } ] } |
...
Code Block |
---|
GET /groups/hydrator-pluginspipelines/packages/sfdc-lead-dump/versions/1.0.1/spec.asc |
...
Code Block |
---|
GET /groups/hydrator-pluginspipelines/packages/sfdc-lead-dump/versions/1.0.1/archive.tgz GET /groups/hydrator-pluginspipelines/packages/sfdc-lead-dump/versions/1.0.1/archive.tgz.asc |
...
Scenario 7: Add MySQL jdbc driver as a Hydrator plugin.
When the user clicks on the '+' button, the UI makes a call:
Code Block |
---|
GET /groups
[
{
"name": "examples",
"label": "Examples",
"description": "Example applications to get started with CDAP."
},
{
"name": "hydrator-plugins",
"label": "Hydrator Plugins",
"description": "Plugins for Hydrator Pipelines."
},
...
] |
to display all the different types of things the user can add in the CDAP marketplace. Among that list is 'Hydrator Plugins', which the user clicks on. The UI makes another call to list the packages in the 'Hydrator Plugins' group:
Code Block |
---|
GET /groups/hydrator-plugins/packages
[
...,
{
"name": "mysql-jdbc-driver",
"label": "MySQL JDBC Driver",
"description": "JDBC Driver for MySQL databases.",
"author": "MySQL",
"org": "Oracle"
},
...
] |
Among the list is the MySQL JDBC Driver, which the user clicks on. The UI makes a call to get all versions of that package:
Code Block |
---|
GET /groups/hydrator-plugins/packages/mysql-jdbc-driver/versions
[
{
"name": "mysql-jdbc-driver",
"label": "MySQL JDBC Driver",
"description": "JDBC Driver for MySQL databases.",
"author": "MySQL",
"org": "Oracle",
"version": "5.1.38",
"created": 1234567899,
"changelog": [ ],
"dependencies": { }
},
...
] |
The user decides to install the 5.1.38 version of the driver. The UI makes a call to get the spec, and to get the spec signature to make sure it is valid:
Code Block |
---|
GET /groups/hydrator-plugins/packages/mysql-jdbc-driver/versions/5.1.38/spec.asc
GET /groups/hydrator-plugins/packages/mysql-jdbc-driver/versions/5.1.38/spec
{
"name": "mysql-jdbc-driver",
"label": "MySQL JDBC Driver",
"description": "JDBC Driver for MySQL databases.",
"author": "MySQL",
"org": "Oracle",
"version": "5.1.38",
"created": 1234567899,
"actions": [
{
"type": "create_artifact",
"arguments": [
{
"name": "scope",
"value": "user",
"canModify": false
},
{
"name": "name",
"value": "mysql-connector-java",
"canModify": false
},
{
"name": "version",
"value": "5.1.38",
"canModify": false
},
{
"name": "parents",
"value": "system:cdap-data-pipeline[3.0.0,10.0.0]/system:cdap-data-streams[3.0.0,10.0.0]",
"canModify": false
},
{
"name": "jar",
"value": "mysql-connector-java-5.1.38-bin.jar", // file in the archive
"canModify": false
},
{
"name": "plugins",
"value": "plugins.json", // file in the archive
"canModify": false
}
]
}
]
} |
The UI then makes calls to get the archive and its signature to validate the archive, and unpack it in a local directory. It uses the jar and json config file contained in the archive to make a request to add the artifact to cdap.
Code Block |
---|
GET /groups/hydrator-plugins/packages/mysql-jdbc-driver/versions/5.1.38/archive.tgz.asc
GET /groups/hydrator-plugins/packages/mysql-jdbc-driver/versions/5.1.38/archive.tgz |