Draft: draft-ietf-core-senml-etch

Commentary: Patch records must match only one Target record Invalid records result in error No Pack state is changed if any invalid records Also : Noted Fetch response must contain each target only once Updated author info
The SenML time and unit fields can be used in a Fetch Record to
further narrow the selection of matched SenML Records.  When no time
or unit 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 the SenML Records (if any) with equal
resolved time value and name are matched.  Similarly, when unit is
given, only the SenML Records with equal resolved unit and name are
matched.  If both time and unit are given in the Fetch Record, both
MUST to match for the SenML Record to match.
The SenML time and unit fields can be used in a Fetch Record to
further narrow the selection of matched SenML Records.  When no time
or unit 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 the SenML Records (if any) with equal
resolved time value and name are matched.  Similarly, when unit is
given, only the SenML Records with equal resolved unit and name are
matched.  If both time and unit are given in the Fetch Record, both
MUST to match for the SenML Record to match.  Each Target Record MUST
be included in the response only once, even if multiple Fetch Records
match with the same Target Record.
The (i)PATCH method can be used to change the fields of SenML
Records, to add new Records, and to remove existing Records.  The
names, times, and units of the Patch Records are given and matched in
same way as for the Fetch Records, except each Patch Record MUST
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; hence PATCH and iPATCH methods for SenML Packs
are equivalent.
When the name in a Patch Record matches with the name in an existing
Record, the resolved time values and units (if any) are compared.  If
the time values and units either do not exist in both Records or are
equal, the Target Record is replaced with the contents of the Patch
Record.  All Patch Records MUST contain at least a SenML Value or Sum
field.  A Patch Pack with invalid Records MUST be rejected.
The (i)PATCH method can be used to change the fields of SenML
Records, to add new Records, and to remove existing Records.  The
names, times, and units of the Patch Records are given and matched in
same way as for the Fetch Records, except each Patch Record MUST
match at most one Target Record.  A Patch Record matching more than
one Target Record is considered invalid.  Patch Packs can also
include new values and other SenML fields for the Records.
Application of Patch Packs is idempotent; hence PATCH and iPATCH
methods for SenML Packs are equivalent.
When the name in a Patch Record matches with the name in an existing
Record, the resolved time values and units (if any) are compared.  If
the time values and units either do not exist in both Records or are
equal, the Target Record is replaced with the contents of the Patch
Record.  All Patch Records MUST contain at least a SenML Value or Sum
field.
The Patch Records MUST be applied in the same sequence they are in
the Patch Pack.
Implementations MUST reject and generate an error for Patch Packs
with invalid Records.  If a Patch Pack is rejected, the state of the
Target Pack is not changed, i.e., either all or none of the Patch
Records are applied.