Exporting and importing dataflows using REST API
Learn how to export and import dataflows using the REST API and Swagger in Cloudera Edge Management.
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 a dataflow with REST API
- Using REST API
- Trigger the export using the following command, replacing all placeholders with
appropriate values:
If the export is successful, you can find the exported flow saved in the flow.json file.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
- Through Swagger
-
-
Navigate to the Swagger UI: http://<cem-host>:<cem-port>/efm/swagger/.
If you have a secure setup, use
https
in the drop-down at the top of the page. -
Go to the Flow Designer section and open /designer/{agentClassName}/flows/export.
-
Click Try it out.
-
In the agentClassName field, enter the agent class name that contains the flow you want to export.
-
Click Execute.
After a few seconds, Edge Flow Manager returns the flow content in JSON format.
-
Save the JSON content in a text file.
-
Importing a dataflow with REST API
- Using REST API
- Trigger the export using the following command, replacing all placeholders with appropriate
values:
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/.
If you have a secure setup, use
https
in the drop-down at the top of the page. -
Go to the Flow Designer section and open /designer/{agentClassName}/flows/import.
-
Click Try it out.
-
In the agentClassName field, enter the agent class name where you want to import the flow.
-
Copy the exported flow content and paste it in the body field.
-
Click Execute.
After few seconds, Edge Flow Manager returns the response, indicating whether the import was successful.
-