- How to upload an Artifact:
In Artifact upload and listing:
In order to create applications with versions, the artifact jars (which contains CDAP application) needs to be uploaded first. Once an artifact is uploaded, an application can be created from it by optionally providing a configuration.
POST
Uploading artifact
Code Block | ||
---|---|---|
| ||
POST /v3/namespaces/<namespace-id>/artifacts/<artifact-id> --data- |
binary @path/to/file-1.1.0.jar |
You can view the information about artifacts deployed using the endpoint.
Listing artifacts
Code Block | ||
---|---|---|
| ||
GET /v3/namespaces/<namespace-id>/artifacts |
|
How to Create multiple versions of an Application:
POST
Creating applications from artifacts:
REST call to create application from artifact
Code Block | ||
---|---|---|
| ||
POST /v3/namespaces/<namespace-id>/apps/<app-id>/versions/<version-id>/create |
Body: { |
"artifact": { |
"name": "WordCount", |
"version": "3.5.1", |
"scope": "user"}, |
"config": {"stream": "purchaseStream"} } |
...
version-id: Needs to be composed only of alphanumeric, -, _ and .
Note: i)
- If a version-id is not specified during application creation, '-SNAPSHOT' is used as the application version
...
...
- If a version-id ends with '-SNAPSHOT', then that version is mutable and it can be updated using the update app endpoint (more details below).
- How to start/stop programs of a particular version of an Application:
POST /v3/namespaces/<namespace-id>/apps/<app-id>/versions/<version-id>/services/<service-id>/start ( stop )
Note: We don't support concurrent runs of the same Flow and Worker across multiple versions. That is, flow F1 in v2 of app MyApp can't be started when flow F1 in v1 of app MyApp is running. - How to delete a version of an Application:
DELETE /v3/namespaces/<namespace-id>/apps/<app-id>/versions/<version-id>
Note: No program of this version should be running.
...