DataNodeReader class
Bases: Resource
Single object resource
get: tags: - api description: | Returns the data read from the data node identified by datanode_id. If the data node does not exist, a 404 error is returned.
!!! Example
=== "Curl"
```shell
curl -X GET http://localhost:5000/api/v1/datanodes/DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d/read
```
`DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d` is the *datanode_id*
parameter. It represents the identifier of the data node to read.
Here is an output example. In this case, the storage type of the data node to read is `csv`,
and no exposed type is specified. The data is exposed as a list of dictionaries, each dictionary
representing a raw of the csv file.
```
{"data": [
{"Date": "1981-01-01", "Temp": 20.7}, {"Date": "1981-01-02", "Temp": 17.9},
{"Date": "1981-01-03", "Temp": 18.8}, {"Date": "1981-01-04", "Temp": 14.6},
{"Date": "1981-01-05", "Temp": 15.8}, {"Date": "1981-01-06", "Temp": 15.8},
{"Date": "1981-01-07", "Temp": 15.8}
]}
```
=== "Python"
This Python example requires the 'requests' package to be installed (`pip install requests`).
```python
import requests
response = requests.get(
"http://localhost:5000/api/v1/datanodes/DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d/read")
print(response)
print(response.json())
```
`DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d` is the *datanode_id*
parameter. It represents the identifier of the data node to read.
Here is an output example. In this case, the storage type of the data node to read is `csv`,
and no exposed type is specified. The data is exposed as a list of dictionaries, each dictionary
representing a raw of the csv file.
```
{"data": [
{"Date": "1981-01-01", "Temp": 20.7}, {"Date": "1981-01-02", "Temp": 17.9},
{"Date": "1981-01-03", "Temp": 18.8}, {"Date": "1981-01-04", "Temp": 14.6},
{"Date": "1981-01-05", "Temp": 15.8}, {"Date": "1981-01-06", "Temp": 15.8},
{"Date": "1981-01-07", "Temp": 15.8}
]}
```
!!! Note
When the authorization feature is activated (available in Taipy Enterprise edition only), this endpoint
requires the `TAIPY_READER` role.
parameters: - in: path name: datanode_id schema: type: string description: The id of the data node to read. requestBody: content: application/json: schema: DataNodeFilterSchema responses: 200: content: application/json: schema: type: object properties: data: type: Any description: The data read from the data node. 404: description: No data node has the datanode_id identifier.