Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "OM2M/Container"

(Application Create)
 
(6 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
== Container resource ==
 
== Container resource ==
  
This resource represents a container for instances.  
+
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.
  
 
{{CTable}}
 
{{CTable}}
 
| Name || Type || Multiplicity || Create || Update ||Response
 
| Name || Type || Multiplicity || Create || Update ||Response
 
|-
 
|-
| [[OM2M/Attributes#ID|Id]] || AnyURI || 1 || O || NP || M
+
| [[OM2M/Attributes#ID|Id]] || NMTOKEN || 1 || O || NP || M
 
|-
 
|-
 
| [[OM2M/Attributes#ExpirationTime|expirationTime]] || DateTime || 1 || O || O || M*
 
| [[OM2M/Attributes#ExpirationTime|expirationTime]] || DateTime || 1 || O || O || M*
Line 32: Line 35:
 
|}
 
|}
  
== Container representation ==
+
== Container XSD schema  ==
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Line 64: Line 67:
  
 
== Create Container ==
 
== Create Container ==
 
 
'''Create a container resource'''
 
 
* Synopsis: POST {Well Known URI of the Service}
 
* Request Headers: Authorization, Accept.
 
* Request Body: M.
 
* Response Headers: Content-Type, Content-Length.
 
* Response Message Body: Application.
 
* Response Status: 201, 402, 404, 501.
 
  
 
'''Example Request'''
 
'''Example Request'''
Line 113: Line 106:
  
 
== Retrieve Container ==
 
== Retrieve Container ==
'''Retrieve information about a container resource'''
 
 
* Synopsis: GET {Well Known URI of the Service}
 
* Request Headers: Authorization, Accept.
 
* Request Body: N/A.
 
* Response Headers: Content-Type, Content-Length.
 
* Response Message Body: Application.
 
* Response Status: 200, 402, 404, 501.
 
  
 
'''Example Request'''
 
'''Example Request'''
Line 157: Line 142:
  
 
== Update Container ==
 
== Update Container ==
 +
 +
'''Example Request'''
 +
 +
<pre>
 +
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>
 +
 +
</pre>
 +
 +
'''Example Response'''
 +
 +
<pre>
 +
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>
 +
 +
</pre>
  
 
== Delete Container ==
 
== Delete Container ==
 +
 +
'''Example Request'''
 +
 +
<pre>
 +
DELETE /scl-id/containers/Id
 +
Host: om2m.laas.fr
 +
Authorization: Basic xxxxxxxxxxxxxxxxxxx
 +
</pre>
 +
 +
'''Example Response'''
 +
 +
<pre>
 +
HTTP/1.1 204 No Content
 +
</pre>

Latest revision as of 04:45, 20 May 2014

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