idnits 2.17.1 draft-ietf-core-interfaces-12.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([RFC6690]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (June 27, 2018) is 2127 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Unused Reference: 'I-D.ietf-core-resource-directory' is defined on line 946, but no explicit reference was found in the text == Unused Reference: 'OMA-TS-LWM2M' is defined on line 964, but no explicit reference was found in the text == Outdated reference: A later version (-14) exists of draft-ietf-core-dynlink-05 == Outdated reference: A later version (-28) exists of draft-ietf-core-resource-directory-13 -- Obsolete informational reference (is this intentional?): RFC 7230 (Obsoleted by RFC 9110, RFC 9112) Summary: 1 error (**), 0 flaws (~~), 5 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 CoRE Working Group Z. Shelby 3 Internet-Draft ARM 4 Intended status: Informational M. Koster 5 Expires: December 29, 2018 SmartThings 6 C. Groves 8 J. Zhu 9 Huawei 10 B. Silverajan, Ed. 11 Tampere University of Technology 12 June 27, 2018 14 Reusable Interface Definitions for Constrained RESTful Environments 15 draft-ietf-core-interfaces-12 17 Abstract 19 This document defines a set of Constrained RESTful Environments 20 (CoRE) Link Format Interface Descriptions [RFC6690] applicable for 21 use in constrained environments. These include the: Actuator, 22 Parameter, Read-only parameter, Sensor, Batch, Linked Batch and Link 23 List interfaces. 25 The Batch, Linked Batch and Link List interfaces make use of resource 26 collections. This document further describes how collections relate 27 to interfaces. 29 Many applications require a set of interface descriptions in order 30 provide the required functionality. This document defines an 31 Interface Description attribute value to describe resources 32 conforming to a particular interface. 34 Editor's notes: 36 o The git repository for the draft is found at https://github.com/ 37 core-wg/interfaces 39 Status of This Memo 41 This Internet-Draft is submitted in full conformance with the 42 provisions of BCP 78 and BCP 79. 44 Internet-Drafts are working documents of the Internet Engineering 45 Task Force (IETF). Note that other groups may also distribute 46 working documents as Internet-Drafts. The list of current Internet- 47 Drafts is at https://datatracker.ietf.org/drafts/current/. 49 Internet-Drafts are draft documents valid for a maximum of six months 50 and may be updated, replaced, or obsoleted by other documents at any 51 time. It is inappropriate to use Internet-Drafts as reference 52 material or to cite them other than as "work in progress." 54 This Internet-Draft will expire on December 29, 2018. 56 Copyright Notice 58 Copyright (c) 2018 IETF Trust and the persons identified as the 59 document authors. All rights reserved. 61 This document is subject to BCP 78 and the IETF Trust's Legal 62 Provisions Relating to IETF Documents 63 (https://trustee.ietf.org/license-info) in effect on the date of 64 publication of this document. Please review these documents 65 carefully, as they describe your rights and restrictions with respect 66 to this document. Code Components extracted from this document must 67 include Simplified BSD License text as described in Section 4.e of 68 the Trust Legal Provisions and are provided without warranty as 69 described in the Simplified BSD License. 71 Table of Contents 73 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 74 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 75 3. Collections . . . . . . . . . . . . . . . . . . . . . . . . . 4 76 3.1. Introduction to Collections . . . . . . . . . . . . . . . 5 77 3.2. Use Cases for Collections . . . . . . . . . . . . . . . . 5 78 3.3. Collection Types . . . . . . . . . . . . . . . . . . . . 6 79 3.4. Content-Formats for Collections . . . . . . . . . . . . . 6 80 3.5. Link Embedding . . . . . . . . . . . . . . . . . . . . . 7 81 3.6. Links and Items in Collections . . . . . . . . . . . . . 7 82 3.7. Queries on Collections . . . . . . . . . . . . . . . . . 8 83 3.8. Observing Collections . . . . . . . . . . . . . . . . . . 8 84 4. Interface Descriptions . . . . . . . . . . . . . . . . . . . 9 85 4.1. Link List . . . . . . . . . . . . . . . . . . . . . . . . 11 86 4.2. Batch . . . . . . . . . . . . . . . . . . . . . . . . . . 11 87 4.3. Linked Batch . . . . . . . . . . . . . . . . . . . . . . 12 88 4.4. Sensor . . . . . . . . . . . . . . . . . . . . . . . . . 13 89 4.5. Parameter . . . . . . . . . . . . . . . . . . . . . . . . 14 90 4.6. Read-only Parameter . . . . . . . . . . . . . . . . . . . 14 91 4.7. Actuator . . . . . . . . . . . . . . . . . . . . . . . . 14 92 5. Security Considerations . . . . . . . . . . . . . . . . . . . 15 93 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 94 6.1. Link List . . . . . . . . . . . . . . . . . . . . . . . . 15 95 6.2. Batch . . . . . . . . . . . . . . . . . . . . . . . . . . 16 96 6.3. Linked Batch . . . . . . . . . . . . . . . . . . . . . . 16 97 6.4. Sensor . . . . . . . . . . . . . . . . . . . . . . . . . 16 98 6.5. Parameter . . . . . . . . . . . . . . . . . . . . . . . . 16 99 6.6. Read-only parameter . . . . . . . . . . . . . . . . . . . 17 100 6.7. Actuator . . . . . . . . . . . . . . . . . . . . . . . . 17 101 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 17 102 8. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 18 103 9. Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . 18 104 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 21 105 10.1. Normative References . . . . . . . . . . . . . . . . . . 21 106 10.2. Informative References . . . . . . . . . . . . . . . . . 22 107 Appendix A. Current Usage of Interfaces . . . . . . . . . . . . 23 108 A.1. Constrained RESTful Environments (CoRE) Link Format 109 (IETF) . . . . . . . . . . . . . . . . . . . . . . . . . 23 110 A.2. Open Connectivity Foundation (OCF) . . . . . . . . . . . 23 111 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24 113 1. Introduction 115 IETF Standards for machine to machine communication in constrained 116 environments describe a REST protocol and a set of related 117 information standards that may be used to represent machine data and 118 machine metadata in REST interfaces. CoRE Link-format is a standard 119 for doing Web Linking [RFC8288] in constrained environments. SenML 120 [I-D.ietf-core-senml] is a simple data model and representation 121 format for composite and complex structured resources. CoRE Link- 122 Format and SenML can be used by CoAP [RFC7252] or HTTP servers. 124 The discovery of resources offered by a constrained server is very 125 important in machine-to-machine applications where there are no 126 humans in the loop. Machine application clients must be able to 127 adapt to different resource organizations without advance knowledge 128 of the specific data structures hosted by each connected thing. The 129 use of Web Linking for the description and discovery of resources 130 hosted by constrained origin servers is specified by CoRE Link Format 131 [RFC6690]. CoRE Link Format additionally defines a link attribute 132 for interface description ("if") that can be used to describe the 133 REST interface of a resource, and may include a link to a description 134 document. 136 This document defines a set of Link Format interface descriptions for 137 some common design patterns that enable the server side composition 138 and organization, and client side discovery and consumption, of 139 machine resources using Web Linking. A client discovering the "if" 140 link attribute will be able to consume resources based on its 141 knowledge of the expected interface types. In this sense the 142 Interface Type acts in a similar way as a Content-Format, but as a 143 selector for a high level functional abstraction. 145 An interface description describes a resource in terms of its 146 associated content formats, data types, URI templates, REST methods, 147 parameters, and responses. Basic interface descriptions are defined 148 for sensors, and actuators. 150 A set of collection types is defined for organizing resources for 151 discovery, and for various forms of bulk interaction with resource 152 sets using typed embedding links. 154 This document first defines the concept of collection interface 155 descriptions. It then defines a number of generic interface 156 descriptions that may be used in contrained environments. Several of 157 these interface descriptions utilise collections. 159 Whilst this document assumes the use of CoAP [RFC7252], the REST 160 interfaces described can also be realized using HTTP [RFC7230]. 162 2. Terminology 164 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 165 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 166 "OPTIONAL" in this document are to be interpreted as described in 167 [RFC2119]. 169 This document requires readers to be familiar with all the terms and 170 concepts that are discussed in [RFC8288] and [RFC6690]. This 171 document makes use of the following additional terminology: 173 Gradual Reveal: A REST design where resources are discovered 174 progressively using Web Linking. 176 Interface Description: The Interface Description describes the 177 generic REST interface to interact with a resource or a set of 178 resources. Its use is described via the Interface Description 179 'if' attribute which is an opaque string used to provide a name or 180 URI indicating a specific interface definition used to interact 181 with the target resource. One can think of this as describing 182 verbs usable on a resource. 184 Resource Discovery: The process allowing a client to identify 185 resources being hosted on an origin server. 187 3. Collections 188 3.1. Introduction to Collections 190 A Collection is a resource which represents one or more related 191 resources. [RFC6573] describes the "item" and "collection" Link 192 Relation. An "item" link relation identifies a member of collection. 193 A "collection" indicates the collection that an item is a member of. 194 For example, a collection might be a resource representing a catalog 195 of products, while an item is a resource related to an individual 196 product. 198 Section 1.2.2/[RFC6690] also describes resource collections. 200 This document uses the concept of "collection" and applies it to 201 interface descriptions. A collection interface description consists 202 of a set of links and a set of items pointed to by the links which 203 may be sub-resources of the collection resource. The collection 204 interface descriptions described in this document are Link List, 205 Batch and Linked Batch. 207 The links in a collection are represented in CoRE Link-Format 208 Content-Formats including JSON and CBOR variants, and the items in 209 the collection may be represented by SenML, including JSON and CBOR 210 variants. In general, a collection may support items of any 211 available Content-Format. 213 A particular resource item may be a member of more than one 214 collection at a time by being linked to, but may only be a 215 subresource of one collection. 217 Some collections may have pre-configured items and links, and some 218 collections may support dynamic creation and removal of items and 219 links. Likewise, modification of items in some collections may be 220 permitted, and not in others. 222 Links in collections may be selected for processing by a particular 223 request by using Query Filtering as described in CoRE Link-Format 224 [RFC6690]. 226 3.2. Use Cases for Collections 228 Collections may be used to provide gradual reveal of resources on an 229 endpoint. There may be a small set of links at the .well-known/core 230 location, which may in turn point to other collections of resources 231 that represent device information, device configuration, device 232 management, and various functional clusters of resources on the 233 device. 235 A collection may be used to group a set of like resources for bulk 236 state update or actuation. For example, the brightness control 237 resources of a number of luminaries may be grouped by linking to them 238 in a collection. The collection type may support receiving a single 239 update from a client and sending that update to each resource item in 240 the collection. 242 Items may be sub-resources of the collection resource. This enables 243 updates to multiple items in the collection to be processed together 244 within the context of the collection resource. 246 3.3. Collection Types 248 There are three collection types defined in this document: 250 +-----------------+---------+ 251 | Collection Type | if= | 252 +-----------------+---------+ 253 | Link List | core.ll | 254 | | | 255 | Batch | core.b | 256 | | | 257 | Linked Batch | core.lb | 258 +-----------------+---------+ 260 Table 1: Collection Type Summary 262 The interface description defined in this document offer a deeper 263 explanation of the methods that may be applied to the three 264 collections. 266 3.4. Content-Formats for Collections 268 The collection interfaces can use the CoRE Link-Format for the link 269 representations and SenML or text/plain for representations of items. 270 The examples given are for collections that expose resources and 271 links in these formats. 273 The choice of whether to return a representation of the links or of 274 the items or of the collection format is determined by the Accept 275 header option in the request. Likewise, the choice of updating link 276 metadata or item data or the collection resource itself is determined 277 by the Content-Format option in the header of the update request 278 operation. 280 The default Content-Formats for collection types described in this 281 document are: 283 Links: application/link-format, application/link-format+json 285 Items: application/senml+json, text/plain 287 3.5. Link Embedding 289 Collections may provide resource encapsulation by supporting link 290 embedding. Link embedding may be used to provide a single resource 291 with which a client may interact to obtain a set of related resource 292 values. This is analogous to an image tag (link) causing the image 293 to display inline in a browser window. Link embedding enables the 294 bulk processing of items in the collection using a single operation 295 targeting the collection resource. Performing a GET on a collection 296 resource may return a single representation containing all of the 297 embedded linked resources. For example, a collection for 298 manufacturer parameters may consist of manufacturer name, date of 299 manufacture, location of manufacture, and serial number resources 300 which can be read as a single SenML data object. 302 A subset of resources in the collection may be selected for operation 303 using Query Filtering. Bulk Read operations using GET return a SenML 304 representation of all selected resources. Bulk item Update 305 operations using PUT or POST apply the payload document to all 306 selected resource items in the collection. A Batch update is 307 performed by applying the resource values in the payload document to 308 all resources in the collection that match any resource name in the 309 payload document. 311 3.6. Links and Items in Collections 313 Links use CoRE Link-Format representation by default and may point to 314 any resource reachable from the context of the collection. This 315 includes links to resources with absolute paths as well as links that 316 point to other network locations, if the context of the collection 317 allows. Links to sub-resources in the collection MUST have a path- 318 element starting with the resource name, as per [RFC3986]. Links to 319 resources in the global context MUST start with a root path 320 identifier [RFC8288]. Links to other collections are formed per 321 [RFC3986]. 323 Examples of links: 325 ;if="core.lb": Link to the /sen/ collection describing it as 326 a core.lb type collection (Linked Batch) 328 ;rt="temperature": A link to the temp resource with an 329 absolute path. 331 ;rt="temperature": Link to the temp subresource of the 332 collection in which this link appears. 334 ;anchor="/sen/": A link to the temp subresource of the 335 collection /sen/ which is assumed not to be a subresource of the 336 collection in which the link appears, but is expected to be 337 identified in the collection by resource name. 339 Links in the collection MAY be Read, Updated, Added, or Removed using 340 the CoRE Link-Format or JSON Merge-Patch Content-Formats on the 341 collection resource. Reading links uses the GET method and returns 342 an array or list containing the link-values of all selected links. 343 Links may be added to the collection using POST or PATCH methods. 344 Updates to links MUST use the PATCH method and MAY use query 345 filtering to select links for updating. The PATCH method on links 346 MUST use the JSON Merge-Patch Content-Format (application/merge- 347 patch+json) specified in [RFC7396]. 349 Items in the collection SHOULD be represented using the SenML 350 (application/senml+json) or plain text (text/plain) Content-Formats, 351 depending on whether the representation is of a single data point or 352 multiple data points. Items MAY be represented using any supported 353 Content-Format. 355 3.7. Queries on Collections 357 Collections MAY support query filtering as defined in CoRE Link- 358 Format [RFC6690]. Operations targeting either the links or the items 359 MAY select a subset of links and items in the collection by using 360 query filtering. The Content-Format specified in the request header 361 selects whether links or items are targeted by the operation. 363 3.8. Observing Collections 365 Resource Observation via [I-D.ietf-core-dynlink] using CoAP [RFC7252] 366 MAY be supported on items in a collection. A subset of the 367 conditional observe parameters MAY be specified to apply. In most 368 cases pmin and pmax are useful. Resource observation on a 369 collection's resource returns the collection representation. 370 Observation Responses, or notifications, SHOULD provide the 371 collection representations in SenML Content-Format. Notifications 372 MAY include multiple observations of the collection resource, with 373 SenML time stamps indicating the observation times. 375 4. Interface Descriptions 377 This section defines REST interfaces for Sensor, Parameter, Read-Only 378 Paramter and Actuator resource types, in addition to the Link List, 379 Batch and Linked Batch collection types. Each type is described 380 along with its Interface Description attribute value, valid methods 381 and content formats. These are shown for each interface in the table 382 below. 384 The if= column defines the Interface Description (if=) attribute 385 value to be used in the CoRE Link Format for a resource conforming to 386 that interface. When this value appears in the if= attribute of a 387 link, the resource MUST support the corresponding REST interface 388 described in this section. The resource MAY support additional 389 functionality, which is out of scope for this document. Although 390 these interface descriptions are intended to be used with the CoRE 391 Link Format, they are applicable for use in any REST interface 392 definition. 394 The Methods column defines the methods supported by that interface, 395 which are described in more detail below. 397 +--------------+---------+-----------------+--------------------+ 398 | Interface | if= | Methods | Content-Formats | 399 +--------------+---------+-----------------+--------------------+ 400 | Link List | core.ll | GET | link-format | 401 | | | | | 402 | Batch | core.b | GET, PUT, POST | senml | 403 | | | | | 404 | Linked Batch | core.lb | GET, PUT, POST, | link-format, senml | 405 | | | | | 406 | | | DELETE | | 407 | | | | | 408 | Sensor | core.s | GET | senml, | 409 | | | | | 410 | | | | text/plain | 411 | | | | | 412 | Parameter | core.p | GET, PUT | senml, | 413 | | | | | 414 | | | | text/plain | 415 | | | | | 416 | Read-only | core.rp | GET | senml, | 417 | | | | | 418 | Parameter | | | text/plain | 419 | | | | | 420 | Actuator | core.a | GET, PUT, POST | senml, | 421 | | | | | 422 | | | | text/plain | 423 +--------------+---------+-----------------+--------------------+ 425 Table 2: Interface Description Summary 427 The following is an example of links in the CoRE Link Format using 428 these interface descriptions. 430 Req: GET /.well-known/core 431 Res: 2.05 Content (application/link-format) 432 ;rt="simple.sen";if="core.b", 433 ;rt="simple.sen.lt";if="core.s", 434 ;rt="simple.sen.tmp";if="core.s";obs, 435 ;rt="simple.sen.hum";if="core.s", 436 ;rt="simple.act";if="core.b", 437 ;rt="simple.act.led";if="core.a", 438 ;rt="simple.act.led";if="core.a", 439 ;rt="simple.dev";if="core.ll", 440 ;if="core.lb" 442 Figure 1: Binding Interface Example 444 4.1. Link List 446 Link List is the base interface to provide gradual reveal of 447 resources on a CoRE origin server. It is used to retrieve (GET) a 448 list of resources on an origin server. The GET request SHOULD 449 contain an Accept option with the application/link-format content 450 format. However if the resource does not support any other form of 451 content-format the Accept option MAY be elided. 453 Note: The use of an Accept option with application/link-format is 454 recommended even though it is not strictly needed for the Link List 455 interface because this interface is extended by the batch and linked 456 batch interfaces where different content-formats are possible. 458 The request returns a list of URI references with absolute paths to 459 the resources as defined in CoRE Link Format. This interface is 460 typically used with a parent resource to enumerate sub-resources but 461 may be used to reference any resource on an origin server. 463 The following example interacts with a Link List /d containing 464 Parameter sub-resources /d/name, /d/model. 466 Req: GET /d/ (Accept:application/link-format) 467 Res: 2.05 Content (application/link-format) 468 ;rt="simple.dev.n";if="core.p", 469 ;rt="simple.dev.mdl";if="core.rp" 471 4.2. Batch 473 The Batch interface is used to manipulate a collection of sub- 474 resources at the same time. The Batch interface description supports 475 the same methods as its sub-resources, and can be used to read (GET), 476 update (PUT) or apply (POST) the values of those sub-resource with a 477 single resource representation. The sub-resources of a Batch MAY be 478 heterogeneous. Hence, a method used on the Batch only applies to 479 sub-resources that support it. For example Sensor interfaces do not 480 support PUT, and thus a PUT request to a Sensor member of that Batch 481 would be ignored. A batch requires the use of SenML Media types in 482 order to support multiple sub-resources. 484 The following example interacts with a Batch /s/ with Sensor sub- 485 resources /s/light, /s/temp and /s/humidity. 487 Req: GET /s/ 488 Res: 2.05 Content (application/senml+json) 489 [ 490 { "n": "light", "v": 123, "u": "lx" }, 491 { "n": "temp", "v": 27.2, "u": "Cel" }, 492 { "n": "humidity", "v": 80, "u": "%RH" } 493 ] 495 4.3. Linked Batch 497 The Linked Batch interface is an extension of the Batch interface. 498 Contrary to the basic Batch which is a collection statically defined 499 by the origin server, a Linked Batch is dynamically controlled by a 500 client. A Linked Batch resource has no sub-resources. Instead the 501 resources forming the batch are referenced using Web Linking 502 [RFC8288] and the CoRE Link Format [RFC6690]. A request with a POST 503 method and a content format of application/link-format simply appends 504 new resource links to the collection. The links in the payload MUST 505 reference a resource on the origin server with an absolute path. A 506 DELETE request removes the entire collection. All other requests 507 available for a basic Batch are still valid for a Linked Batch. 509 The following example interacts with a Linked Batch /l/ and creates a 510 collection containing /s/light, /s/temp and /s/humidity in 2 steps. 512 Req: POST /l/ (Content-Format: application/link-format) 513 , 514 Res: 2.04 Changed 516 Req: GET /l/ 517 Res: 2.05 Content (application/senml+json) 518 [ 519 { "n": "/s/light", "v": 123, "u": "lx" }, 520 { "n": "/s/temp", "v": 27.2, "u": "Cel" } 521 ] 523 Req: POST /l/ (Content-Format: application/link-format) 524 525 Res: 2.04 Changed 527 Req: GET /l/ (Accept: application/link-format) 528 Res: 2.05 Content (application/link-format) 529 ,, 531 Req: GET /l/ 532 Res: 2.05 Content (application/senml+json) 533 [ 534 { "n": "/s/light", "v": 123, "u": "lx" }, 535 { "n": "/s/temp", "v": 27.2, "u": "Cel" }, 536 { "n": "/s/humidity", "v": 80, "u": "%RH" } 537 ] 539 Req: DELETE /l/ 540 Res: 2.02 Deleted 542 4.4. Sensor 544 The Sensor interface allows the value of a sensor resource to be read 545 (GET). The Media type of the resource can be either plain text or 546 SenML. Plain text MAY be used for a single measurement that does not 547 require meta-data. For a measurement with meta-data such as a unit 548 or time stamp, SenML SHOULD be used. A resource with this interface 549 MAY use SenML to return multiple measurements in the same 550 representation, for example a list of recent measurements. 552 The following are examples of Sensor interface requests in both text/ 553 plain and application/senml+json. 555 Req: GET /s/humidity (Accept: text/plain) 556 Res: 2.05 Content (text/plain) 557 80 559 Req: GET /s/humidity (Accept: application/senml+json) 560 Res: 2.05 Content (application/senml+json) 561 [ 562 { "n": "humidity", "v": 80, "u": "%RH" } 563 ] 565 4.5. Parameter 567 The Parameter interface allows configurable parameters and other 568 information to be modeled as a resource. The value of the parameter 569 can be read (GET) or update (PUT). Plain text or SenML Media types 570 MAY be returned from this type of interface. 572 The following example shows request for reading and updating a 573 parameter. 575 Req: GET /d/name 576 Res: 2.05 Content (text/plain) 577 node5 579 Req: PUT /d/name (text/plain) 580 outdoor 581 Res: 2.04 Changed 583 4.6. Read-only Parameter 585 The Read-only Parameter interface allows configuration parameters to 586 be read (GET) but not updated. Plain text or SenML Media types MAY 587 be returned from this type of interface. 589 The following example shows request for reading such a parameter. 591 Req: GET /d/model 592 Res: 2.05 Content (text/plain) 593 SuperNode200 595 4.7. Actuator 597 The Actuator interface is used by resources that model different 598 kinds of actuators (changing its value has an effect on its 599 environment). Examples of actuators include for example LEDs, 600 relays, motor controllers and light dimmers. The current value of 601 the actuator can be read (GET) or the actuator value can be updated 602 (PUT). In addition, this interface allows the use of POST to change 603 the state of an actuator, for example to toggle between its possible 604 values. Plain text or SenML Media types MAY be returned from this 605 type of interface. A resource with this interface MAY use SenML to 606 include multiple measurements in the same representation, for example 607 a list of recent actuator values or a list of values to updated. 609 The following example shows requests for reading, setting and 610 toggling an actuator (turning on a LED). 612 Req: GET /a/1/led 613 Res: 2.05 Content (text/plain) 614 0 616 Req: PUT /a/1/led (text/plain) 617 1 618 Res: 2.04 Changed 620 Req: POST /a/1/led (text/plain) 621 Res: 2.04 Changed 623 Req: GET /a/1/led 624 Res: 2.05 Content (text/plain) 625 0 627 5. Security Considerations 629 An implementation of a client needs to be prepared to deal with 630 responses to a request that differ from what is specified in this 631 document. A server implementing what the client thinks is a resource 632 with one of these interface descriptions could return malformed 633 representations and response codes either by accident or maliciously. 634 A server sending maliciously malformed responses could attempt to 635 take advantage of a poorly implemented client for example to crash 636 the node or perform denial of service. 638 6. IANA Considerations 640 This document registers the following CoRE Interface Description 641 (if=) Link Target Attribute Values. 643 6.1. Link List 645 Attribute Value: core.ll 647 Description: The Link List interface is used to retrieve a list of 648 resources on an origin server. 650 Reference: This document. Note to RFC Editor - please insert the 651 appropriate RFC reference. 653 Notes: None 655 6.2. Batch 657 Attribute Value: core.b 659 Description: The Batch interface is used to manipulate a collection 660 of sub-resources at the same time. 662 Reference: This document. Note to RFC Editor - please insert the 663 appropriate RFC reference. 665 Notes: None 667 6.3. Linked Batch 669 Attribute Value: core.lb 671 Description: The Linked Batch interface is an extension of the Batch 672 interface. Contrary to the basic Batch which is a collection 673 statically defined by the origin server, a Linked Batch is 674 dynamically controlled by a client. 676 Reference: This document. Note to RFC Editor - please insert the 677 appropriate RFC reference. 679 Notes: None 681 6.4. Sensor 683 Attribute Value: core.s 685 Description: The Sensor interface allows the value of a sensor 686 resource to be read. 688 Reference: This document. Note to RFC Editor - please insert the 689 appropriate RFC reference. 691 Notes: None 693 6.5. Parameter 695 Attribute Value: core.p 696 Description: The Parameter interface allows configurable parameters 697 and other information to be modeled as a resource. The value of 698 the parameter can be read or update. 700 Reference: This document. Note to RFC Editor - please insert the 701 appropriate RFC reference. 703 Notes: None 705 6.6. Read-only parameter 707 Attribute Value: core.rp 709 Description: The Read-only Parameter interface allows configuration 710 parameters to be read but not updated. 712 Reference: This document. Note to RFC Editor - please insert the 713 appropriate RFC reference. 715 Notes: None 717 6.7. Actuator 719 Attribute Value: core.a 721 Description: The Actuator interface is used by resources that model 722 different kinds of actuators (changing its value has an effect on 723 its environment). Examples of actuators include LEDs, relays, 724 motor controllers and light dimmers. The current value of the 725 actuator can be read or the actuator value can be updated. In 726 addition, this interface allows the use of POST to change the 727 state of an actuator, for example to toggle between its possible 728 values. 730 Reference: This document. Note to RFC Editor - please insert the 731 appropriate RFC reference. 733 Notes: None 735 7. Acknowledgements 737 Acknowledgement is given to colleagues from the SENSEI project who 738 were critical in the initial development of the well-known REST 739 interface concept, to members of the IPSO Alliance where further 740 requirements for interface descriptions have been discussed, and to 741 Szymon Sasin, Cedric Chauvenet, Daniel Gavelle and Carsten Bormann 742 who have provided useful discussion and input to the concepts in this 743 document. Ari Keraenen provided updated SenML examples. 745 8. Contributors 747 Matthieu Vial 748 Schneider-Electric 749 Grenoble 750 France 752 Phone: +33 (0)47657 6522 753 EMail: matthieu.vial@schneider-electric.com 755 9. Changelog 757 Changes from -11 to -12: 759 o Removed all text referring to function sets/profiles 761 o Clarified list collections 763 o Content-formats for collections and items rectified 765 o Simplified Appendix A and removed Appendix B 767 Changes from -10 to -11: 769 o Added a new Section 3.4 for Link Embedding 771 o Updated examples in Section 3.5 773 o Removed "Service Discovery" from Terminologies 775 o Removed discussion of function sets 777 Changes from -09 to -10: 779 o Section 1: Amendments to remove discussing properties. * 781 o New author and editor added. 783 Changes from -08 to -09: 785 o Section 3.6: Modified to indicate that the entire collection 786 resource is returned. 788 o General: Added editor's note with open issues. 790 Changes from -07 to -08: 792 o Section 3.3: Modified Accepts to Accept header option. 794 o Addressed the editor's note in Section 4.1 to clarify the use of 795 the Accept option. 797 Changes from -06 to -07: 799 o Corrected Figure 1 sub-resource names e.g. tmp to temp and hum to 800 humidity. 802 o Addressed the editor's note in Section 4.2. 804 o Removed section on function sets and profiles as agreed to at the 805 IETF#97. 807 Changes from -05 to -06: 809 o Updated the abstract. 811 o Section 1: Updated introduction. 813 o Section 2: Alphabetised the order 815 o Section 2: Removed the collections definition in favour of the 816 complete definition in the collections section. 818 o Removed section 3 on interfaces in favour of an updated definition 819 in section 1.3. 821 o General: Changed interface type to interface description as that 822 is the term defined in RFC6690. 824 o Removed section on future interfaces. 826 o Section 8: Updated IANA considerations. 828 o Added Appendix A to discuss current state of the art wrt to 829 collections, function sets etc. 831 Changes from -04 to -05: 833 o Removed Link Bindings and Observe attributes. This functionality 834 is now contained in I-D.ietf-core-dynlink. 836 o Hypermedia collections have been removed. This is covered in a 837 new T2TRG draft. 839 o The WADL description has been removed. 841 o Fixed minor typos. 843 o Updated references. 845 Changes from -03 to -04: 847 o Fixed tickets #385 and #386. 849 o Changed abstract and into to better describe content. 851 o Focus on Interface and not function set/profiles in intro. 853 o Changed references from draft-core-observe to RFC7641. 855 o Moved Function sets and Profiles to section after Interfaces. 857 o Moved Observe Attributes to the Link Binding section. 859 o Add a Collection section to describe the collection types. 861 o Add the Hypermedia Collection Interface Description. 863 Changes from -02 to -03: 865 o Added lt and gt to binding format section. 867 o Added pmin and pmax observe parameters to Observation Attributes. 869 o Changed the definition of lt and gt to limit crossing. 871 o Added definitions for getattr and setattr to WADL. 873 o Added getattr and setattr to observable interfaces. 875 o Removed query parameters from Observe definition. 877 o Added observe-cancel definition to WADL and to observable 878 interfaces. 880 Changes from -01 to -02: 882 o Updated the date and version, fixed references. 884 o "Removed pmin and pmax observe parameters "[Ticket #336]"." 886 Changes from -00 to WG Document -01 888 o Improvements to the Function Set section. 890 Changes from -05 to WG Document -00 891 o Updated the date and version. 893 Changes from -04 to -05 895 o Made the Observation control parameters to be treated as resources 896 rather than Observe query parameters. Added Less Than and Greater 897 Than parameters. 899 Changes from -03 to -04 901 o Draft refresh 903 Changes from -02 to -03 905 o Added Bindings 907 o Updated all rt= and if= for the new Link Format IANA rules 909 Changes from -01 to -02 911 o Defined a Function Set and its guidelines. 913 o Added the Link List interface. 915 o Added the Linked Batch interface. 917 o Improved the WADL interface definition. 919 o Added a simple profile example. 921 10. References 923 10.1. Normative References 925 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 926 Requirement Levels", BCP 14, RFC 2119, 927 DOI 10.17487/RFC2119, March 1997, 928 . 930 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 931 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 932 . 934 [RFC8288] Nottingham, M., "Web Linking", RFC 8288, 935 DOI 10.17487/RFC8288, October 2017, 936 . 938 10.2. Informative References 940 [I-D.ietf-core-dynlink] 941 Shelby, Z., Vial, M., Koster, M., Groves, C., Zhu, J., and 942 B. Silverajan, "Dynamic Resource Linking for Constrained 943 RESTful Environments", draft-ietf-core-dynlink-05 (work in 944 progress), March 2018. 946 [I-D.ietf-core-resource-directory] 947 Shelby, Z., Koster, M., Bormann, C., Stok, P., and C. 948 Amsuess, "CoRE Resource Directory", draft-ietf-core- 949 resource-directory-13 (work in progress), March 2018. 951 [I-D.ietf-core-senml] 952 Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C. 953 Bormann, "Sensor Measurement Lists (SenML)", draft-ietf- 954 core-senml-16 (work in progress), May 2018. 956 [OIC-Core] 957 "OIC Resource Type Specification v1.1.0", 2016, 958 . 960 [OIC-SmartHome] 961 "OIC Smart Home Device Specification v1.1.0", 2016, 962 . 964 [OMA-TS-LWM2M] 965 "Lightweight Machine to Machine Technical Specification", 966 2016, . 970 [oneM2MTS0008] 971 "TS 0008 v1.3.2 CoAP Protocol Binding", 2016, 972 . 974 [oneM2MTS0023] 975 "TS 0023 v2.0.0 Home Appliances Information Model and 976 Mapping", 2016, 977 . 979 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 980 Resource Identifier (URI): Generic Syntax", STD 66, 981 RFC 3986, DOI 10.17487/RFC3986, January 2005, 982 . 984 [RFC6573] Amundsen, M., "The Item and Collection Link Relations", 985 RFC 6573, DOI 10.17487/RFC6573, April 2012, 986 . 988 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 989 Protocol (HTTP/1.1): Message Syntax and Routing", 990 RFC 7230, DOI 10.17487/RFC7230, June 2014, 991 . 993 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 994 Application Protocol (CoAP)", RFC 7252, 995 DOI 10.17487/RFC7252, June 2014, 996 . 998 [RFC7396] Hoffman, P. and J. Snell, "JSON Merge Patch", RFC 7396, 999 DOI 10.17487/RFC7396, October 2014, 1000 . 1002 Appendix A. Current Usage of Interfaces 1004 Editor's note: This appendix will be removed. It is only included 1005 for information. 1007 This appendix analyses the current landscape with regards the 1008 definition and use of collections and interfaces. This should be 1009 considered when considering the scope of this document. 1011 A.1. Constrained RESTful Environments (CoRE) Link Format (IETF) 1013 [RFC6690] assumes that different deployments or application domains 1014 will define the appropriate REST Interface Descriptions along with 1015 Resource Types to make discovery meaningful. It highlights that 1016 collections are often used for these interfaces. 1018 Whilst 3.2/[RFC6690] defines a new Interface Description 'if' 1019 attribute the procedures around it are about the naming of the 1020 interface not what information should be included in the 1021 documentation about the interface. 1023 A.2. Open Connectivity Foundation (OCF) 1025 The OIC Core Specification [OIC-Core] most closely aligns with the 1026 work in this specification. It makes use of interface descriptions 1027 as per [RFC6690] and has registered several interface identifiers 1028 (https://www.iana.org/assignments/core-parameters/core- 1029 parameters.xhtml#if-link-target-att-value). These interface 1030 descriptors are similar to those defined in this specification. From 1031 a high level perspective: 1033 links list: OCF (oic.if.ll) -> IETF (core.ll) 1034 Note: it's called "link list" in the IETF. 1035 linked batch: OCF (oic.if.b) -> IETF (core.lb) 1036 read-only: OCF (oic.if.r) -> IETF (core.rp) 1037 read-write: OCF (oic.if.rw) -> IETF (core.p) 1038 actuator: OCF (oic.if.a) -> IETF (core.a) 1039 sensor: OCF (oic.if.s) -> IETF (core.s) 1040 batch: No OCF equivalent -> IETF (core.b) 1042 Some of the OCF interfaces make use of collections. 1044 The OIC Core specification does not use the concept of function sets. 1045 It does however discuss the concept of profiles. The OCF defines two 1046 sets of documents. The core specification documents such as 1047 [OIC-Core] and vertical profile specification documents which provide 1048 specific information for specific applications. The OIC Smart Home 1049 Device Specification [OIC-SmartHome] is one such specification. It 1050 provides information on the resource model, discovery and data types. 1052 Authors' Addresses 1054 Zach Shelby 1055 ARM 1056 Kidekuja 2 1057 Vuokatti 88600 1058 FINLAND 1060 Phone: +358407796297 1061 Email: zach.shelby@arm.com 1063 Michael Koster 1064 SmartThings 1065 665 Clyde Avenue 1066 Mountain View 94043 1067 USA 1069 Email: michael.koster@smartthings.com 1071 Christian Groves 1072 Australia 1074 Email: cngroves.std@gmail.com 1075 Jintao Zhu 1076 Huawei 1077 No.127 Jinye Road, Huawei Base, High-Tech Development District 1078 Xi'an, Shaanxi Province 1079 China 1081 Email: jintao.zhu@huawei.com 1083 Bilhanan Silverajan (editor) 1084 Tampere University of Technology 1085 Korkeakoulunkatu 10 1086 Tampere FI-33720 1087 Finland 1089 Email: bilhanan.silverajan@tut.fi