sergioferragut commented on code in PR #14742:
URL: https://github.com/apache/druid/pull/14742#discussion_r1289215748


##########
examples/quickstart/jupyter-notebooks/notebooks/01-introduction/02-datagen-intro.ipynb:
##########
@@ -0,0 +1,618 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "id": "9e07b3f5-d919-4179-91a1-0f6b66c42757",
+   "metadata": {},
+   "source": [
+    "# Data Generator Server\n",
+    "The default Docker Compose deployment includes a data generation service 
created from the published Docker image at `imply/datagen:latest`. \n",
+    "This image is built by the project 
https://github.com/implydata/druid-datagenerator. \n",
+    "\n",
+    "This notebook shows you how to use of the data generation service 
included in the Docker Compose deployment. It explains how to use pre-defined 
data generator configurations as well as how to build a custom data generator. 
You will also learn how to create sample data files for batch ingestion and how 
to generate live streaming data for streaming ingestion.\n",
+    "\n",
+    "## Table of contents\n",
+    "\n",
+    "* [Initialization](#Initialization)\n",
+    "* [List Available Configurations](#List-available-configurations)\n",
+    "* [Generate a data file for backfilling 
history](#Generate-a-data-file-for-backfilling-history)\n",
+    "* [Batch Ingestion of Generated 
Files](#Batch-Ingestion-of-Generated-Files)\n",
+    "* [Generate custom data](#Generate-custom-data)\n",
+    "* [Stream generated data](#Stream-generated-data)\n",
+    "* [Ingest data from a stream](#Ingest-data-from-a-stream)\n",
+    "* [Cleanup](#Cleanup)\n",
+    "\n",
+    "\n",
+    "## Initialization\n",
+    "\n",
+    "To interact with the data generation service, use the REST client 
provided in the [`druidapi` Python 
package](https://druid.apache.org/docs/latest/tutorials/tutorial-jupyter-index.html#python-api-for-druid)."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "f84766c7-c6a5-4496-91a3-abdb8ddd2375",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import druidapi\n",
+    "import os\n",
+    "\n",
+    "# Datagen client \n",
+    "datagen = druidapi.rest.DruidRestClient(\"http://datagen:9999\";)\n",
+    "\n",
+    "if (os.environ['DRUID_HOST'] == None):\n",
+    "    druid_host=f\"http://router:8888\"\n";,
+    "else:\n",
+    "    druid_host=f\"http://{os.environ['DRUID_HOST']}:8888\"\n",
+    "\n",
+    "# Druid client\n",
+    "druid = druidapi.jupyter_client(druid_host)\n",
+    "\n",
+    "\n",
+    "\n",
+    "# these imports and constants are used by multiple cells\n",
+    "from datetime import datetime, timedelta\n",
+    "import json\n",
+    "\n",
+    "headers = {\n",
+    "  'Content-Type': 'application/json'\n",
+    "}\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "c54af617-0998-4010-90c3-9b5a38a09a5f",
+   "metadata": {},
+   "source": [
+    "### List available configurations\n",
+    "Use `/list` API endpoint to get the data generator's available 
configuration values with pre-defined data generator schemas."

Review Comment:
   No, but that would be a great addition to the data generator. Maybe 
/schema/{config_file} and it provides a schema for the messages it creates. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to