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 Type | Multiplicity | Description |
---|---|---|
contentInstance | 0..n | |
flexContainer | 0..n | A flexContainer
represents a customizable container for data instances that can be extended with so-called custom attributes. |
subscription | 0..n | A subscription
to a resource allows an entity in the oneM2M architecture to be notified about changes of the subscribed-to resource. |
la | 1 | |
ol | 1 |
Universal and common attributes
Name | Full Name | Type | Multiplicity | Mode |
---|---|---|---|---|
ty | resourceType | m2m:resourceType / integer | 1 | RO |
ri | resourceID | m2m:ID / string | 1 | RO |
rn | resourceName | string | 1 | WO |
pi | parentID | m2m:ID / string | 1 | RO |
lbl | labels | m2m:labels / list of string | 0..1(L) | RW |
acpi | accessControlPolicyIDs | m2m:acpType / list of resourceID | 0..1(L) | RW |
ct | creationTime | m2m:timestamp | 1 | RO |
lt | lastModifiedTime | m2m:timestamp | 1 | RO |
stateTag | 1 | RW | ||
announcedAttribute | 0..1(L) | RW | ||
announceSyncType | 0..1 | RW | ||
custodian | 0..1 | RW |
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
Name | Full Name | Multiplicity | Mode | Create | Update |
---|---|---|---|---|---|
mni | maxNrOfInstances | 0..1 | RW | O | O |
mbs | maxByteSize | 0..1 | RW | O | O |
mia | maxInstanceAge | 0..1 | RW | O | O |
cni | currentNrOfInstances | 1 | RO | NP | NP |
cbs | currentByteSize | 1 | RO | NP | NP |
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
}
}