DataNodeList class

Bases: Resource

Creation and get_all


get: tags: - api description: | Returns a DataNodeSchema list representing all existing data nodes.

!!! Example

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

        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}
            }}
        ]
        ```

        If there is no data node, the response is an empty list as follows:
        ``` JSON
        []
        ```

    === "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")
        print(response)
        print(response.json())
        ```

        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}
            }}
        ]
        ```

        If there is no data node, the response is an empty list as follows:
        ```
        <Response [200]>
        []
        ```

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

responses: 200: content: application/json: schema: allOf: - type: object properties: results: type: array items: $ref: '#/components/schemas/DataNodeSchema' post: tags: - api description: | Creates a new data node from the config_id given as parameter.

!!! Example

    === "Curl"
        ```shell
            curl -X POST http://localhost:5000/api/v1/datanodes?config_id=historical_data_set
        ```
        In this example the REST API is served on port 5000 on localhost. We are using curl command line
        client.

        In this example the *config_id* value ("historical_data_set") is given as parameter directly in the
        url. A corresponding `DataNodeConfig^` must exist and must have been configured before.

        Here is the output message example:
        ```
        {"msg": "datanode created",
        "datanode": {
            "default_path": null,
            "path": "daily-min-temperatures.csv",
            "name": null,
            "storage_type": "csv",
            "scope": 2,
            "has_header": true}
        }
        ```

    === "Python"
        This Python example requires the 'requests' package to be installed (`pip install requests`).
        ```python
        import requests
        response = requests.post("http://localhost:5000/api/v1/datanodes?config_id=historical_data_set")
        print(response)
        print(response.json())
        ```
        In this example the *config_id* value ("historical_data_set") is given as parameter directly in the
        url. A corresponding `DataNodeConfig^` must exist and must have been configured before.

        Here is the output example:
        ```
        <Response [201]>
        {'msg': 'datanode created',
        'datanode': {
            'name': None,
            'scope': 2,
            'path': 'daily-min-temperatures.csv',
            'storage_type': 'csv',
            'default_path': None,
            'has_header': True}}
        ```

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

parameters: - in: query name: config_id schema: type: string description: The identifier of the data node configuration. responses: 201: content: application/json: schema: type: object properties: message: type: string description: Status message. datanode: DataNodeSchema