Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

OM2M/Container

Container resource

This resource represents a container for instances. This resource is used as mediator taking care of buffering the data. It makes the exchange abstracted from the need to set direct connections and allows for scenarios where both parties in the exchange are not online at the same time.


Name Type Multiplicity Create Update Response
Id NMTOKEN 1 O NP M
expirationTime DateTime 1 O O M*
accessRightID URI 1 O O O
searchStrings searchStrings 1 O O M
creationTime DateTime 1 NP NP M
lastModifiedTime DateTime 1 NP NP M
announceTo AnnounceTo 1 O O M*
maxNrOfInstances Long 1 O O M*
maxByteSize Long 1 O O M*
maxInstanceAge Duration 1 O O M*
contentInstancesReference NamedReferenceCollection 1 NP NP M
subscriptionsReference NamedReferenceCollection 1 NP NP M

Container XSD schema

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://uri.etsi.org/m2m" xmlns:tns="http://uri.etsi.org/m2m">
  <include schemaLocation="common.xsd" />
  <element name="container" type="tns:Container" />
  <complexType name="Container">
    <all>
      <element ref="tns:expirationTime" minOccurs="0" />
      <element ref="tns:accessRightID" minOccurs="0" />
      <element ref="tns:searchStrings" minOccurs="0" />
      <element ref="tns:creationTime" minOccurs="0" />
      <element ref="tns:lastModifiedTime" minOccurs="0" />
      <element ref="tns:announceTo" minOccurs="0" />
      <element ref="tns:maxNrOfInstances" minOccurs="0" />
      <element ref="tns:maxByteSize" minOccurs="0" />
      <element ref="tns:maxInstanceAge" minOccurs="0" />
      <!--  not defined yet element ref="tns:containerType" minOccurs="0"  -->
      <!-- subresources -->
      <element ref="tns:contentInstancesReference" minOccurs="0" />
      <element ref="tns:subscriptionsReference" minOccurs="0" />
    </all>
    <attribute ref="tns:id"/>
  </complexType>
 
  <element name="maxNrOfInstances" type="long"/>
  <element name="maxByteSize" type="long"/>
  <element name="maxInstanceAge" type="long"/>
</schema>

Create Container

Example Request

POST /scl-id/containers
Host: om2m.laas.fr
Authorization: Basic xxxxxxxxxxxxxxxxxxx
Body:
<om2m:container xmlns:om2m="http://uri.etsi.org/m2m" om2m:id=Id> 
</om2m:container> 

Example Response

HTTP/1.1 201 Created
Content-Type: text/xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<om2m:container xmlns:om2m="http://uri.etsi.org/m2m" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" om2m:id=Id>
    <om2m:accessRightID>scl-id/accessRights/AR_ADMIN</om2m:accessRightID>
    <om2m:searchStrings>
        <om2m:searchString>ResourceType/Container</om2m:searchString>
        <om2m:searchString>ResourceID/Id</om2m:searchString>
    </om2m:searchStrings>
    <om2m:expirationTime>2045-12-24T17:41:05.778+01:00</om2m:expirationTime>
    <om2m:creationTime>2014-04-17T16:54:26.778+02:00</om2m:creationTime>
    <om2m:lastModifiedTime>2014-04-17T16:54:26.778+02:00</om2m:lastModifiedTime>
    <om2m:announceTo>
        <om2m:activated>false</om2m:activated>
        <om2m:global>false</om2m:global>
    </om2m:announceTo>
    <om2m:maxNrOfInstances>10</om2m:maxNrOfInstances>
    <om2m:contentInstancesReference>scl-id/containers/Id/contentInstances</om2m:contentInstancesReference>
    <om2m:subscriptionsReference>scl-id/containers/Id/subscriptions</om2m:subscriptionsReference>
</om2m:container>

Retrieve Container

Example Request

GET /scl-id/containers/Id
Host: om2m.laas.fr
Authorization: Basic xxxxxxxxxxxxxxxxxxx

Example Response

HTTP/1.1 200 OK
Content-Type: text/xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<om2m:container xmlns:om2m="http://uri.etsi.org/m2m" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" om2m:id=Id>
    <om2m:accessRightID>scl-id/accessRights/AR_ADMIN</om2m:accessRightID>
    <om2m:searchStrings>
        <om2m:searchString>ResourceType/Container</om2m:searchString>
        <om2m:searchString>ResourceID/Id</om2m:searchString>
    </om2m:searchStrings>
    <om2m:expirationTime>2045-12-24T17:41:05.778+01:00</om2m:expirationTime>
    <om2m:creationTime>2014-04-17T16:54:26.778+02:00</om2m:creationTime>
    <om2m:lastModifiedTime>2014-04-17T16:54:26.778+02:00</om2m:lastModifiedTime>
    <om2m:announceTo>
        <om2m:activated>false</om2m:activated>
        <om2m:global>false</om2m:global>
    </om2m:announceTo>
    <om2m:maxNrOfInstances>10</om2m:maxNrOfInstances>
    <om2m:contentInstancesReference>scl-id/containers/Id/contentInstances</om2m:contentInstancesReference>
    <om2m:subscriptionsReference>scl-id/containers/Id/subscriptions</om2m:subscriptionsReference>
</om2m:container>

Update Container

Example Request

PUT /scl-id/containers/Id
Host: om2m.laas.fr
Authorization: Basic xxxxxxxxxxxxxxxxxxx
Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<om2m:container xmlns:om2m="http://uri.etsi.org/m2m" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" >
    <om2m:accessRightID>scl-id/accessRights/AR_ADMIN</om2m:accessRightID>
    <om2m:searchStrings>
        <om2m:searchString>ResourceType/Container</om2m:searchString>
        <om2m:searchString>ResourceID/DESCRIPTOR</om2m:searchString>
    </om2m:searchStrings>
    <om2m:maxNrOfInstances>20</om2m:maxNrOfInstances>
</om2m:container>

Example Response

HTTP/1.1 200 OK
Content-Type: text/xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<om2m:container xmlns:om2m="http://uri.etsi.org/m2m" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" om2m:id=Id>
    <om2m:accessRightID>scl-id/accessRights/AR_ADMIN</om2m:accessRightID>
    <om2m:searchStrings>
        <om2m:searchString>ResourceType/Container</om2m:searchString>
        <om2m:searchString>ResourceID/Id</om2m:searchString>
    </om2m:searchStrings>
    <om2m:expirationTime>2045-12-24T17:41:05.778+01:00</om2m:expirationTime>
    <om2m:creationTime>2014-04-17T16:54:26.778+02:00</om2m:creationTime>
    <om2m:lastModifiedTime>2014-04-17T17:08:55.530+02:00</om2m:lastModifiedTime>
    <om2m:announceTo>
        <om2m:activated>false</om2m:activated>
        <om2m:global>false</om2m:global>
    </om2m:announceTo>
    <om2m:maxNrOfInstances>10</om2m:maxNrOfInstances>
    <om2m:contentInstancesReference>gscl/containers/Id/contentInstances</om2m:contentInstancesReference>
    <om2m:subscriptionsReference>scl-id/containers/Id/subscriptions</om2m:subscriptionsReference>
</om2m:container>

Delete Container

Example Request

DELETE /scl-id/containers/Id
Host: om2m.laas.fr
Authorization: Basic xxxxxxxxxxxxxxxxxxx

Example Response

HTTP/1.1 204 No Content

Back to the top