<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.0.36 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>

<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>

<rfc ipr="trust200902" docName="draft-ietf-core-interfaces-06" category="info">

  <front>
    <title abbrev="Interface Definitions for CoRE">Reusable Interface Definitions for Constrained RESTful Environments</title>

    <author initials="Z." surname="Shelby" fullname="Zach Shelby">
      <organization>ARM</organization>
      <address>
        <postal>
          <street>150 Rose Orchard</street>
          <city>San Jose</city>
          <code>95134</code>
          <country>FINLAND</country>
        </postal>
        <phone>+1-408-203-9434</phone>
        <email>zach.shelby@arm.com</email>
      </address>
    </author>
    <author initials="Z.V." surname="Vial" fullname="Matthieu Vial">
      <organization>Schneider-Electric</organization>
      <address>
        <postal>
          <street></street>
          <city>Grenoble</city>
          <code></code>
          <country>FRANCE</country>
        </postal>
        <phone>+33 (0)47657 6522</phone>
        <email>matthieu.vial@schneider-electric.com</email>
      </address>
    </author>
    <author initials="M." surname="Koster" fullname="Michael Koster">
      <organization>SmartThings</organization>
      <address>
        <postal>
          <street>665 Clyde Avenue</street>
          <city>Mountain View</city>
          <code>94043</code>
          <country>USA</country>
        </postal>
        <email>michael.koster@smartthings.com</email>
      </address>
    </author>
    <author initials="C." surname="Groves" fullname="Christian Groves">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street></street>
          <city></city>
          <code></code>
          <country>Australia</country>
        </postal>
        <email>Christian.Groves@nteczone.com</email>
      </address>
    </author>

    <date year="2016" month="October" day="28"/>

    <area>art</area>
    <workgroup>CoRE Working Group</workgroup>
    <keyword>Internet-Draft</keyword> <keyword>CoRE</keyword> <keyword>CoAP</keyword> <keyword>Hypermedia</keyword> <keyword>Web Linking</keyword> <keyword>Resource Discovery</keyword>

    <abstract>


<t>This document defines a set of Constrained RESTful Environments (CoRE) Link Format Interface Descriptions <xref target="RFC6690"/> applicable for use in constrained environments. These include the: Actuator, Paramter, Read-only parameter, Sensor, Batch, Linked Batch and Link List interfaces.</t>

<t>The Batch, Linked Batch and Link List interfaces make use of resource collections. This document further describes how collections relate to interfaces.</t>

<t>Many applications require a set of interface descriptions in order provide the required functionality. This document defines the concept of function sets to specify this set of interfaces and resources.</t>

<t><spanx style="emph">Editor’s note: The git repository for the draft is found at https://github.com/core-wg/interfaces</spanx></t>



    </abstract>


  </front>

  <middle>


<section anchor="introduction" title="Introduction">

<t>IETF Standards for machine to machine communication in constrained environments describe a REST protocol and a set of related information standards that may be used to represent machine data and machine metadata in REST interfaces. CoRE Link-format is a standard for doing Web Linking <xref target="RFC5988"/> in constrained environments. SenML <xref target="I-D.ietf-core-senml"/> is a simple data model and representation format for composite and complex structured resources. CoRE Link-Format and SenML can be used by CoAP <xref target="RFC7252"/> or HTTP servers.</t>

<t>The discovery of resources offered by a constrained server is very important in machine-to-machine applications where there are no humans in the loop. Machine application clients must be able to adapt to different resource organizations without advance knowledge of the specific data structures hosted by each connected thing. The use of Web Linking for the description and discovery of resources hosted by constrained web servers is specified by CoRE Link Format <xref target="RFC6690"/>. CoRE Link Format additionally defines a link attribute for interface description (“if”) that can be used to describe the REST interface of a resource, and may include a link to a description document.</t>

<t>This document defines a set of Link Format interface descriptions for some common design patterns that enable the server side composition and organization, and client side discovery and consumption, of machine resources using Web Linking. A client discovering the “if” link attribute will be able to consume resources based on its knowledge of the expected interface types. In this sense the Interface Type acts in a similar way as a Content-Format, but as a selector for a high level functional abstraction.</t>

<t>An interface description describes a resource in terms of it’s associated content formats, data types, URI templates, REST methods, parameters, and responses. Basic interface descriptions are defined for sensors, actuators, and properties.</t>

<t>A set of collection types is defined for organizing resources for discovery, and for various forms of bulk interaction with resource sets using typed embedding links.</t>

<t>Interface descriptions may be used in the composition of Function Sets and Profiles. Function Sets and Profiles are described and an example is given of a sensor and actuator device profile using Function Sets composed from the interface descriptions described in this document.</t>

<t>This document first defines the concept of collection interface descriptions. It then defines a number of generic interface descriptions that may be used in contrained environments. Several of these interface descriptions utilise collections. The interface descriptions are then used by the function sets.</t>

<t>Whilst this document assumes the use of CoAP <xref target="RFC7252"/>, the REST interfaces described can also be realized using HTTP <xref target="RFC7230"/>.</t>

</section>
<section anchor="reqlang" title="Terminology">
<t>The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”,   “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in <xref target="RFC2119"/>.</t>

<t>This document requires readers to be familiar with all the terms and concepts that are discussed in <xref target="RFC5988"/> and <xref target="RFC6690"/>. This document makes use of the following additional terminology:</t>

<t><list style="hanging">
  <t hangText='Device:'>
  An IP smart object running a web server that hosts a group of Function Set instances from a profile.</t>
  <t hangText='Function Set:'>
  A group of well-known REST resources that provides a particular service.</t>
  <t hangText='Gradual Reveal:'>
  A REST design where resources are discovered progressively using Web Linking.</t>
  <t hangText='Interface Description:'>
  The Interface Description describes the generic REST interface to interact with a resource or a set of resources. Its use is described via the Interface Description ‘if’ attribute which is an opaque string used to provide a name or URI indicating a specific interface definition used to interact with the target resource.  One can think of this as describing verbs usable on a resource.</t>
  <t hangText='Profile:'>
  A group of well-known Function Sets defined by a specification.</t>
  <t hangText='Resource Discovery:'>
  The process allowing a web client to identify resources being hosted on a web server.</t>
  <t hangText='Service Discovery:'>
  The process making it possible for a web client to automatically detect devices and Function Sets offered by these devices on a CoRE network.</t>
</list></t>

</section>
<section anchor="collections" title="Collections">

<section anchor="collect-intro" title="Introduction to Collections">
<t>A Collection is a resource which represents one or more related resources. <xref target="RFC6573"/> describes the “item” and “collection” Link Relation. “item” link relation identifies a member of collection. “collection” indicates the collection that an item is a member of. For example: A collection might be a resource representing catalog of products, an item is a resource related to an individual product.</t>

<t>Section 1.2.2/<xref target="RFC6690"/> also describes resource collections.</t>

<t>This document uses the concept of “collection” and applies it to interface descriptions. A collection interface description consists of a set of links and a set of items pointed to by the links which may be sub-resources of the collection resource. The collection interface descriptions described in this document are Link List, Batch and Linked Batch.</t>

