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/MembersContent"

(MembersContent resource)
Line 2: Line 2:
 
== MembersContent resource ==
 
== MembersContent resource ==
  
The membersContent resource does not represent a real resource, it is used to fan-out request to all [[OM2M/Group|group]] [[OM2M/Attributes#Members|members]] in batch mode. The returned response is a [[OM2M/Attributes#MembersContentResponses|membersContentResponses]] type, and it is a result of an aggregation of each member response.
+
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  ==
 
== MembersContent XSD schema  ==

Revision as of 05:07, 20 May 2014

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

Create a resource in group members

  • Synopsis: POST {Well Known URI of the Service}
  • Request Headers: Authorization, Accept.
  • Request Body: resourceToCreate.
  • Response Headers: Content-Type, Content-Length.
  • Response Message Body: membersContentResponses.
  • Response Status: 201, 402, 404, 501.

Example Request

This example aims to create a contentInstance in contentInstances collection of POST_ALL group members.

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">PG9iaj4KICA8c3RyIG5hbWU9InR5cGUiIHZhbD0idGVtcGVyYXR1cmUiLz4KICA8c3RyIG5hbWU9InNlbnNvcklkIiB2YWw9InRlbXBlcm
F0dXJlXzEiLz4KICA8c3RyIG5hbWU9ImRhdGEiIHZhbD0iMjIiLz4KICA8c3RyIG5hbWU9InVuaXQiIHZhbD0iY2Vsc3VzIi8+CiAgPHN0ciBuYW1lPSJsb2NhdGlvbiIgdmFsPSJob21lIi8+Cjwvb2JqPg
o=</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

Retrieve information about a group members

  • 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: membersContentResponses.
  • Response Status: 200, 402, 404, 501.

Example Request

This example aims to retrieve the latest contentInstance of all group members.

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

This example aims to update accessRightID attribute of all PUT_ALL group members.

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