idnits 2.17.1 draft-ietf-core-interfaces-13.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 (October 22, 2018) is 2012 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 959, but no explicit reference was found in the text == Unused Reference: 'OMA-TS-LWM2M' is defined on line 972, but no explicit reference was found in the text == Outdated reference: A later version (-14) exists of draft-ietf-core-dynlink-06 == Outdated reference: A later version (-28) exists of draft-ietf-core-resource-directory-15 -- 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: April 25, 2019 SmartThings 6 C. Groves 8 J. Zhu 9 Huawei 10 B. Silverajan, Ed. 11 Tampere University of Technology 12 October 22, 2018 14 Reusable Interface Definitions for Constrained RESTful Environments 15 draft-ietf-core-interfaces-13 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 April 25, 2019. 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 . . . . . . . . . . . . . . . . . . . . . . . . 17 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 . . . . . . . . . . . . . . . . . . . . . . . . . 22 105 10.1. Normative References . . . . . . . . . . . . . . . . . . 22 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) . . . . . . . . . . . 24 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 [RFC8428] is a simple data model and representation format for 121 composite and complex structured resources. CoRE Link-Format and 122 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 { "bn": "example.com/s/" }, 491 { "n": "light", "v": 123, "u": "lx" }, 492 { "n": "temp", "v": 27.2, "u": "Cel" }, 493 { "n": "humidity", "v": 80, "u": "%RH" } 494 ] 496 4.3. Linked Batch 498 The Linked Batch interface is an extension of the Batch interface. 499 Contrary to the basic Batch which is a collection statically defined 500 by the origin server, a Linked Batch is dynamically controlled by a 501 client. A Linked Batch resource has no sub-resources. Instead the 502 resources forming the batch are referenced using Web Linking 503 [RFC8288] and the CoRE Link Format [RFC6690]. A request with a POST 504 method and a content format of application/link-format simply appends 505 new resource links to the collection. The links in the payload MUST 506 reference a resource on the origin server with an absolute path. A 507 DELETE request removes the entire collection. All other requests 508 available for a basic Batch are still valid for a Linked Batch. 510 The following example interacts with a Linked Batch /l/ and creates a 511 collection containing /s/light, /s/temp and /s/humidity in 2 steps. 513 Req: POST /l/ (Content-Format: application/link-format) 514 , 515 Res: 2.04 Changed 517 Req: GET /l/ 518 Res: 2.05 Content (application/senml+json) 519 [ 520 { "bn": "example.com/" }, 521 { "n": "/s/light", "v": 123, "u": "lx" }, 522 { "n": "/s/temp", "v": 27.2, "u": "Cel" } 523 ] 525 Req: POST /l/ (Content-Format: application/link-format) 526 527 Res: 2.04 Changed 529 Req: GET /l/ (Accept: application/link-format) 530 Res: 2.05 Content (application/link-format) 531 ,, 533 Req: GET /l/ 534 Res: 2.05 Content (application/senml+json) 535 [ 536 { "bn": "example.com/" }, 537 { "n": "/s/light", "v": 123, "u": "lx" }, 538 { "n": "/s/temp", "v": 27.2, "u": "Cel" }, 539 { "n": "/s/humidity", "v": 80, "u": "%RH" } 540 ] 542 Req: DELETE /l/ 543 Res: 2.02 Deleted 545 4.4. Sensor 547 The Sensor interface allows the value of a sensor resource to be read 548 (GET). The Media type of the resource can be either plain text or 549 SenML. Plain text MAY be used for a single measurement that does not 550 require meta-data. For a measurement with meta-data such as a unit 551 or time stamp, SenML SHOULD be used. A resource with this interface 552 MAY use SenML to return multiple measurements in the same 553 representation, for example a list of recent measurements. 555 The following are examples of Sensor interface requests in both text/ 556 plain and application/senml+json. 558 Req: GET /s/humidity (Accept: text/plain) 559 Res: 2.05 Content (text/plain) 560 80 562 Req: GET /s/humidity (Accept: application/senml+json) 563 Res: 2.05 Content (application/senml+json) 564 [ 565 { "bn": "example.com/s/" }, 566 { "n": "humidity", "v": 80, "u": "%RH" } 567 ] 569 4.5. Parameter 571 The Parameter interface allows configurable parameters and other 572 information to be modeled as a resource. The value of the parameter 573 can be read (GET) or update (PUT). Plain text or SenML Media types 574 MAY be returned from this type of interface. 576 The following example shows request for reading and updating a 577 parameter. 579 Req: GET /d/name 580 Res: 2.05 Content (text/plain) 581 node5 583 Req: PUT /d/name (text/plain) 584 outdoor 585 Res: 2.04 Changed 587 4.6. Read-only Parameter 589 The Read-only Parameter interface allows configuration parameters to 590 be read (GET) but not updated. Plain text or SenML Media types MAY 591 be returned from this type of interface. 593 The following example shows request for reading such a parameter. 595 Req: GET /d/model 596 Res: 2.05 Content (text/plain) 597 SuperNode200 599 4.7. Actuator 601 The Actuator interface is used by resources that model different 602 kinds of actuators (changing its value has an effect on its 603 environment). Examples of actuators include for example LEDs, 604 relays, motor controllers and light dimmers. The current value of 605 the actuator can be read (GET) or the actuator value can be updated 606 (PUT). In addition, this interface allows the use of POST to change 607 the state of an actuator, for example to toggle between its possible 608 values. Plain text or SenML Media types MAY be returned from this 609 type of interface. A resource with this interface MAY use SenML to 610 include multiple measurements in the same representation, for example 611 a list of recent actuator values or a list of values to updated. 613 The following example shows requests for reading, setting and 614 toggling an actuator (turning on a LED). 616 Req: GET /a/1/led 617 Res: 2.05 Content (text/plain) 618 0 620 Req: PUT /a/1/led (text/plain) 621 1 622 Res: 2.04 Changed 624 Req: POST /a/1/led (text/plain) 625 Res: 2.04 Changed 627 Req: GET /a/1/led 628 Res: 2.05 Content (text/plain) 629 0 631 5. Security Considerations 633 An implementation of a client needs to be prepared to deal with 634 responses to a request that differ from what is specified in this 635 document. A server implementing what the client thinks is a resource 636 with one of these interface descriptions could return malformed 637 representations and response codes either by accident or maliciously. 638 A server sending maliciously malformed responses could attempt to 639 take advantage of a poorly implemented client for example to crash 640 the node or perform denial of service. Conversely, a malicious 641 client could attempt to write to arbitrary resources on a poorly 642 implemented server described in a linked batch. 644 6. IANA Considerations 646 This document registers the following CoRE Interface Description 647 (if=) Link Target Attribute Values. 649 6.1. Link List 651 Attribute Value: core.ll 652 Description: The Link List interface is used to retrieve a list of 653 resources on an origin server. 655 Reference: This document. Note to RFC Editor - please insert the 656 appropriate RFC reference. 658 Notes: None 660 6.2. Batch 662 Attribute Value: core.b 664 Description: The Batch interface is used to manipulate a collection 665 of sub-resources at the same time. 667 Reference: This document. Note to RFC Editor - please insert the 668 appropriate RFC reference. 670 Notes: None 672 6.3. Linked Batch 674 Attribute Value: core.lb 676 Description: The Linked Batch interface is an extension of the Batch 677 interface. Contrary to the basic Batch which is a collection 678 statically defined by the origin server, a Linked Batch is 679 dynamically controlled by a client. 681 Reference: This document. Note to RFC Editor - please insert the 682 appropriate RFC reference. 684 Notes: None 686 6.4. Sensor 688 Attribute Value: core.s 690 Description: The Sensor interface allows the value of a sensor 691 resource to be read. 693 Reference: This document. Note to RFC Editor - please insert the 694 appropriate RFC reference. 696 Notes: None 698 6.5. Parameter 700 Attribute Value: core.p 702 Description: The Parameter interface allows configurable parameters 703 and other information to be modeled as a resource. The value of 704 the parameter can be read or update. 706 Reference: This document. Note to RFC Editor - please insert the 707 appropriate RFC reference. 709 Notes: None 711 6.6. Read-only parameter 713 Attribute Value: core.rp 715 Description: The Read-only Parameter interface allows configuration 716 parameters to be read but not updated. 718 Reference: This document. Note to RFC Editor - please insert the 719 appropriate RFC reference. 721 Notes: None 723 6.7. Actuator 725 Attribute Value: core.a 727 Description: The Actuator interface is used by resources that model 728 different kinds of actuators (changing its value has an effect on 729 its environment). Examples of actuators include LEDs, relays, 730 motor controllers and light dimmers. The current value of the 731 actuator can be read or the actuator value can be updated. In 732 addition, this interface allows the use of POST to change the 733 state of an actuator, for example to toggle between its possible 734 values. 736 Reference: This document. Note to RFC Editor - please insert the 737 appropriate RFC reference. 739 Notes: None 741 7. Acknowledgements 743 Acknowledgement is given to colleagues from the SENSEI project who 744 were critical in the initial development of the well-known REST 745 interface concept, to members of the IPSO Alliance where further 746 requirements for interface descriptions have been discussed, and to 747 Szymon Sasin, Cedric Chauvenet, Daniel Gavelle and Carsten Bormann 748 who have provided useful discussion and input to the concepts in this 749 document. Ari Keraenen provided updated SenML examples. Christian 750 Amsuss supplied a comprehensive review of draft -12. 752 8. Contributors 754 Matthieu Vial 755 Schneider-Electric 756 Grenoble 757 France 759 Phone: +33 (0)47657 6522 760 EMail: matthieu.vial@schneider-electric.com 762 9. Changelog 764 Changes from -12 to -13: 766 o SenML examples now use the Base Name (bn) labels from RFC 8428 768 o Security considerations discusses client misuse of linked batches 770 Changes from -11 to -12: 772 o Removed all text referring to function sets/profiles 774 o Clarified list collections 776 o Content-formats for collections and items rectified 778 o Simplified Appendix A and removed Appendix B 780 Changes from -10 to -11: 782 o Added a new Section 3.4 for Link Embedding 784 o Updated examples in Section 3.5 786 o Removed "Service Discovery" from Terminologies 788 o Removed discussion of function sets 790 Changes from -09 to -10: 792 o Section 1: Amendments to remove discussing properties. * 793 o New author and editor added. 795 Changes from -08 to -09: 797 o Section 3.6: Modified to indicate that the entire collection 798 resource is returned. 800 o General: Added editor's note with open issues. 802 Changes from -07 to -08: 804 o Section 3.3: Modified Accepts to Accept header option. 806 o Addressed the editor's note in Section 4.1 to clarify the use of 807 the Accept option. 809 Changes from -06 to -07: 811 o Corrected Figure 1 sub-resource names e.g. tmp to temp and hum to 812 humidity. 814 o Addressed the editor's note in Section 4.2. 816 o Removed section on function sets and profiles as agreed to at the 817 IETF#97. 819 Changes from -05 to -06: 821 o Updated the abstract. 823 o Section 1: Updated introduction. 825 o Section 2: Alphabetised the order 827 o Section 2: Removed the collections definition in favour of the 828 complete definition in the collections section. 830 o Removed section 3 on interfaces in favour of an updated definition 831 in section 1.3. 833 o General: Changed interface type to interface description as that 834 is the term defined in RFC6690. 836 o Removed section on future interfaces. 838 o Section 8: Updated IANA considerations. 840 o Added Appendix A to discuss current state of the art wrt to 841 collections, function sets etc. 843 Changes from -04 to -05: 845 o Removed Link Bindings and Observe attributes. This functionality 846 is now contained in I-D.ietf-core-dynlink. 848 o Hypermedia collections have been removed. This is covered in a 849 new T2TRG draft. 851 o The WADL description has been removed. 853 o Fixed minor typos. 855 o Updated references. 857 Changes from -03 to -04: 859 o Fixed tickets #385 and #386. 861 o Changed abstract and into to better describe content. 863 o Focus on Interface and not function set/profiles in intro. 865 o Changed references from draft-core-observe to RFC7641. 867 o Moved Function sets and Profiles to section after Interfaces. 869 o Moved Observe Attributes to the Link Binding section. 871 o Add a Collection section to describe the collection types. 873 o Add the Hypermedia Collection Interface Description. 875 Changes from -02 to -03: 877 o Added lt and gt to binding format section. 879 o Added pmin and pmax observe parameters to Observation Attributes. 881 o Changed the definition of lt and gt to limit crossing. 883 o Added definitions for getattr and setattr to WADL. 885 o Added getattr and setattr to observable interfaces. 887 o Removed query parameters from Observe definition. 889 o Added observe-cancel definition to WADL and to observable 890 interfaces. 892 Changes from -01 to -02: 894 o Updated the date and version, fixed references. 896 o "Removed pmin and pmax observe parameters "[Ticket #336]"." 898 Changes from -00 to WG Document -01 900 o Improvements to the Function Set section. 902 Changes from -05 to WG Document -00 904 o Updated the date and version. 906 Changes from -04 to -05 908 o Made the Observation control parameters to be treated as resources 909 rather than Observe query parameters. Added Less Than and Greater 910 Than parameters. 912 Changes from -03 to -04 914 o Draft refresh 916 Changes from -02 to -03 918 o Added Bindings 920 o Updated all rt= and if= for the new Link Format IANA rules 922 Changes from -01 to -02 924 o Defined a Function Set and its guidelines. 926 o Added the Link List interface. 928 o Added the Linked Batch interface. 930 o Improved the WADL interface definition. 932 o Added a simple profile example. 934 10. References 936 10.1. Normative References 938 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 939 Requirement Levels", BCP 14, RFC 2119, 940 DOI 10.17487/RFC2119, March 1997, 941 . 943 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 944 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 945 . 947 [RFC8288] Nottingham, M., "Web Linking", RFC 8288, 948 DOI 10.17487/RFC8288, October 2017, 949 . 951 10.2. Informative References 953 [I-D.ietf-core-dynlink] 954 Shelby, Z., Koster, M., Groves, C., Zhu, J., and B. 955 Silverajan, "Dynamic Resource Linking for Constrained 956 RESTful Environments", draft-ietf-core-dynlink-06 (work in 957 progress), July 2018. 959 [I-D.ietf-core-resource-directory] 960 Shelby, Z., Koster, M., Bormann, C., Stok, P., and C. 961 Amsuess, "CoRE Resource Directory", draft-ietf-core- 962 resource-directory-15 (work in progress), October 2018. 964 [OIC-Core] 965 "OIC Resource Type Specification v1.1.0", 2016, 966 . 968 [OIC-SmartHome] 969 "OIC Smart Home Device Specification v1.1.0", 2016, 970 . 972 [OMA-TS-LWM2M] 973 "Lightweight Machine to Machine Technical Specification", 974 2016, . 978 [oneM2MTS0008] 979 "TS 0008 v1.3.2 CoAP Protocol Binding", 2016, 980 . 982 [oneM2MTS0023] 983 "TS 0023 v2.0.0 Home Appliances Information Model and 984 Mapping", 2016, 985 . 987 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 988 Resource Identifier (URI): Generic Syntax", STD 66, 989 RFC 3986, DOI 10.17487/RFC3986, January 2005, 990 . 992 [RFC6573] Amundsen, M., "The Item and Collection Link Relations", 993 RFC 6573, DOI 10.17487/RFC6573, April 2012, 994 . 996 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 997 Protocol (HTTP/1.1): Message Syntax and Routing", 998 RFC 7230, DOI 10.17487/RFC7230, June 2014, 999 . 1001 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 1002 Application Protocol (CoAP)", RFC 7252, 1003 DOI 10.17487/RFC7252, June 2014, 1004 . 1006 [RFC7396] Hoffman, P. and J. Snell, "JSON Merge Patch", RFC 7396, 1007 DOI 10.17487/RFC7396, October 2014, 1008 . 1010 [RFC8428] Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C. 1011 Bormann, "Sensor Measurement Lists (SenML)", RFC 8428, 1012 DOI 10.17487/RFC8428, August 2018, 1013 . 1015 Appendix A. Current Usage of Interfaces 1017 Editor's note: This appendix will be removed. It is only included 1018 for information. 1020 This appendix analyses the current landscape with regards the 1021 definition and use of collections and interfaces. This should be 1022 considered when considering the scope of this document. 1024 A.1. Constrained RESTful Environments (CoRE) Link Format (IETF) 1026 [RFC6690] assumes that different deployments or application domains 1027 will define the appropriate REST Interface Descriptions along with 1028 Resource Types to make discovery meaningful. It highlights that 1029 collections are often used for these interfaces. 1031 Whilst 3.2/[RFC6690] defines a new Interface Description 'if' 1032 attribute the procedures around it are about the naming of the 1033 interface not what information should be included in the 1034 documentation about the interface. 1036 A.2. Open Connectivity Foundation (OCF) 1038 The OIC Core Specification [OIC-Core] most closely aligns with the 1039 work in this specification. It makes use of interface descriptions 1040 as per [RFC6690] and has registered several interface identifiers 1041 (https://www.iana.org/assignments/core-parameters/core- 1042 parameters.xhtml#if-link-target-att-value). These interface 1043 descriptors are similar to those defined in this specification. From 1044 a high level perspective: 1046 links list: OCF (oic.if.ll) -> IETF (core.ll) 1047 Note: it's called "link list" in the IETF. 1048 linked batch: OCF (oic.if.b) -> IETF (core.lb) 1049 read-only: OCF (oic.if.r) -> IETF (core.rp) 1050 read-write: OCF (oic.if.rw) -> IETF (core.p) 1051 actuator: OCF (oic.if.a) -> IETF (core.a) 1052 sensor: OCF (oic.if.s) -> IETF (core.s) 1053 batch: No OCF equivalent -> IETF (core.b) 1055 Some of the OCF interfaces make use of collections. 1057 The OIC Core specification does not use the concept of function sets. 1058 It does however discuss the concept of profiles. The OCF defines two 1059 sets of documents. The core specification documents such as 1060 [OIC-Core] and vertical profile specification documents which provide 1061 specific information for specific applications. The OIC Smart Home 1062 Device Specification [OIC-SmartHome] is one such specification. It 1063 provides information on the resource model, discovery and data types. 1065 Authors' Addresses 1067 Zach Shelby 1068 ARM 1069 Kidekuja 2 1070 Vuokatti 88600 1071 FINLAND 1073 Phone: +358407796297 1074 Email: zach.shelby@arm.com 1075 Michael Koster 1076 SmartThings 1077 665 Clyde Avenue 1078 Mountain View 94043 1079 USA 1081 Email: michael.koster@smartthings.com 1083 Christian Groves 1084 Australia 1086 Email: cngroves.std@gmail.com 1088 Jintao Zhu 1089 Huawei 1090 No.127 Jinye Road, Huawei Base, High-Tech Development District 1091 Xi'an, Shaanxi Province 1092 China 1094 Email: jintao.zhu@huawei.com 1096 Bilhanan Silverajan (editor) 1097 Tampere University of Technology 1098 Korkeakoulunkatu 10 1099 Tampere FI-33720 1100 Finland 1102 Email: bilhanan.silverajan@tut.fi