<t>The links in a collection are represented in CoRE Link-Format Content-Formats including JSON and CBOR variants, and the items in the collection may be represented by senml, including JSON and CBOR variants. In general, a collection may support items of any available Content-Format.</t>

<t>A particular resource item may be a member of more than one collection at a time by being linked to, but may only be a subresource of one collection.</t>

<t>Some collections may have pre-configured items and links, and some collections may support dynamic creation and removal of items and links. Likewise, modification of items in some collections may be permitted, and not in others.</t>

<t>Collections may support link embedding, which is analogous to an image tag (link) causing the image to display inline in a browser window. Resources pointed to by embedded links in collections may be interacted with using bulk operations on the collection resource. For example, performing a GET on a collection resource may return a single representation containing all of the linked resources.</t>

<t>Links in collections may be selected for processing by a particular request by using Query Filtering as described in CoRE Link-Format <xref target="RFC6690"/>.</t>

</section>
<section anchor="use-cases" title="Use Cases for Collections">
<t>Collections may be used to provide gradual reveal of resources on an endpoint. There may be a small set of links at the .well-known/core location, which may in turn point to other collections of resources that represent device information, device configuration, device management, and various functional clusters of resources on the device.</t>

<t>A collection may provide resource encapsulation, where link embedding may be used to provide a single resource with which a client may interact to obtain a set of related resource values. For example, a collection for manufacturer parameters may consist of manufacturer name, date of manufacture, location of manufacture, and serial number resources which can be read as a single senml data object.</t>

<t>A collection may be used to group a set of like resources for bulk state update or actuation. For example, the brightness control resources of a number of luminaries may be grouped by linking to them in a collection. The collection type may support receiving a single update form a client and sending that update to each resource item in the collection.</t>

<t>Items may be sub-resources of the collection resource. This enables updates to multiple items in the collection to be processed together within the context of the collection resource.</t>

</section>
<section anchor="content-formats" title="Content-Formats for Collections">
<t>The collection interfaces by default use CoRE Link-Format for the link representations and SenML or text/plain for representations of items. The examples given are for collections that expose resources and links in these formats. In addition, a new “collection” Content-Format is defined based on the SenML framework which represents both links and items in the collection.</t>

<t>The choice of whether to return a representation of the links or of the items or of the collection format is determined by the accepts header option in the request. Likewise, the choice of updating link metadata or item data or the collection resource itself is determined by the Content-Format option in the header of the update request operation.</t>

<t>The default Content-Formats for collection types described in this document are:</t>

<t><list style="hanging">
  <t hangText='Links:'>
  application/link-format, application/link-format+json</t>
  <t hangText='Items:'>
  application/senml+json, text/plain</t>
</list></t>

</section>
<section anchor="links-items" title="Links and Items in Collections">
<t>Links use CoRE Link-Format representation by default and may point to any resource reachable from the context of the collection. This includes absolute links and links that point to other network locations if the context of the collection allows. Links to sub-resources in the collection MUST have a path-element starting with the resource name, as per <xref target="RFC3986"/>. Links to resources in the global context MUST start with a root path identifier <xref target="RFC5988"/>. Links to other collections are formed per <xref target="RFC3986"/>.</t>

<t><list style="hanging">
  <t hangText='Examples of links:'>
  </t>
  <t hangText='&lt;/sen/&gt;;if=”core.lb”’:'>
  Link to the /sen/ collection describing it as a core.lb type collection (Linked Batch)</t>
  <t hangText='&lt;/sen/&gt;;rel=”grp”’:'>
  Link to the /sen/ collection indicating that /sen/ is a member of a group in the collection in which the link appears.</t>
  <t hangText='&lt;“/sen/temp”&gt;;rt=”temperature”’:'>
  An absolute link to the resource at the path /sen/temp</t>
  <t hangText='&lt;temp&gt;;rt=”temperature”:'>
  Link to the temp subresource of the collection in which this link appears.”</t>
  <t hangText='&lt;temp&gt;;anchor=”/sen/”:'>
  A link to the temp subresource of the collection /sen/ which is assumed not to be a subresource of the collection in which the link appears ,but is expected to be identified in the collection by resource name.</t>
</list></t>

<t>Links in the collection MAY be Read, Updated, Added, or Removed using the CoRE Link-Format or JSON Merge-Patch Content-Formats on the collection resource. Reading links uses the GET method and returns an array or list containing the link-values of all selected links. Links may be added to the collection using POST or PATCH methods. Updates to links MUST use the PATCH method and MAY use query filtering to select links for updating. The PATCH method on links MUST use the JSON Merge-Patch Content-Format (application/merge-patch+json) specified in <xref target="RFC7396"/>.</t>

<t>Items in the collection SHOULD be represented using the SenML (application/senml+json) or plain text (text/plain) Content-Formats, depending on whether the representation is of a single data point or multiple data points. Items MAY be represented using any supported Content-Format.</t>

<t>Link Embedding enables the bulk processing of items in the collection using a single operation targeting the collection resource. A subset of resources in the collection may be selected for operation using Query Filtering. Bulk Read operations using GET return a SenML representation of all selected resources. Bulk item Update operations using PUT or POST apply the payload document to all selected resource items in the collection, using either a Batch or Group update policy. A Batch update is performed by applying the resource values in the payload document to all resources in the collection that match any resource name in the payload document. Group updates are performed by applying the payload document to each item in the collection. Group updates are indicated by the link relation type rel=”grp” in the link.</t>

</section>
<section anchor="queries" title="Queries on Collections">
<t>Collections MAY support query filtering as defined in CoRE Link-Format <xref target="RFC6690"/>. Operations targeting either the links or the items MAY select a subset of links and items in the collection by using query filtering. The Content-Format specified in the request header selects whether links or items are targeted by the operation.</t>

</section>
<section anchor="observing" title="Observing Collections">
<t>Resource Observation via <xref target="I-D.ietf-core-dynlink"/> using CoAP <xref target="RFC7252"/> MAY be supported on items in a collection. A subset of the conditional observe parameters MAY be specified to apply. In most cases pmin and pmax are useful. Resource observation on a collection’s items resource MAY report any changes of resource state in any item in the collection. Observation Responses, or notifications, SHOULD provide representations of the resources that have changed in SenML Content-Format. Notifications MAY include multiple observations of a particular resource, with SenML time stamps indicating the observation times.</t>

</section>
<section anchor="collection-types" title="Collection Types">
<t>There are three collection types defined in this document:</t>

<texttable title="Collection Type Summary" anchor="collectiontype">
      <ttcol align='left'>Collection Type</ttcol>
      <ttcol align='left'>if=</ttcol>
      <ttcol align='left'>Content-Format</ttcol>
      <c>Link List</c>
      <c>core.ll</c>
      <c>link-format</c>
      <c>Batch</c>
      <c>core.b</c>
      <c>link-format, senml</c>
      <c>Linked Batch</c>
      <c>core.lb</c>
      <c>link-format, senml</c>
</texttable>

<t>The interface description defined in this document describes the methods and functions that may be applied to the collections.</t>

