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:
If the export is successful, you find the exported flow in thecurl -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
flow.json
file. - Through Swagger
-
- 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. - Go to the Flow Designer section and open /designer/{agentClassName}/flows/export.
- Click Try it out.
- In the agentClassName field, type the agent class name that contains the flow you want to export.
- Click Execute.
After few seconds, EFM returns the content of the flow in JSON format. Save the JSON content in a text file.
- Navigate to the Swagger UI:
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
-
- 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. - Go to the Flow Designer section and open /designer/{agentClassName}/flows/import.
- Click Try it out.
- In the agentClassName field, type the agent class name where you want to import the flow.
- Copy an exported flow content and paste it in the body field.
- Click Execute.
After few seconds, EFM returns the response and you can see if the import is successful.
- Navigate to the Swagger UI: