...
There will be an internal process to push the entire market repository to S3. If a user wishes to host their own marketplace, they can do so using their own S3 instance or by hosting their own serversticking a server like apache httpd on top of a local directory structure.
APIs
The APIs are simply a contract about the directory structure of the marketplace. All APIs are relative to a base path. For example, cask.co/marketplace/v1. The structure is expected to be:
Code Block |
---|
GET <base>/<cdap-version>/categories.json <base>/packages.json <base><cdap-version>/packages-<category>.json <base>/packages/<package<cdap-name>/versions.json <base>/version>/packages/<package-name>/<version>/icon.jpg <base>/<cdap-version>/packages/<package-name>/<version>/spec.json <base>/<cdap-version>/packages/<package-name>/<version>/spec.json.asc <base>/<cdap-version>/packages/<package-name>/<version>/archive.zip <base>/<cdap-version>/packages/<package-name>/<version>/archive.zip.asc |
The packages.json, packages-<category>.json, versions.json , and signature files will could be generated using a tool from the categories.json and all the package spec.json files using a tool.
Note |
---|
In order to make serving easier, we are sacrificing flexibility and extensibility. For example, searching and filtering packages (beyond filtering by a single category) cannot be done in this way. One useful thing we may want to support very soon is filtering packages based on the CDAP version. |
List Categories
...
List Categories
Code Block |
---|
GET /categories.json [ { "name": "examples", "label": "Examples", "description": "Example applications to get started with CDAP." }, { "name": "use-cases", "label": "Use Cases", "description": "Common Use Cases." }, ... ] |
List
...
all Packages
Code Block |
---|
GET /packages.json [ { "name": "PurchaseExample", "label": "Purchase History", "description": "Example Application demonstrating usage of flows, workflows, mapreduce, and services.", "author": "Cask", "org": "Cask Data Inc.", "version": "4.0.1", "categories": [ "examples" ] }, { "name": "HelloWorld", "label": "Hello World", "description": "Simple application demonstrating usage of flows and services.", "author": "Cask", "org": "Cask Data Inc.", "version": "4.0.0", "categories": [ "examples" ] }, ... ] |
List Latest Version of all Packages in a Category
Code Block |
---|
GET /packages-<category>.json
ex: GET /packages-examples.json
[
{
"name": "PurchaseExample",
"label": "Purchase History",
"description": "Example Application demonstrating usage of flows, workflows, mapreduce, and services.",
"author": "Cask",
"org": "Cask Data Inc.",
"version": "4.0.1",
"categories": [ "examples" ]
},
{
"name": "HelloWorld",
"label": "Hello World",
"description": "Simple application demonstrating usage of flows and services.",
"author": "Cask",
"org": "Cask Data Inc.",
"version": "4.0.0",
"categories": [ "examples" ]
},
...
] |
List Package Versions
Code Block |
---|
GET /packages/<package-name>/versions.json
ex: GET /packages/PurchaseExample/versions.json
[
{
"name": "PurchaseExample",
"label": "Purchase History",
"description": "Example Application demonstrating usage of flows, workflows, mapreduce, and services.",
"author": "Cask",
"org": "Cask Data Inc.",
"version": "4.0.1",
"categories": [ "examples" ],
"created": 1234567899,
"changelog": "fixed a small parsing bug",
"dependencies": {
"cdap": {
"minVersion": "4.0.0",
"maxVersion": "4.1.0"
}
}
},
{
"name": "PurchaseExample",
"label": "Purchase History",
"description": "Example Application demonstrating usage of flows, workflows, mapreduce, and services.",
"author": "Cask",
"org": "Cask Data Inc.",
"categories": [ "examples" ],
"version": "4.0.0",
"created": 1234567890,
"changelog": "updated APIs to work with CDAP 4.0.0",
"dependencies": {
"cdap": {
"minVersion": "4.0.0",
"maxVersion": "4.1.0"
}
}
},
...
] |
...
Note |
---|
This leaves display of multiple versions of the same package up to the UI. |
Get Package Archive
Code Block |
---|
GET /packages/<package-name>/<version>/archive.zip ex: GET /packages/PurchaseExample/4.0.1/archive.zip [ binary archive contents] |
...
Code Block |
---|
GET /packages/<package-name>/<version>/spec.json ex: GET /packages/PurchaseExample/4.0.1/spec.json { "spec-version": "1.0", "name": "PurchaseExample", "label": "Purchase History", "description": "Example Application demonstrating usage of flows, workflows, mapreduce, and services.", "author": "Cask", "org": "Cask Data Inc.", "version": "4.0.1", "created": 1234567899, "changelog": "fixed a small parsing bug", "categories": [ "examples" ], "dependencies": { "cdap": { "minVersion": "4.0.0", fixed a small parsing bug", "maxVersioncategories": "4.1.0[ "examples" ], } "dependencies": { }, "actions": [ { "type": "create_artifact", "arguments": [ { "name": "name", "value": "PurchaseHistoryExample" }, { "name": "version", "value": "4.0.1" }, { "name": "scope", "value": "user" }, { "name": "jar", "value": "PurchaseHistoryExample-4.0.1.jar" } ] }, { "type": "create_app", "arguments": [ { "name": "name", "default": "PurchaseHistory" } ] } ] } |
...
Packages will be able to specify dependencies on the CDAP version, as well as dependencies on other packages.
...
other packages.
Code Block |
---|
{ ... "packagesdependencies": [ { "name": "spark-plugins", "minVersionversion": "1.5.0", "maxVersion": "1.6.0" }, ... ] } } |
Min versions are inclusive and max versions are exclusive.
...