</section>
</section>
<section anchor="interfaces" title="Interface Descriptions">
<t>This section defines REST interfaces for Link List, Batch, Sensor, Parameter and Actuator resources. Variants such as Linked Batch or Read-Only Parameter are also presented. Each type is described along with its Interface Description attribute value and valid methods. These are defined for each interface in the table below. These interfaces can support plain text and/or SenML Media types.</t>

<t>The if= column defines the Interface Description (if=) attribute value to be used in the CoRE Link Format for a resource conforming to that interface. When this value appears in the if= attribute of a link, the resource MUST support the corresponding REST interface described in this section. The resource MAY support additional functionality, which is out of scope for this document. Although these interface descriptions are intended to be used with the CoRE Link Format, they are applicable for use in any REST interface definition.</t>

<t>The Methods column defines the methods supported by that interface, which are described in more detail below.</t>

<texttable title="Interface Description Summary" anchor="intdesc">
      <ttcol align='left'>Interface</ttcol>
      <ttcol align='left'>if=</ttcol>
      <ttcol align='left'>Methods</ttcol>
      <ttcol align='left'>Content-Formats</ttcol>
      <c>Link List</c>
      <c>core.ll</c>
      <c>GET</c>
      <c>link-format</c>
      <c>Batch</c>
      <c>core.b</c>
      <c>GET, PUT, POST</c>
      <c>link-format, senml</c>
      <c>Linked Batch</c>
      <c>core.lb</c>
      <c>GET, PUT, POST,</c>
      <c>link-format, senml</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>DELETE</c>
      <c>&#160;</c>
      <c>Sensor</c>
      <c>core.s</c>
      <c>GET</c>
      <c>link-format,</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>text/plain</c>
      <c>Parameter</c>
      <c>core.p</c>
      <c>GET, PUT</c>
      <c>link-format,</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>text/plain</c>
      <c>Read-only</c>
      <c>core.rp</c>
      <c>GET</c>
      <c>link-format,</c>
      <c>Parameter</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>text/plain</c>
      <c>Actuator</c>
      <c>core.a</c>
      <c>GET, PUT, POST</c>
      <c>link-format,</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>text/plain</c>
</texttable>

<t>The following is an example of links in the CoRE Link Format using these interface descriptions. The resource hierarchy is based on a simple profile defined in <xref target="simple-profile"/>. These links are used in the subsequent examples below.</t>

<figure title="Binding Interface Example" anchor="figbindexp"><artwork><![CDATA[
Req: GET /.well-known/core
Res: 2.05 Content (application/link-format)
</s/>;rt="simple.sen";if="core.b",
</s/lt>;rt="simple.sen.lt";if="core.s",
</s/tmp>;rt="simple.sen.tmp";if="core.s";obs,
</s/hum>;rt="simple.sen.hum";if="core.s",
</a/>;rt="simple.act";if="core.b",
</a/1/led>;rt="simple.act.led";if="core.a",
</a/2/led>;rt="simple.act.led";if="core.a",
</d/>;rt="simple.dev";if="core.ll",
</l/>;if="core.lb",
]]></artwork></figure>

<section anchor="hlink-list" title="Link List">
<t>The Link List interface is used to retrieve (GET) a list of resources on a web server. The GET request SHOULD contain an Accept option with the application/link-format content format; however if the resource does not support any other form of GET methods the Accept option MAY be elided. The Accept option SHOULD only include the application/link-format content format.</t>

<t><spanx style="emph">Editor’s note: This use of Accept is not very clear, should probably explain this is due to this interface description being extended by Batch and Linked Batch later.</spanx></t>

<t>The request returns a list of URI references with absolute paths to the resources as defined in CoRE Link Format. This interface is typically used with a parent resource to enumerate sub-resources but may be used to reference any resource on a web server.</t>

<t>Link List is the base interface to provide gradual reveal of resources on a CoRE web server, hence the root resource of a Function Set SHOULD implement this interface or an extension of this interface.</t>

<t>The following example interacts with a Link List /d containing Parameter sub-resources /d/name, /d/model.</t>

<figure><artwork><![CDATA[
Req: GET /d/ (Accept:application/link-format)
Res: 2.05 Content (application/link-format)
</d/name>;rt="simple.dev.n";if="core.p",
</d/model>;rt="simple.dev.mdl";if="core.rp"
]]></artwork></figure>

</section>
<section anchor="hbatch" title="Batch">
<t>The Batch interface is used to manipulate a collection of sub-resources at the same time. The Batch interface description supports the same methods as its sub-resources, and can be used to read (GET), update (PUT) or apply (POST) the values of those sub-resource with a single resource representation. The sub-resources of a Batch MAY be heterogeneous, a method used on the Batch only applies to sub-resources that support it. For example Sensor interfaces do not support PUT, and thus a PUT request to a Sensor member of that Batch would be ignored. A batch requires the use of SenML Media types in order to support multiple sub-resources.</t>

<t>In addition, The Batch interface is an extension of the Link List interface and in consequence MUST support the same methods.</t>

<t><spanx style="emph">Editor’s note: hould probably explain that this means doing a GET with an Accept:application/link-format will return the sub-resource links</spanx></t>

<t>The following example interacts with a Batch /s/ with Sensor sub-resources /s/light, /s/temp and /s/humidity.</t>

<figure><artwork><![CDATA[
Req: GET /s/
Res: 2.05 Content (application/senml+json)
{"e":[
    { "n": "light", "v": 123, "u": "lx" },
    { "n": "temp", "v": 27.2, "u": "degC" },
    { "n": "humidity", "v": 80, "u": "%RH" }],
}
]]></artwork></figure>

</section>
<section anchor="hlinked-batch" title="Linked Batch">
<t>The Linked Batch interface is an extension of the Batch interface. Contrary to the basic Batch which is a collection statically defined by the web server, a Linked Batch is dynamically controlled by a web client. A Linked Batch resource has no sub-resources. Instead the resources forming the batch are referenced using Web Linking <xref target="RFC5988"/> and the CoRE Link Format <xref target="RFC6690"/>. A request with a POST method and a content format of application/link-format simply appends new resource links to the collection. The links in the payload MUST reference a resource on the web server with an absolute path. A DELETE request removes the entire collection. All other requests available for a basic Batch are still valid for a Linked Batch.</t>

<t>The following example interacts with a Linked Batch /l/ and creates a collection containing /s/light, /s/temp and /s/humidity in 2 steps.</t>

<figure><artwork><![CDATA[
Req: POST /l/ (Content-Format: application/link-format)
</s/light>,</s/temp>
Res: 2.04 Changed 

Req: GET /l/
Res: 2.05 Content (application/senml+json)
{"e":[
   { "n": "/s/light", "v": 123, "u": "lx" },
   { "n": "/s/temp", "v": 27.2, "u": "degC" },
}

Req: POST /l/ (Content-Format: application/link-format)
</s/humidity>
Res: 2.04 Changed 

Req: GET /l/ (Accept: application/link-format)
Res: 2.05 Content (application/link-format)
</s/light>,</s/temp>,</s/humidity>

Req: GET /l/
Res: 2.05 Content (application/senml+json)
{"e":[
   { "n": "/s/light", "v": 123, "u": "lx" },
   { "n": "/s/temp", "v": 27.2, "u": "degC" },
   { "n": "/s/humidity", "v": 80, "u": "%RH" }],
}

Req: DELETE /l/
Res: 2.02 Deleted
]]></artwork></figure>

</section>
<section anchor="hsensor" title="Sensor">
<t>The Sensor interface allows the value of a sensor resource to be read (GET). The Media type of the resource can be either plain text or SenML. Plain text MAY be used for a single measurement that does not require meta-data. For a measurement with meta-data such as a unit or time stamp, SenML SHOULD be used. A resource with this interface MAY use SenML to return multiple measurements in the same representation, for example a list of recent measurements.</t>

<t>The following are examples of Sensor interface requests in both text/plain and application/senml+json.</t>

<figure><artwork><![CDATA[
Req: GET /s/humidity (Accept: text/plain)
Res: 2.05 Content (text/plain)
80

Req: GET /s/humidity (Accept: application/senml+json)
Res: 2.05 Content (application/senml+json)
{"e":[
    { "n": "humidity", "v": 80, "u": "%RH" }],
}
]]></artwork></figure>

</section>
<section anchor="hparameter" title="Parameter">
<t>The Parameter interface allows configurable parameters and other information to be modeled as a resource. The value of the parameter can be read (GET) or update (PUT). Plain text or SenML Media types MAY be returned from this type of interface.</t>

<t>The following example shows request for reading and updating a parameter.</t>

<figure><artwork><![CDATA[
Req: GET /d/name
Res: 2.05 Content (text/plain)
node5

Req: PUT /d/name (text/plain)
outdoor
Res: 2.04 Changed 
]]></artwork></figure>

</section>
<section anchor="hreadonly-parameter" title="Read-only Parameter">
<t>The Read-only Parameter interface allows configuration parameters to be read (GET) but not updated. Plain text or SenML Media types MAY be returned from this type of interface.</t>

<t>The following example shows request for reading such a parameter.</t>

<figure><artwork><![CDATA[
Req: GET /d/model
Res: 2.05 Content (text/plain)
SuperNode200
]]></artwork></figure>

</section>
<section anchor="hactuator" title="Actuator">
<t>The Actuator interface is used by resources that model different kinds of actuators (changing its value has an effect on its environment). Examples of actuators include for example LEDs, relays, motor controllers and light dimmers. The current value of the actuator can be read (GET) or the actuator value can be updated (PUT). In addition, this interface allows the use of POST to change the state of an actuator, for example to toggle between its possible values. Plain text or SenML Media types MAY be returned from this type of interface. A resource with this interface MAY use SenML to include multiple measurements in the same representation, for example a list of recent actuator values or a list of values to updated.</t>

<t>The following example shows requests for reading, setting and toggling an actuator (turning on a LED).</t>

<figure><artwork><![CDATA[
Req: GET /a/1/led
Res: 2.05 Content (text/plain)
0

Req: PUT /a/1/led (text/plain)
1
Res: 2.04 Changed 

Req: POST /a/1/led (text/plain)
Res: 2.04 Changed 

Req: GET /a/1/led
Res: 2.05 Content (text/plain)
0
]]></artwork></figure>

</section>
</section>
<section anchor="function-set" title="Function Sets and Profiles">
<t>This section defines how a set of REST resources can be created called a function set. A Function Set is similar to a function block in the sense that it consists of input, output and parameter resources and contains internal logic. A Function Set can have a subset of mandatory inputs, outputs and parameters to provide minimum interoperability. It can also be extended with manufacturer/user-specific resources. A device is composed of one or more Function Set instances.</t>

<t>An example of function sets can be found from the CoRE Resource Directory specification that defines REST interfaces for registration, group and lookup <xref target="I-D.ietf-core-resource-directory"/>.</t>

<t>The OMA Lightweight M2M standard <xref target="OMA-TS-LWM2M"/> also defines a function set structure called an Objects that use integer path, instance and resource URI segments. OMA Objects can be defined and then registered with an OMA maintained registry <xref target="OMA-TS-LWM2M"/>. This section is simply meant as a guideline for the definition of other such REST interfaces, either custom or part of other specifications.</t>

<section anchor="definition" title="Defining a Function Set">
<t>In a Function Set, types of resources are defined. Each type includes a human readable name, a path template, a Resource Type for discovery, the Interface Definition and the data type and allowed values. A Function Set definition may also include a field indicating if a sub-resource is mandatory or optional.</t>

<section anchor="path-template" title="Path template">

<t>A Function Set is a container resource under which its sub-resources are organized. The profile defines the path to each resource of a Function Set in a path template. The template can contain either relative paths or absolute paths depending on the profile needs. An absolute Function Set should be located at its recommended root path on a web server, however it can be located under an alternative path if necessary (for example multi-purpose devices, gateways etc.). A relative Function Set can be instantiated as many times as needed on a web server with an arbitrary root path. However some Function Sets (e.g. device description) only make sense as singletons.</t>

<t>The path template includes a possible index {#} parameter, and possible fixed path segments.  The index {#} allows for multiple instances of this type of resource, and can be any string. The root path and the indexes are the only variable elements in a path template. All other path segments should be fixed.</t>

</section>
<section anchor="resource-type" title="Resource Type">

<t>Each root resource of a Function Set is assigned a Resource Type parameter, therefore making it possible to discover it. Each sub-resource of a Function Set is also assigned a Resource Type parameter. This Resource Type is used for resource discovery and is usually necessary to discover optional resources supported on a specific device. The Resource Type of a Function Set may also be used for service discovery and can be exported to DNS-SD <xref target="RFC6763"/> for example.</t>

<t>The Resource Type parameter defines the value that should be included in the rt= field of the CoRE Link Format when describing a link to this resource. The value SHOULD be in the form "namespace.type" for root resources and "namespace.type.subtype" for sub-resources. This naming convention facilitates resource type filtering with the /.well-known/core resource. However a profile could allow mixing in foreign namespace references within a Function Set to import external references from other object models (e.g. SenML and UCUM).</t>

</section>
<section anchor="interface-description" title="Interface Description">

<t>The Interface Description parameter defines the REST interface for that type of resource. Several base interfaces are defined in <xref target="interfaces"/> of this document. For a given profile, the Interface Description may be inferred from the Resource Type. In that case the Interface Description MAY be elided from link descriptions of resource types defined in the profile, but should be included for custom extensions to the profile.</t>

<t>The root resource of a Function Set should provide a list of links to its sub-resources in order to offer gradual reveal of resources. The CoRE Link List interface defined in <xref target="link-list"/> offers this functionality so a root resource should support this interface or a derived interface like CoRE Batch (See <xref target="batch"/>).</t>

</section>
<section anchor="data-type" title="Data type">

<t>The Data Type field defines the type of value (and possible range) that is returned in response to a GET for that resource or accepted with a PUT. The interfaces defined in <xref target="interfaces"/> make use of plain text and SenML Media types for the actual format of this data. A profile may restrict the list of supported content formats for the CoRE interfaces or define new interfaces with new content types.</t>

</section>
</section>
<section anchor="discovery" title="Discovery">

<t>A device conforming to a profile SHOULD make its resources discoverable by providing links to the resources on the path /.well-known/core as defined in <xref target="RFC6690"/>. All resources hosted on a device SHOULD be discoverable either with a direct link in /.well-known/core or by following successive links starting from /.well-known/core.</t>

<t>The root path of a Function Set instance SHOULD be directly referenced in /.well-known/core in order to offer discovery at the first discovery stage. A device with more than 10 individual resources SHOULD only expose Function Set instances in /.well-known/core to limit the size of this resource.</t>

<t>In addition, a device MAY register its resources to a Resource Directory using the registration interface defined in <xref target="I-D.ietf-core-resource-directory"/> if such a directory is available.</t>

</section>
<section anchor="versioning" title="Versioning">
<t>A profile should track Function Set changes to avoid incompatibility issues. Evolutions in a Function Set SHOULD be backward compatible.</t>

</section>
</section>
<section anchor="Security" title="Security Considerations">
<t>An implementation of a client needs to be prepared to deal with responses to a request that differ from what is specified in this document. A server implementing what the client thinks is a resource with one of these interface descriptions could return malformed representations and response codes either by accident or maliciously. A server sending maliciously malformed responses could attempt to take advantage of a poorly implemented client for example to crash the node or perform denial of service.</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<t>This document registers the following CoRE Interface Description (if=) Link Target Attribute Values.</t>

<section anchor="link-list" title="Link List">

<t><list style="hanging">
  <t hangText='Attribute Value:'>
  core.ll</t>
  <t hangText='Description:'>
  The Link List interface is used to retrieve a list of resources on a web server.</t>
  <t hangText='Reference:'>
  This document. Note to RFC Editor - please insert the appropriate RFC reference.</t>
  <t hangText='Notes:'>
  None</t>
</list></t>

</section>
<section anchor="batch" title="Batch">

<t><list style="hanging">
  <t hangText='Attribute Value:'>
  core.b</t>
</list></t>

<t>Description: The Batch interface is used to manipulate a collection of sub-resources at the same time.</t>

<t><list style="hanging">
  <t hangText='Reference:'>
  This document. Note to RFC Editor - please insert the appropriate RFC reference.</t>
  <t hangText='Notes:'>
  None</t>
</list></t>

</section>
<section anchor="linked-batch" title="Linked Batch">

<t><list style="hanging">
  <t hangText='Attribute Value:'>
  core.lb</t>
  <t hangText='Description:'>
  The Linked Batch interface is an extension of the Batch interface. Contrary to the basic Batch which is a collection statically defined by the web server, a Linked Batch is dynamically controlled by a web client.</t>
  <t hangText='Reference:'>
  This document. Note to RFC Editor - please insert the appropriate RFC reference.</t>
  <t hangText='Notes:'>
  None</t>
</list></t>

</section>
<section anchor="sensor" title="Sensor">

<t><list style="hanging">
  <t hangText='Attribute Value:'>
  core.s</t>
  <t hangText='Description:'>
  The Sensor interface allows the value of a sensor resource to be read.</t>
  <t hangText='Reference:'>
  This document. Note to RFC Editor - please insert the appropriate RFC reference.</t>
  <t hangText='Notes:'>
  None</t>
</list></t>

</section>
<section anchor="parameter" title="Parameter">

<t>Attribute Value: core.p</t>

<t><list style="hanging">
  <t hangText='Description:'>
  The Parameter interface allows configurable parameters and other information to be modeled as a resource. The value of the parameter can be read or update.</t>
  <t hangText='Reference:'>
  This document. Note to RFC Editor - please insert the appropriate RFC reference.</t>
  <t hangText='Notes:'>
  None</t>
</list></t>

</section>
<section anchor="read-only-parameter" title="Read-only parameter">

<t><list style="hanging">
  <t hangText='Attribute Value:'>
  core.rp</t>
  <t hangText='Description:'>
  The Read-only Parameter interface allows configuration parameters to be read but not updated.</t>
  <t hangText='Reference:'>
  This document. Note to RFC Editor - please insert the appropriate RFC reference.</t>
  <t hangText='Notes:'>
  None</t>
</list></t>

</section>
<section anchor="actuator" title="Actuator">

<t><list style="hanging">
  <t hangText='Attribute Value:'>
  core.a</t>
  <t hangText='Description:'>
  The Actuator interface is used by resources that model different kinds of actuators (changing its value has an effect on its environment). Examples of actuators include for example LEDs, relays, motor controllers and light dimmers. The current value of the actuator can be read or the actuator value can be updated. In addition, this interface allows the use of POST to change the state of an actuator, for example to toggle between its possible values.</t>
  <t hangText='Reference:'>
  This document. Note to RFC Editor - please insert the appropriate RFC reference.</t>
  <t hangText='Notes:'>
  None</t>
</list></t>

</section>
</section>
<section anchor="acknowledgements" title="Acknowledgements">
<t>Acknowledgement is given to colleagues from the SENSEI project who were critical in the initial development of the well-known REST interface concept, to members of the IPSO Alliance where further requirements for interface descriptions have been discussed, and to Szymon Sasin, Cedric Chauvenet, Daniel Gavelle and Carsten Bormann who have provided useful discussion and input to the concepts in this document.</t>

</section>
<section anchor="changelog" title="Changelog">
<t>Changes from -05 to -06:</t>

<t><list style="symbols">
  <t>Updated the abstract.</t>
  <t>Section 1: Updated introduction.</t>
  <t>Section 2: Alphabetised the order</t>
  <t>Section 2: Removed the collections definition in favour of the complete definition in the collections section.</t>
  <t>Removed section 3 on interfaces in favour of an updated definition in section 1.3.</t>
  <t>General: Changed interface type to interface description as that is the term defined in RFC6690.</t>
  <t>Removed section on future interfaces.</t>
  <t>Section 8: Updated IANA considerations.</t>
  <t>Added Appendix A to discuss current state of the art wrt to collections, function sets etc.</t>
</list></t>

<t>Changes from -04 to -05:</t>

<t><list style="symbols">
  <t>Removed Link Bindings and Observe attributes. This functionality is now contained in I-D.ietf-core-dynlink.</t>
  <t>Hypermedia collections have been removed. This is covered in a new T2TRG draft.</t>
  <t>The WADL description has been removed.</t>
  <t>Fixed minor typos.</t>
  <t>Updated references.</t>
</list></t>

<t>Changes from -03 to -04:</t>

<t><list style="symbols">
  <t>Fixed tickets #385 and #386.</t>
  <t>Changed abstract and into to better describe content.</t>
  <t>Focus on Interface and not function set/profiles in intro.</t>
  <t>Changed references from draft-core-observe to RFC7641.</t>
  <t>Moved Function sets and Profiles to section after Interfaces.</t>
  <t>Moved Observe Attributes to the Link Binding section.</t>
  <t>Add a Collection section to describe the collection types.</t>
  <t>Add the Hypermedia Collection Interface Description.</t>
</list></t>

<t>Changes from -02 to -03:</t>

<t><list style="symbols">
  <t>Added lt and gt to binding format section.</t>
  <t>Added pmin and pmax observe parameters to Observation Attributes.</t>
  <t>Changed the definition of lt and gt to limit crossing.</t>
  <t>Added definitions for getattr and setattr to WADL.</t>
  <t>Added getattr and setattr to observable interfaces.</t>
  <t>Removed query parameters from Observe definition.</t>
  <t>Added observe-cancel definition to WADL and to observable interfaces.</t>
</list></t>

<t>Changes from -01 to -02:</t>

<t><list style="symbols">
  <t>Updated the date and version, fixed references.</t>
  <t>“Removed pmin and pmax observe parameters <spanx style="verb">[Ticket #336]</spanx>.”</t>
</list></t>

<t>Changes from -00 to WG Document -01</t>

<t><list style="symbols">
  <t>Improvements to the Function Set section.</t>
</list></t>

<t>Changes from -05 to WG Document -00</t>

<t><list style="symbols">
  <t>Updated the date and version.</t>
</list></t>

<t>Changes from -04 to -05</t>

<t><list style="symbols">
  <t>Made the Observation control parameters to be treated as resources rather than Observe query parameters. Added Less Than and Greater Than parameters.</t>
</list></t>

<t>Changes from -03 to -04</t>

<t><list style="symbols">
  <t>Draft refresh</t>
</list></t>

<t>Changes from -02 to -03</t>

<t><list style="symbols">
  <t>Added Bindings</t>
  <t>Updated all rt= and if= for the new Link Format IANA rules</t>
</list></t>

<t>Changes from -01 to -02</t>

<t><list style="symbols">
  <t>Defined a Function Set and its guidelines.</t>
  <t>Added the Link List interface.</t>
  <t>Added the Linked Batch interface.</t>
  <t>Improved the WADL interface definition.</t>
  <t>Added a simple profile example.</t>
</list></t>

</section>


  </middle>

  <back>

    <references title='Normative References'>





<reference  anchor='RFC2119' target='http://www.rfc-editor.org/info/rfc2119'>
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='S. Bradner'><organization /></author>
<date year='1997' month='March' />
<abstract><t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='2119'/>
<seriesInfo name='DOI' value='10.17487/RFC2119'/>
</reference>



<reference  anchor='RFC5988' target='http://www.rfc-editor.org/info/rfc5988'>
<front>
<title>Web Linking</title>
<author initials='M.' surname='Nottingham' fullname='M. Nottingham'><organization /></author>
<date year='2010' month='October' />
<abstract><t>This document specifies relation types for Web links, and defines a registry for them.  It also defines the use of such links in HTTP headers with the Link header field.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='5988'/>
<seriesInfo name='DOI' value='10.17487/RFC5988'/>
</reference>



<reference  anchor='RFC6690' target='http://www.rfc-editor.org/info/rfc6690'>
<front>
<title>Constrained RESTful Environments (CoRE) Link Format</title>
<author initials='Z.' surname='Shelby' fullname='Z. Shelby'><organization /></author>
<date year='2012' month='August' />
<abstract><t>This specification defines Web Linking using a link format for use by constrained web servers to describe hosted resources, their attributes, and other relationships between links.  Based on the HTTP Link Header field defined in RFC 5988, the Constrained RESTful Environments (CoRE) Link Format is carried as a payload and is assigned an Internet media type.  &quot;RESTful&quot; refers to the Representational State Transfer (REST) architecture.  A well-known URI is defined as a default entry point for requesting the links hosted by a server.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='6690'/>
<seriesInfo name='DOI' value='10.17487/RFC6690'/>
</reference>




    </references>

    <references title='Informative References'>





<reference  anchor='RFC3986' target='http://www.rfc-editor.org/info/rfc3986'>
<front>
<title>Uniform Resource Identifier (URI): Generic Syntax</title>
<author initials='T.' surname='Berners-Lee' fullname='T. Berners-Lee'><organization /></author>
<author initials='R.' surname='Fielding' fullname='R. Fielding'><organization /></author>
<author initials='L.' surname='Masinter' fullname='L. Masinter'><organization /></author>
<date year='2005' month='January' />
<abstract><t>A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource.  This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet.  The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier.  This specification does not define a generative grammar for URIs; that task is performed by the individual specifications of each URI scheme.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='STD' value='66'/>
<seriesInfo name='RFC' value='3986'/>
<seriesInfo name='DOI' value='10.17487/RFC3986'/>
</reference>



<reference  anchor='RFC6573' target='http://www.rfc-editor.org/info/rfc6573'>
<front>
<title>The Item and Collection Link Relations</title>
<author initials='M.' surname='Amundsen' fullname='M. Amundsen'><organization /></author>
<date year='2012' month='April' />
<abstract><t>RFC 5988 standardized a means of indicating the relationships between resources on the Web. This specification defines a pair of reciprocal link relation types that may be used to express the relationship between a collection and its members.  This document is not an Internet  Standards Track specification; it is published for informational purposes.</t></abstract>
</front>
<seriesInfo name='RFC' value='6573'/>
<seriesInfo name='DOI' value='10.17487/RFC6573'/>
</reference>



<reference  anchor='RFC6763' target='http://www.rfc-editor.org/info/rfc6763'>
<front>
<title>DNS-Based Service Discovery</title>
<author initials='S.' surname='Cheshire' fullname='S. Cheshire'><organization /></author>
<author initials='M.' surname='Krochmal' fullname='M. Krochmal'><organization /></author>
<date year='2013' month='February' />
<abstract><t>This document specifies how DNS resource records are named and structured to facilitate service discovery.  Given a type of service that a client is looking for, and a domain in which the client is looking for that service, this mechanism allows clients to discover a list of named instances of that desired service, using standard DNS queries. This mechanism is referred to as DNS-based Service Discovery, or DNS-SD.</t></abstract>
</front>
<seriesInfo name='RFC' value='6763'/>
<seriesInfo name='DOI' value='10.17487/RFC6763'/>
</reference>



<reference  anchor='RFC7230' target='http://www.rfc-editor.org/info/rfc7230'>
<front>
<title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
<author initials='R.' surname='Fielding' fullname='R. Fielding' role='editor'><organization /></author>
<author initials='J.' surname='Reschke' fullname='J. Reschke' role='editor'><organization /></author>
<date year='2014' month='June' />
<abstract><t>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems.  This document provides an overview of HTTP architecture and its associated terminology, defines the &quot;http&quot; and &quot;https&quot; Uniform Resource Identifier (URI) schemes, defines the HTTP/1.1 message syntax and parsing requirements, and describes related security concerns for implementations.</t></abstract>
</front>
<seriesInfo name='RFC' value='7230'/>
<seriesInfo name='DOI' value='10.17487/RFC7230'/>
</reference>



<reference  anchor='RFC7252' target='http://www.rfc-editor.org/info/rfc7252'>
<front>
<title>The Constrained Application Protocol (CoAP)</title>
<author initials='Z.' surname='Shelby' fullname='Z. Shelby'><organization /></author>
<author initials='K.' surname='Hartke' fullname='K. Hartke'><organization /></author>
<author initials='C.' surname='Bormann' fullname='C. Bormann'><organization /></author>
<date year='2014' month='June' />
<abstract><t>The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use with constrained nodes and constrained (e.g., low-power, lossy) networks.  The nodes often have 8-bit microcontrollers with small amounts of ROM and RAM, while constrained networks such as IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs) often have high packet error rates and a typical throughput of 10s of kbit/s.  The protocol is designed for machine- to-machine (M2M) applications such as smart energy and building automation.</t><t>CoAP provides a request/response interaction model between application endpoints, supports built-in discovery of services and resources, and includes key concepts of the Web such as URIs and Internet media types.  CoAP is designed to easily interface with HTTP for integration with the Web while meeting specialized requirements such as multicast support, very low overhead, and simplicity for constrained environments.</t></abstract>
</front>
<seriesInfo name='RFC' value='7252'/>
<seriesInfo name='DOI' value='10.17487/RFC7252'/>
</reference>



<reference  anchor='RFC7396' target='http://www.rfc-editor.org/info/rfc7396'>
<front>
<title>JSON Merge Patch</title>
<author initials='P.' surname='Hoffman' fullname='P. Hoffman'><organization /></author>
<author initials='J.' surname='Snell' fullname='J. Snell'><organization /></author>
<date year='2014' month='October' />
<abstract><t>This specification defines the JSON merge patch format and processing rules.  The merge patch format is primarily intended for use with the HTTP PATCH method as a means of describing a set of modifications to a target resource's content.</t></abstract>
</front>
<seriesInfo name='RFC' value='7396'/>
<seriesInfo name='DOI' value='10.17487/RFC7396'/>
</reference>



<reference anchor='I-D.ietf-core-dynlink'>
<front>
<title>Dynamic Resource Linking for Constrained RESTful Environments</title>

<author initials='Z' surname='Shelby' fullname='Zach Shelby'>
    <organization />
</author>

<author initials='M' surname='Vial' fullname='Matthieu Vial'>
    <organization />
</author>

<author initials='M' surname='Koster' fullname='Michael Koster'>
    <organization />
</author>

<author initials='C' surname='Groves' fullname='Christian Groves'>
    <organization />
</author>

<date month='October' day='19' year='2016' />

<abstract><t>For CoAP [RFC7252] Dynamic linking of state updates between resources, either on an endpoint or between endpoints, is defined with the concept of Link Bindings.  This document defines conditional observation attributes that work with Link Bindings or with simple CoAP Observe [RFC7641].</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-ietf-core-dynlink-00' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-core-dynlink-00.txt' />
</reference>



<reference anchor='I-D.ietf-core-resource-directory'>
<front>
<title>CoRE Resource Directory</title>

<author initials='Z' surname='Shelby' fullname='Zach Shelby'>
    <organization />
</author>

<author initials='M' surname='Koster' fullname='Michael Koster'>
    <organization />
</author>

<author initials='C' surname='Bormann' fullname='Carsten Bormann'>
    <organization />
</author>

<author initials='P' surname='Stok' fullname='Peter Van der Stok'>
    <organization />
</author>

<date month='July' day='8' year='2016' />

<abstract><t>In many M2M applications, direct discovery of resources is not practical due to sleeping nodes, disperse networks, or networks where multicast traffic is inefficient.  These problems can be solved by employing an entity called a Resource Directory (RD), which hosts descriptions of resources held on other servers, allowing lookups to be performed for those resources.  This document specifies the web interfaces that a Resource Directory supports in order for web servers to discover the RD and to register, maintain, lookup and remove resources descriptions.  Furthermore, new link attributes useful in conjunction with an RD are defined.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-ietf-core-resource-directory-08' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-core-resource-directory-08.txt' />
</reference>



<reference anchor='I-D.ietf-core-senml'>
<front>
<title>Media Types for Sensor Markup Language (SenML)</title>

<author initials='C' surname='Jennings' fullname='Cullen Jennings'>
    <organization />
</author>

<author initials='Z' surname='Shelby' fullname='Zach Shelby'>
    <organization />
</author>

<author initials='J' surname='Arkko' fullname='Jari Arkko'>
    <organization />
</author>

<author initials='A' surname='Keranen' fullname='Ari Keranen'>
    <organization />
</author>

<author initials='C' surname='Bormann' fullname='Carsten Bormann'>
    <organization />
</author>

<date month='October' day='7' year='2016' />

<abstract><t>This specification defines media types for representing simple sensor measurements and device parameters in the Sensor Markup Language (SenML).  Representations are defined in JavaScript Object Notation (JSON), Concise Binary Object Representation (CBOR), eXtensible Markup Language (XML), and Efficient XML Interchange (EXI), which share the common SenML data model.  A simple sensor, such as a temperature sensor, could use this media type in protocols such as HTTP or CoAP to transport the measurements of the sensor or to be configured.</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-ietf-core-senml-03' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-core-senml-03.txt' />
</reference>


<reference anchor="OIC-Core" target="https://openconnectivity.org/resources/specifications">
  <front>
    <title>OIC Resource Type Specification v1.1.0</title>
    <author >
      <organization></organization>
    </author>
    <date year="2016"/>
  </front>
</reference>
<reference anchor="OIC-SmartHome" target="https://openconnectivity.org/resources/specifications">
  <front>
    <title>OIC Smart Home Device Specification v1.1.0</title>
    <author >
      <organization></organization>
    </author>
    <date year="2016"/>
  </front>
</reference>
<reference anchor="OMA-TS-LWM2M" target="http://technical.openmobilealliance.org/Technical/technical-information/release-program/current-releases/oma-lightweightm2m-v1-0">
  <front>
    <title>Lightweight Machine to Machine Technical Specification</title>
    <author >
      <organization></organization>
    </author>
    <date year="2016"/>
  </front>
</reference>
<reference anchor="oneM2MTS0008" target="http://www.onem2m.org/technical/published-documents">
  <front>
    <title>TS 0008 v1.3.2 CoAP Protocol Binding</title>
    <author >
      <organization></organization>
    </author>
    <date year="2016"/>
  </front>
</reference>
<reference anchor="oneM2MTS0023" target="http://www.onem2m.org/technical/published-documents">
  <front>
    <title>TS 0023 v2.0.0 Home Appliances Information Model and Mapping</title>
    <author >
      <organization></organization>
    </author>
    <date year="2016"/>
  </front>
</reference>


    </references>


<section anchor="current-usage-of-interfaces-and-function-sets" title="Current Usage of Interfaces and Function Sets">

<t>This appendix analyses the current landscape with regards the definition and use of collections, interfaces and function sets/profiles. This should be considered when considering the scope of this document.</t>

<t>In summary it can be seen that there is a lack of consistancy of the definition and usage of interface description and function sets.</t>

<section anchor="constrained-restful-environments-core-link-format-ietf" title="Constrained RESTful Environments (CoRE) Link Format (IETF)">

<t><xref target="RFC6690"/> assumes that different deployments or application domains will define the appropriate REST Interface Descriptions along with Resource Types to make discovery meaningful. It highlights that collections are often used for these interfaces.</t>

<t>Whilst 3.2/<xref target="RFC6690"/> defines a new Interface Description ‘if’ attribute the procedures around it are about the naming of the interface not what information should be included in the documentation about the interface.</t>

<t>Function sets are not discussed.</t>

</section>
<section anchor="core-resource-directory-ietf" title="CoRE Resource Directory  (IETF)">

<t><xref target="I-D.ietf-core-resource-directory"/> uses the concepts of collections, interfaces and function sets.</t>

<t>If defines a number of interfaces: discovery, registration, registration update, registration removal, read endpoint links, update endpoint links, registration request interface, removal request interface and lookup interface. However it does not assign an inteface description identifier (if=) to these interfaces.</t>

<t>It does define a resource directory function set which specifies relevant content formats and interfaces to be used between a resource directory and endpoints. However it does not follow the format proposed by this document.</t>

</section>
<section anchor="open-connectivity-foundation-ocf" title="Open Connectivity Foundation (OCF)">

<t>The OIC Core Specification <xref target="OIC-Core"/> most closely aligns with the work in this specification. It makes use of interface descriptions as per <xref target="RFC6690"/> and has registered several interface identifiers (https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#if-link-target-att-value). These interface descriptors are similar to those defined in this specification. From a high level perspective:</t>

<figure><artwork><![CDATA[
links list:   OCF (oic.if.ll) -> IETF (core.ll)
              Note: it's called "link list" in the IETF.
linked batch: OCF (oic.if.b) -> IETF (core.lb)
read-only:    OCF (oic.if.r) -> IETF (core.rp)
read-write:   OCF (oic.if.rw) -> IETF (core.p)
actuator:     OCF (oic.if.a) -> IETF (core.a)
sensor:       OCF (oic.if.s) -> IETF (core.s)
batch:        No OCF equivalent -> IETF (core.b) 
]]></artwork></figure>

<t>Some of the OCF interfaces make use of collections.</t>

<t>The OIC Core specification does not use the concept of function sets. It does however discuss the concept of profiles. The OCF defines two sets of documents. The core specification documents such as <xref target="OIC-Core"/> and vertical profile specification documents which provide specific information for specific applications. The OIC Smart Home Device Specification <xref target="OIC-SmartHome"/> is one such specification. It provides information on the resource model, discovery and data types.</t>

</section>
<section anchor="onem2m" title="oneM2M">

<t>OneM2M describes a technology independent functional architecture <xref target="oneM2MTS0023"/>. In this archictecture the reference points between functional entities are called “interfaces”. This usage does not match the <xref target="RFC6690"/> concept of interfaces. A more direct comparison is that of 10.2/<xref target="oneM2MTS0023"/> that defines basic procedures and resource type-specific procedures utilising REST type create, retrieve, update, delete, notify actions.</t>

<t><xref target="oneM2MTS0023"/> does not refer to resource collections however does define “Group Management Procedures” in 10.2.7/<xref target="oneM2MTS0023"/>. It does allow bulk management of member resources.</t>

<t><xref target="oneM2MTS0023"/> does not use the term “function set”. <xref target="oneM2MTS0008"/> describes the binding with the CoAP protocol. In some respects this document provides a profile of the CoAP protocol in terms of the protocol elements that need to be supported. However it does not define any interface descriptions nor collections.</t>

</section>
<section anchor="oma-lwm2m" title="OMA LWM2M">

<t><xref target="OMA-TS-LWM2M"/> utilises the concept of interfaces. It defines the following interfaces: Bootstrap, Client Registration, Device Management and Service Enablement and Information Reporting. It defines that these have a particular direction (Uplink/Downlink) and indicates the operations that may be applied to the interface (i.e. Request Bootstrap, Write, Delete, Register, Update, De-Register, Create, Read, Write, Delete, Execute, Write Attributes, Discover, Observe, Cancel Observation, Notify). It then further defines which objects may occur over the interface. In 6/<xref target="OMA-TS-LWM2M"/> resource model, identifier and data formats are described.</t>

<t>Whilst it does not formally describe the use of “collections” the use of a multiple resource TLV allows a hierarchy of resource/sub-resource.</t>

<t>It does not identify the interfaces through an Interface Description (if=) attribute.</t>

<t>It does not use the term function set. Informally the specification could be considered as a function set.</t>

<t>Note: It refers to draft-ietf-core-interfaces-00. It also makes use of the binding/observation attributes from draft-ietf-dynlink-00 but does not refer to that document.</t>

</section>
</section>
<section anchor="simple-profile" title="Profile example">
<t>The following is a short definition of simple profile. This simplistic profile is for use in the examples of this document.</t>

<texttable title="List of Function Sets" anchor="tablistfs">
      <ttcol align='left'>Function Set</ttcol>
      <ttcol align='left'>Root Path</ttcol>
      <ttcol align='left'>RT</ttcol>
      <ttcol align='left'>IF</ttcol>
      <c>Device Description</c>
      <c>/d</c>
      <c>simple.dev</c>
      <c>core.ll</c>
      <c>Sensors</c>
      <c>/s</c>
      <c>simple.sen</c>
      <c>core.b</c>
      <c>Actuators</c>
      <c>/a</c>
      <c>simple.act</c>
      <c>core.b</c>
</texttable>

<texttable title="Device Description Function Set" anchor="tabddfs">
      <ttcol align='left'>Type</ttcol>
      <ttcol align='left'>Path</ttcol>
      <ttcol align='left'>RT</ttcol>
      <ttcol align='left'>IF</ttcol>
      <ttcol align='left'>Data Type</ttcol>
      <c>Name</c>
      <c>/d/name</c>
      <c>simple.dev.n</c>
      <c>core.p</c>
      <c>xsd:string</c>
      <c>Model</c>
      <c>/d/model</c>
      <c>simple.dev.mdl</c>
      <c>core.rp</c>
      <c>xsd:string</c>
</texttable>

<texttable title="Sensors Function Set" anchor="tabsfs">
      <ttcol align='left'>Type</ttcol>
      <ttcol align='left'>Path</ttcol>
      <ttcol align='left'>RT</ttcol>
      <ttcol align='left'>IF</ttcol>
      <ttcol align='left'>Data Type</ttcol>
      <c>Light</c>
      <c>/s/light</c>
      <c>simple.sen.lt</c>
      <c>core.s</c>
      <c>xsd:decimal</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>(lux)</c>
      <c>Humidity</c>
      <c>/s/humidity</c>
      <c>simple.sen.hum</c>
      <c>core.s</c>
      <c>xsd:decimal</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>(%RH)</c>
      <c>Temperature</c>
      <c>/s/temp</c>
      <c>simple.sen.tmp</c>
      <c>core.s</c>
      <c>xsd:decimal</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>&#160;</c>
      <c>(degC)</c>
</texttable>

<texttable title="Actuators Function Set" anchor="tabafs">
      <ttcol align='left'>Type</ttcol>
      <ttcol align='left'>Path</ttcol>
      <ttcol align='left'>RT</ttcol>
      <ttcol align='left'>IF</ttcol>
      <ttcol align='left'>Data Type</ttcol>
      <c>LED</c>
      <c>/a/{#}/led</c>
      <c>simple.act.led</c>
      <c>core.a</c>
      <c>xsd:boolean</c>
</texttable>

</section>


  </back>
</rfc>

