Exporting and importing dataflows in CEM

Learn how to export and import dataflows by using REST API and Swagger in the Cloudera Edge Management (CEM).

In this example you use a client certificate for authentication. Ensure that your security settings are correct. For more details, see Configuration of mutual TLS authentication.

Exporting dataflow with REST API

With REST API
Trigger export with the following command after replacing all placeholders:
curl -v --cacert <cert-path>/ca-cert.pem \
--key <cert-path>/admin-key.pem   \
--cert <cert-path>/admin-cert.pem  \
--pass <admin-password> \
--output flow.json \
https://<efm-host>:<efm-port>/efm/api/designer/<test-agent-class>/flows/export
If the export is successful, you find the exported flow in the flow.json file.
Through Swagger
  1. Navigate to the Swagger UI: http://<cem-host>:<cem-port>/efm/swagger/.

    Use https in the dropdown at the very top of the page if you have a secure setup.

  2. Go to the Flow Designer section and open /designer/{agentClassName}/flows/export.


  3. Click Try it out.
  4. In the agentClassName field, type the agent class name that contains the flow you want to export.
  5. Click Execute.

After few seconds, EFM returns the content of the flow in JSON format. Save the JSON content in a text file.

Importing dataflow with REST API

With REST API
Trigger import with the following command after replacing all placeholders:
curl -v --cacert <cert-path>/ca-cert.pem \
--key <cert-path>/admin-key.pem   \
--cert <cert-path>/admin-cert.pem  \
--pass <admin-password> \
-d @flow.json \
-H 'Content-Type: application/json' \ https://localhost:10090/efm/api/designer/<test-agent-class>/flows/import
Through Swagger
  1. Navigate to the Swagger UI: http://<cem-host>:<cem-port>/efm/swagger/.

    Use https in the dropdown at the very top of the page if you have a secure setup.

  2. Go to the Flow Designer section and open /designer/{agentClassName}/flows/import.


  3. Click Try it out.
  4. In the agentClassName field, type the agent class name where you want to import the flow.
  5. Copy an exported flow content and paste it in the body field.
  6. Click Execute.

After few seconds, EFM returns the response and you can see if the import is successful.