APIs Device to Cloud One M2 M CNT - Container

The container resource (resourceType=3) represents a container for data instances. It is used to share information with other entities and potentially to track the data. A container resource has no associated content. It has only attributes and child resources. For storing data the child resource type contentInstance is used. Also, a container may have one or multiple other container resources as child resources in order to model more complex data structures.

Supported child resources

Child Resources TypeMultiplicityDescription
contentInstance0..n
flexContainer0..nA flexContainer represents a customizable container for data instances that can be extended with so-called custom attributes.
subscription0..nA subscription to a resource allows an entity in the oneM2M architecture to be notified about changes of the subscribed-to resource.
la1
ol1

Universal and common attributes

NameFull NameTypeMultiplicityMode
tyresourceTypem2m:resourceType / integer1RO
riresourceIDm2m:ID / string1RO
rnresourceNamestring1WO
piparentIDm2m:ID / string1RO
lbllabelsm2m:labels / list of string0..1(L)RW
acpiaccessControlPolicyIDsm2m:acpType / list of resourceID0..1(L)RW
ctcreationTimem2m:timestamp1RO
ltlastModifiedTimem2m:timestamp1RO
stateTag1RW
announcedAttribute0..1(L)RW
announceSyncType0..1RW
custodian0..1RW

Mode: RW = Read/Write, RO = Read Only, WO = Write Once

latest and oldest child resources : A container automatically registers two virtual child resource called latest and oldest. These resources allow to access the oldest resp. newest contentInstance resource that the container contains.

Resource specific attributes

NameFull NameMultiplicityModeCreateUpdate
mnimaxNrOfInstances0..1RWOO
mbsmaxByteSize0..1RWOO
miamaxInstanceAge0..1RWOO
cnicurrentNrOfInstances1RONPNP
cbscurrentByteSize1RONPNP

Mode: RW = Read/Write, RO = Read Only, WO = Write Once

Request Optionality: NP = not provisioned, O = optional, M = Mandatory

Attribute: mni (maxNrOfInstances)

Maximum number of direct child contentInstance resources in the container resource. br

Note: The value of this attribute may be limited due to CSE internal constraints and may be changed to a lower value during CREATE and UPDATE.

Attribute: mbs (maxByteSize)

Maximum size in bytes of data (i.e. content attribute of a contentInstance resource) that is allocated for the container resource for all direct child contentInstance resources in the container resource. br

Note: The value of this attribute may be limited due to CSE internal constraints and may be changed to a lower value during CREATE and UPDATE.

Attribute: mia (maxInstanceAge)

Maximum age of a direct child contentInstance resource in the container resource. The value is expressed in seconds. br

Note: The value of this attribute may be limited due to CSE internal constraints and may be changed to a lower value during CREATE and UPDATE.

Attribute: cni (currentNrOfInstances)

Current number of direct child contentInstance resources in the container resource. It is limited by the maxNrOfInstances. The currentNrOfInstances attribute of the container resource shall be updated on successful creation or deletion of direct child contentInstance resource of container resource

Attribute: cbs (currentByteSize)

Current size in bytes of data (i.e. content attribute of a contentInstance resource) stored in all direct child contentInstance resources of a container resource. This is the summation of contentSize attribute values of the contentInstance resources. It is limited by the maxByteSize attribute. The currentByteSize attribute of the container resource shall be updated on successful creation of deletion of direct child contentInstance resource of container resource.

JSON representation example

The following shows a reduced example of a container resource:

{
    "m2m:cnt": {
        "cbs": 0,
        "cni": 0,
        "cr": "CAdmin",
        "ct": "20210202T131157,876558",
        "et": "20220202T131157,876588",
        "lt": "20210202T131157,876558",
        "mbs": 10000,
        "mni": 10,
        "pi": "CHv7RbS50NT",    // Parent's resource ID
        "ri": "cnt902491338455973138",
        "rn": "MyContainerResource",
        "st": 0,
        "ty": 3
    }
}