REST API Examples using curl¶
This topic contains a range of examples that demonstrate how to use the Fire Insights API using curl.
Acquire Session Cookie Using Curl
When invoking the REST APIs of Fire Insights with curl, the first step is to log in and save the incoming cookie into a text file. This file would then be used in making subsequent REST calls via curl.
Save the incoming cookies using the -c
option of curl
into a file.
In the below examples, the Fire Insights web server is running on the local machine at : localhost:8080
You can replace it with your machine name and port.
Login and save the session cookie into /tmp/cookies.txt:
curl -i -X POST -d username=admin -d password=admin -c /tmp/cookies.txt localhost:8080/login
In the above:
- username = admin
- password = admin
- Incoming cookie gets saved into : /tmp/cookies.txt
- REST API endpoint : localhost:8080/login
There are various categories of REST API’s available:
- Processors REST API’s
- Datasets REST API
- Workflow REST API
- Workflow Execution REST API
- Dashboard REST API
- HDFS REST API
- Overview
- Get List of Files in Directory
- Create HDFS directory
- Get list of files in HDFS in the specified directory
- Get list of all the files on hdfs in the users home directory in sorted order
- Upload file
- Deletes a file from HDFS
- Download HDFS file
- Rename HDFS File
- Get first X bytes of content of a file
- HIVE REST API
- Scheduler REST API