From 7ca1b56fb9212d71d0d26c6a365bcda008a497d0 Mon Sep 17 00:00:00 2001 From: Thomas Bouldin Date: Mon, 2 Apr 2018 08:09:32 -0700 Subject: [PATCH 1/3] Introduce source-labels to help IoT cases. Labels are a common concept in many existing products. They are set on the source and are orthogonal to any requests that are made against the resource. In the events use cases, they can be particularly useful for non-heirarchical filters or correlation of events. It is reasoanble that the source itself is immutable (E.g. a device UUID) but that an Action would respond to a device's events based on where it is deployed. (E.g. a particular user's house). Signed-off-by: Thomas Bouldin --- spec.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/spec.md b/spec.md index 6c98f4522..355c4978d 100644 --- a/spec.md +++ b/spec.md @@ -328,6 +328,25 @@ that contains both context and data). * Constraints: * REQUIRED +### sourceLabels +* Type: `Map` +* Description: Non-heirarchical attributes which describe the `source` of + the event. Receivers may filter or route based on these attributes. + This is intended to include (but is not limited to) "labels" in cloud + platforms like AWS or Kubernetes. +* Constraints: + * OPTIONAL + * Keys MUST match the regular expression `[_a-z0-9][_.a-z0-9]*` + * Keys SHOULD use the character "." as a namespace separator + * Values MUST be `String`s + * Values MUST use URI-safe characters + * Values MUST be non-zero in length +* Examples: + * { + "sensor.configuration": "WINDOW", + "sensor.location": "deployments/house1/window3" + } + ### eventID * Type: `String` * Description: ID of the event. The semantics of this string are explicitly From 937cbffe68f27adf053529011a75cb52b021305d Mon Sep 17 00:00:00 2001 From: Thomas Bouldin Date: Wed, 25 Apr 2018 10:28:46 -0700 Subject: [PATCH 2/3] Avoid using keyword Signed-off-by: Thomas Bouldin --- spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.md b/spec.md index 355c4978d..d6d139fe3 100644 --- a/spec.md +++ b/spec.md @@ -331,7 +331,7 @@ that contains both context and data). ### sourceLabels * Type: `Map` * Description: Non-heirarchical attributes which describe the `source` of - the event. Receivers may filter or route based on these attributes. + the event. Receivers can filter or route based on these attributes. This is intended to include (but is not limited to) "labels" in cloud platforms like AWS or Kubernetes. * Constraints: From 3e34a4121efa99e76a3f5a3d4a6d094d3a50be11 Mon Sep 17 00:00:00 2001 From: Thomas Bouldin Date: Tue, 8 May 2018 22:19:05 -0700 Subject: [PATCH 3/3] * Rename sourceLabels to labels. * Add '/' as a valid character; platforms use this in K8S * Rebase Signed-off-by: Thomas Bouldin --- spec.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.md b/spec.md index d6d139fe3..6878598fd 100644 --- a/spec.md +++ b/spec.md @@ -328,15 +328,15 @@ that contains both context and data). * Constraints: * REQUIRED -### sourceLabels +### labels * Type: `Map` * Description: Non-heirarchical attributes which describe the `source` of the event. Receivers can filter or route based on these attributes. This is intended to include (but is not limited to) "labels" in cloud platforms like AWS or Kubernetes. * Constraints: - * OPTIONAL - * Keys MUST match the regular expression `[_a-z0-9][_.a-z0-9]*` + * OPTIONAL. + * Keys MUST match the regular expression `[_a-z0-9][_.a-z0-9/]*` * Keys SHOULD use the character "." as a namespace separator * Values MUST be `String`s * Values MUST use URI-safe characters