Skip to main content
Jump to: navigation, search

OM2M/MembersContent

< OM2M
Revision as of 05:08, 20 May 2014 by Benalaya.sensinov.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MembersContent resource

The membersContent resource does not represent a real resource, it is used to fan-out request to all group members in batch mode. The returned response is a membersContentResponses type, and it is a result of an aggregation of each member response.

MembersContent 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"
    xmlns:xmlmime="http://www.w3.org/2005/05/xmlmime">
    <include schemaLocation="common.xsd" />
    <import namespace="http://www.w3.org/2005/05/xmlmime" schemaLocation="xmlmime.xsd" />
    <element name="membersContentResponses">
        <complexType>
            <sequence>
                <element name="status" minOccurs="0" maxOccurs="unbounded">
                    <complexType>
                            <all>
                                <element name="statusCode" type="string" />
                                <element name="eTag" type="string" minOccurs="0"/>
                                <element name="lastModifiedTime" type="dateTime" minOccurs="0"/>
                                <element name="resultBody" type="xmlmime:base64Binary" minOccurs="0"/>
                                <!-- element name="resultHeaders" type="string" ???? -->
                            </all>
                            <attribute name="id" type="anyURI" />
                    </complexType>
                </element>
            </sequence>
        </complexType>
    </element>
</schema>

Create a resource in Group members

Example Request

POST /scl-id/groups/POST_ALL/membersContent
Host: om2m.laas.fr
Authorization: Basic xxxxxxxxxxxxxxxxxxx
Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<om2m:contentInstance xmlns:om2m="http://uri.etsi.org/m2m" xmlns:ns2="http://www.w3.org/2005/05/xmlmime" om2m:id="CI_TEST">
  <om2m:content ns2:contentType="application/xml">xxxxxxxxxxxxxxxxx</om2m:content>
</om2m:contentInstance>

Example Response

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

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<om2m:membersContentResponses xmlns:om2m="http://uri.etsi.org/m2m" xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
    <om2m:status id="scl-id/applications/APP_0/containers/DATA/contentInstances">
        <om2m:statusCode>STATUS_CREATED</om2m:statusCode>
        <om2m:lastModifiedTime>2014-04-17T20:01:41.477+02:00</om2m:lastModifiedTime>
        <om2m:resultBody>xxxxxxxxxxxxxxxxx</om2m:resultBody>
    </om2m:status>
    <om2m:status id="scl-id/applications/APP_1/containers/DATA/contentInstances">
        <om2m:statusCode>STATUS_CREATED</om2m:statusCode>
        <om2m:lastModifiedTime>2014-04-17T20:01:41.565+02:00</om2m:lastModifiedTime>
        <om2m:resultBody>xxxxxxxxxxxxxxxxx</om2m:resultBody>
    </om2m:status>
</om2m:membersContentResponses>

Retrieve a resource from Group members

Example Request

GET /scl-id/groups/GET_ALL/membersContent
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:membersContentResponses xmlns:om2m="http://uri.etsi.org/m2m" xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
    <om2m:status id="scl-id/applications/APP_0/containers/DATA/contentInstances/latest">
        <om2m:statusCode>STATUS_OK</om2m:statusCode>
        <om2m:lastModifiedTime>2014-04-17T20:19:01.055+02:00</om2m:lastModifiedTime>
        <om2m:resultBody>xxxxxxxxxxxxxxxxx</om2m:resultBody>
    </om2m:status>
    <om2m:status id="scl-id/applications/APP_1/containers/DATA/contentInstances/latest">
        <om2m:statusCode>STATUS_OK</om2m:statusCode>
        <om2m:lastModifiedTime>2014-04-17T20:19:01.064+02:00</om2m:lastModifiedTime>
        <om2m:resultBody>xxxxxxxxxxxxxxxxx</om2m:resultBody>
    </om2m:status>
</om2m:membersContentResponses>

Update a resource of Group members

Example Request

PUT /scl-id/groups/PUT_ALL
Host: om2m.laas.fr
Authorization: Basic xxxxxxxxxxxxxxxxxxx
Body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<om2m:application xmlns:om2m="http://uri.etsi.org/m2m" xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
    <om2m:accessRightID>scl-id/accessRights/AR_ADMIN_2</om2m:accessRightID>
</om2m:application>

Example Response

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

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<om2m:membersContentResponses xmlns:om2m="http://uri.etsi.org/m2m" xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
    <om2m:status id="scl-id/applications/APP_1">
        <om2m:statusCode>STATUS_OK</om2m:statusCode>
        <om2m:lastModifiedTime>2014-04-17T20:44:24.483+02:00</om2m:lastModifiedTime>
        <om2m:resultBody>xxxxxxxxxxxxxxxxx</om2m:resultBody>
    </om2m:status>
    <om2m:status id="scl-id/applications/APP_2">
        <om2m:statusCode>STATUS_OK</om2m:statusCode>
        <om2m:lastModifiedTime>2014-04-17T20:44:24.589+02:00</om2m:lastModifiedTime>
        <om2m:resultBody>xxxxxxxxxxxxxxxxx</om2m:resultBody>
    </om2m:status>
</om2m:membersContentResponses>

Delete a resource in Group members

Example Request

This example aims to delete all application resources which URIs are members in DELETE_ALL group.

DELETE /scl-id/groups/DELETE_ALL/membersContent
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:membersContentResponses xmlns:om2m="http://uri.etsi.org/m2m" xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
    <om2m:status id="scl-id/applications/APP_1">
        <om2m:statusCode>STATUS_OK</om2m:statusCode>
        <om2m:lastModifiedTime>2014-04-17T21:05:47.875+02:00</om2m:lastModifiedTime>
    </om2m:status>
    <om2m:status id="scl-id/applications/APP_2">
        <om2m:statusCode>STATUS_OK</om2m:statusCode>
        <om2m:lastModifiedTime>2014-04-17T21:05:48.006+02:00</om2m:lastModifiedTime>
    </om2m:status>
</om2m:membersContentResponses>

Back to the top