2

I am trying to create attribute in flexcontainer in oneM2M, i have created container and contentinstance in oneM2M. Now I need to use flexcontainer.

1 Answers1

0

I guess from your question that you try to directly create a <flexContainer> resource. That is not possible. The <flexContainer> can be viewed as an "abstract base class" that needs to be further specified. In oneM2M these derived resource types are called specialisations. A specialisation takes all the resource specific attributes from the <flexContainer> and adds the custom attributes that actually represent the functional part. This specialisation can now be created, retrieved etc like any other resource.

Take, for example, the clock specialisation that is defined in oneM2M's TS-0023 document. It adds three new custom attributes, namely currentTime, currentDate, and currentTimeZone in order to represent a clock functionality.

Please note that the CSE implementation you are using needs to support the <flexContainer> resource type in general, and the specific specialisations you want to use. If you want to create your own specialisations then the CSE must support user-defined specialisations and their validations as well.

The oneM2M specifications are available here: https://www.onem2m.org/technical/published-specifications

Andreas Kraft
  • 3,754
  • 1
  • 30
  • 39
  • Thank you very much for sharing the resource link. – Shubham Borghare Dec 28 '21 at 02:05
  • could you please help me with this error? – Shubham Borghare Dec 28 '21 at 02:28
  • {"m2m:dbg": "Release Version Indicator is missing in request, falling back to RVI='1'. But Release Version '1' is not supported. Use RVI with one of ['2a', '3', '4']."} – Shubham Borghare Dec 28 '21 at 02:29
  • I assume that you are using http to access the CSE. In this case you need to add a header "X-M2M-RVI:3" to your request. This indicates the specification version number used. Instead of 3 you can use any of the indicated strings from the debug message. Please Check also the basic introduction at https://www.onem2m.org/using-onem2m/developers/api#n2c – Andreas Kraft Dec 28 '21 at 13:04