DataNodeResource class

Bases: Resource

Single object resource


get: tags: - api description: | Returns a DataNodeSchema representing the unique DataNode identified by the datanode_id given as parameter. If no data node corresponds to datanode_id, a 404 error is returned.

!!! Example

    === "Curl"
        ```shell
            curl -X GET http://localhost:5000/api/v1/datanodes/DATANODE_hist_cfg_75750ed8-4e09-4e00-958d
            -e352ee426cc9
        ```
        In this example the REST API is served on port 5000 on localhost. We are using curl command line
        client.

        `DATANODE_hist_cfg_75750ed8-4e09-4e00-958d-e352ee426cc9` is the value of the *datanode_id* parameter. It
        represents the identifier of the data node we want to retrieve.

        In case of success here is an example of the response:
        ``` JSON
        {"datanode": {
            "id": "DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d",
            "config_id": "historical_data_set",
            "scope": "<Scope.SCENARIO: 2>",
            "storage_type": "csv",
            "name": "Name of my historical data node",
            "owner_id": "SCENARIO_my_awesome_scenario_97f3fd67-8556-4c62-9b3b-ef189a599a38",
            "last_edit_date": "2022-08-10T16:03:40.855082",
            "job_ids": [],
            "version": "latest",
            "validity_days": null,
            "validity_seconds": null,
            "edit_in_progress": false,
            "data_node_properties": {
                "path": "daily-min-temperatures.csv",
                "has_header": true}
            }}
        ```

        In case of failure here is an example of the response:
        ``` JSON
        {"message":"DataNode DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d not found"}
        ```

    === "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"
        )
        print(response)
        print(response.json())
        ```
        `DATANODE_hist_cfg_75750ed8-4e09-4e00-958d-e352ee426cc9` is the value of the *datanode_id* parameter. It
        represents the identifier of the data node we want to retrieve.

        In case of success here is an output example:
        ```
        <Response [200]>
        {"datanode": {
            "id": "DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d",
            "config_id": "historical_data_set",
            "scope": "<Scope.SCENARIO: 2>",
            "storage_type": "csv",
            "name": "Name of my historical data node",
            "owner_id": "SCENARIO_my_awesome_scenario_97f3fd67-8556-4c62-9b3b-ef189a599a38",
            "last_edit_date": "2022-08-10T16:03:40.855082",
            "job_ids": [],
            "version": "latest",
            "validity_days": null,
            "validity_seconds": null,
            "edit_in_progress": false,
            "data_node_properties": {
                "path": "daily-min-temperatures.csv",
                "has_header": true}
            }}
        ```

        In case of failure here is an output example:
        ```
        <Response [404]>
        {"message":"DataNode DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d not found"}

        ```

!!! 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 identifier of the data node to retrieve.

responses: 200: content: application/json: schema: type: object properties: datanode: DataNodeSchema 404: description: No data node has the datanode_id identifier. delete: tags: - api summary: Delete a data node. description: | Deletes the DataNode identified by the datanode_id given as parameter. If the data node does not exist, a 404 error is returned.

!!! Example

    === "Curl"
        ```shell
            curl -X DELETE                     http://localhost:5000/api/v1/datanodes/DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d
        ```
        In this example the REST API is served on port 5000 on localhost. We are using curl command line
        client.

        `DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d` is the value of the
        *datanode_id* parameter. It represents the identifier of the data node we want to delete.

        In case of success here is an example of the response:
        ``` JSON
        {"msg": "datanode DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d deleted"}
        ```

        In case of failure here is an example of the response:
        ``` JSON
        {"message": "Data node DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d not found."}
        ```

    === "Python"
        This Python example requires the 'requests' package to be installed (`pip install requests`).
        ```python
        import requests
        response = requests.delete(
            "http://localhost:5000/api/v1/datanodes/DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d"
        )
        print(response)
        print(response.json())
        ```
        `DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d` is the value of the
        *datanode_id* parameter. It represents the identifier of the Cycle we want to delete.

        In case of success here is an output example:
        ```
        <Response [200]>
        {"msg": "Data node DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d deleted."}
        ```

        In case of failure here is an output example:
        ```
        <Response [404]>
        {'message': 'Data node DATANODE_historical_data_set_9db1b542-2e45-44e7-8a85-03ef9ead173d not found.'}

        ```

!!! Note
    When the authorization feature is activated (available in Taipy Enterprise edition only), this endpoint
    requires the `TAIPY_EDITOR` role.

parameters: - in: path name: datanode_id schema: type: string description: The identifier of the data node to delete. responses: 200: content: application/json: schema: type: object properties: message: type: string description: Status message. 404: description: No data node has the datanode_id identifier.