Draft: draft-ietf-core-senml-etch

Commentary: using " ( i)PATCH " to refer to both PATCH methods Clarified defaulting rules Clarified name resolving rules Clarified use of " resource " Added note that application of Patch Packs is idempotent Removed " more details in RFC - AAA " from media type encoding considerations ( there are no more details actually )
The Sensor Measurement Lists (SenML) media type and data model can be
used to send collections of resources, such as batches of sensor data
or configuration parameters.  The CoAP iPATCH, PATCH, and FETCH
methods enable accessing and updating parts of a resource or multiple
resources with one request.  This document defines new media types
for the CoAP iPATCH, and FETCH methods for resources represented with
the SenML data model.
The Sensor Measurement Lists (SenML) media type and data model can be
used to send collections of resources, such as batches of sensor data
or configuration parameters.  The CoAP iPATCH, PATCH, and FETCH
methods enable accessing and updating parts of a resource or multiple
resources with one request.  This document defines new media types
for the CoAP iPATCH, PATCH, and FETCH methods for resources
represented with the SenML data model.
The CoAP RFC7252 iPATCH and FETCH methods RFC8132 enable accessing
and updating parts of a resource or multiple resources with one
request.
This document defines two new media types, one using the JavaScript
Object Notation (JSON) RFC8259 and one using the Concise Binary
Object Representation (CBOR) RFC7049, that can be used with the CoAP
iPATCH, PATCH, and FETCH methods for resources represented with the
SenML data model.  The semantics of the new media types are the same
for the CoAP PATCH and iPATCH methods.
The CoAP RFC7252 iPATCH, PATCH, and FETCH methods RFC8132 enable
accessing and updating parts of a resource or multiple resources with
one request.
This document defines two new media types, one using the JavaScript
Object Notation (JSON) RFC8259 and one using the Concise Binary
Object Representation (CBOR) RFC7049, that can be used with the CoAP
iPATCH, PATCH, and FETCH methods for resources represented with the
SenML data model.  The semantics of the new media types are the same
for the CoAP PATCH and iPATCH methods.  The rest of the document uses
term "(i)PATCH" when referring to both methods.
The FETCH/iPATCH media types for SenML are modeled as extensions to
the SenML media type to enable re-use of existing SenML parsers and
generators, in particular on constrained devices.  Unless mentioned
otherwise, FETCH and PATCH Packs are constructed with the same rules
and constraints as SenML Packs.  The only difference to SenML media
type is allowing the use of "null" value for removing records with
the iPATCH method.
The FETCH method can be used to select and return parts of one or
more SenML Packs.  The SenML Records are selected by giving the
name(s) of the resources using the SenML "name" and/or "base name"
Fields.
When SenML Records contain also time values, a name may no longer
uniquely identify a single Record.  When no time is given in a Fetch
Record, all SenML Records with the given name are matched.  When time
is given in the Fetch Record, only a SenML Record (if any) with equal
time value and name is matched.
A term that refers to both CoAP "PATCH" and "iPATCH" methods when
there is no difference in this specification in which one is used.
The FETCH/(i)PATCH media types for SenML are modeled as extensions to
the SenML media type to enable re-use of existing SenML parsers and
generators, in particular on constrained devices.  Unless mentioned
otherwise, FETCH and PATCH Packs are constructed with the same rules
and constraints as SenML Packs.
The key difference to the SenML media type is allowing the use of a
"null" value for removing records with the (i)PATCH method.  Also the
Fetch and Patch Records do not have default time or base version when
the fields are omitted.
The FETCH method can be used to select and return a subset of
records, in sequence, of one or more SenML Packs.  The SenML Records
are selected by giving a set of names that, when resolved, match
resolved names in a SenML Pack.  The names for a Fetch Pack are given
using the SenML "name" and/or "base name" Fields.  The names are
resolved by concatenating the base name with the name field as
defined in RFC8428.
When SenML Records contain also time values, a name may no longer
uniquely identify a single Record.  When no time is given in a Fetch
Record, all SenML Records with the given name are matched (i.e.,
unlike with SenML Records, lack of time field in a Fetch Record does
not imply time value zero).  When time is given in the Fetch Record,
only a SenML Record (if any) with equal resolved time value and name
is matched.
The iPATCH method can be used to change the values of SenML Records,
to add new Records, and to remove existing Records.  The names and
times of the Patch Records are given and matched in same way as for
the Fetch Records, except each Patch Record can match at most one
Target Record.  Patch Packs can also include new values and other
SenML Fields for the Records.
When the name in a Patch Record matches with the name in an existing
Record, the time values are compared.  If the time values do not
exist or are equal in both Records, the Target Record is replaced
with the contents of the Patch Record.
The (i)PATCH method can be used to change the values of SenML
Records, to add new Records, and to remove existing Records.  The
names and times of the Patch Records are given and matched in same
way as for the Fetch Records, except each Patch Record can match at
most one Target Record.  Patch Packs can also include new values and
other SenML Fields for the Records.  Application of Patch Packs is
idempotent.
When the name in a Patch Record matches with the name in an existing
Record, the resolved time values are compared.  If the time values
either do not exist in both Records or are equal, the Target Record
is replaced with the contents of the Patch Record.
The security and privacy considerations of SenML apply also with the
FETCH and iPATCH methods.
In FETCH and iPATCH requests, the client can pass arbitrary names to
the target resource for manipulation.  The resource implementer must
take care to only allow access to names that are actually part of (or
accessible through) the target resource.
The security and privacy considerations of SenML apply also with the
FETCH and (i)PATCH methods.
In FETCH and (i)PATCH requests, the client can pass arbitrary names
to the target resource for manipulation.  The resource implementer
must take care to only allow access to names that are actually part
of (or accessible through) the target resource.
Encoding considerations: Must be encoded as using a subset of the
encoding allowed in RFC8259.  See RFC-AAAA for details.  This
simplifies implementation of very simple system and does not impose
any significant limitations as all this data is meant for machine to
machine communications and is not meant to be human readable.
Encoding considerations: Must be encoded as using a subset of the
encoding allowed in RFC8259.  This simplifies implementation of a
very simple system and does not impose any significant limitations as
all this data is meant for machine to machine communications and is
not meant to be human readable.
Encoding considerations: Must be encoded as using RFC7049.  See RFC-
AAAA for details.
Encoding considerations: Must be encoded as using RFC7049.