From 71250cf2bd3ac4abee3784e0a68f591079a2f5b5 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Mon, 28 Jan 2019 19:05:10 +0100 Subject: [PATCH] Provide documentation for pushing events (#31) Provide documentation for pushing events. Closes #24 --- docs/_site/README.md | 2 +- docs/config/index.md | 9 ++++++++- docs/features/push-events.md | 33 +++++++++++++++++++++++++++++++++ docs/index.md | 8 ++++++-- 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 docs/features/push-events.md diff --git a/docs/_site/README.md b/docs/_site/README.md index 8dc4770..04bca5d 100644 --- a/docs/_site/README.md +++ b/docs/_site/README.md @@ -1,7 +1,7 @@ Documentation ==== -All documentation for Arcus Event Grid Sidecar which are published via GitHub Pages with Jekyll. +All documentation for Arcus Event Grid Proxy which are published via GitHub Pages with Jekyll. ## Running Jekyll locally diff --git a/docs/config/index.md b/docs/config/index.md index 7e197b7..32b433d 100644 --- a/docs/config/index.md +++ b/docs/config/index.md @@ -7,6 +7,13 @@ Here is an overview of how you can configure the container. # Runtime The runtime is flexible and allows you to configure it to meet your needs: -- **ARCUS_HTTP_PORT** - Defines the port to serve HTTP traffic _(default 80)_ +- `ARCUS_HTTP_PORT` - Defines the port to serve HTTP traffic _(default 80)_ + +# Azure Event Grid Topic +Proxy currently supports pushing events to only one Azure Event Grid topic. + +The topic to push to must be configured with the following environment variables: +- `ARCUS_EVENTGRID_TOPICENDPOINT` - Url of the topic to push to +- `ARCUS_EVENTGRID_AUTHKEY` - Authentication key to authenticate with [← back](/) \ No newline at end of file diff --git a/docs/features/push-events.md b/docs/features/push-events.md new file mode 100644 index 0000000..7a3177f --- /dev/null +++ b/docs/features/push-events.md @@ -0,0 +1,33 @@ +--- +layout: default +title: Push Events +--- + +You can easily push events to your topic via the proxy: +```bash +curl -X POST "http://localhost:8999/api/v1/events/Arcus.NewCarRegistered" + -H "accept: text/plain" -H "Content-Type: application/json-patch+json" + -d "{ \"licensePlate\": \"1-ABC-337\"}" --include +``` + +If everything is ok it will return an HTTP 204, otherwise an HTTP 503. + +```bash +HTTP/1.1 204 No Content +Date: Mon, 28 Jan 2019 17:49:43 GMT +X-Event-Id: e9ca21cc-50ed-4138-a760-1ca9b01b092f +X-Event-Subject: / +X-Event-Timestamp: 2019-01-28T17:49:43.9021889+00:00 +X-Event-Data-Version: 1.0 +``` + +## Optional parameters +We provide the capability to be more specific about your events. + +You can specify more information with the following query parameters: +- `eventId` - Unique id for your event _(default: Guid)_ +- `eventTimestamp` - Timestamp of event _(default: UTC)_ +- `eventSubject` - Subject of event _(default: /)_ +- `dataVersion` - Version of data payload _(default: 1.0)_ + +[← back](/) \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 6a55d6a..48a1b5a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,12 +13,15 @@ redirect_from: # Installation Running Arcus Event Grid Proxy is super easy: ``` -docker run -d -p 8999:80 --name arcus arcusazure/azure-event-grid-proxy +docker run -d -p 8999:80 --name arcus arcusazure/azure-event-grid-proxy / + -e ARCUS_EVENTGRID_TOPICENDPOINT= / + -e ARCUS_EVENTGRID_AUTHKEY= ``` Docker image will be available on [Docker Hub](https://hub.docker.com/r/arcusazure/azure-event-grid-proxy). # Features +- Push events to Azure Event Grid via REST ([docs](features/push-events)) - Monitor runtime with a health endpoint ([docs](operations/health)) # Documentation @@ -27,7 +30,8 @@ Docker image will be available on [Docker Hub](https://hub.docker.com/r/arcusazu - **Deployment** - [Image Tagging Strategy](deploy/tagging-strategy) - **Configuration** - - [Runtime](config#runtime) + - [Runtime](config#runtime) + - [Azure Event Grid Topic](config#azure-event-grid-topic) # License This is licensed under The MIT License (MIT). Which means that you can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the web application. But you always need to state that Codit is the original author of this web application.