Skip to content

Announcing Resources to other CSEs

In a previous article, we discussed how to register a CSE to another CSE. This article will focus on the announcement of resources to other CSEs.

What is Resource Announcement?

Announcing resources is a way to share information and data across the oneM2M network. This allows AEs registered to other CSEs to discover and access these resources and their data without accessing or communicating with the original hosting CSE directly. It is also possible to update attributes in announced resources, which will be reflected in the original resource.

The following diagram illustrates the concept of resource announcement:

Resource Announcement Concept

Figure 1: Resource Announcement Concept

Some properties of resource announcement are:

  • Many resource types are supported for announcement, such as application entities (AE), containers (CNT), content instances (CIN), and many others.
  • Announcements can be made to any CSE in the oneM2M network. Target can be multiple CSEs simultaneously.
  • An announced resource is not a plain copy of the original resource. Only the mandatory attributes and those optional attributes which have been explicitly selected are included in an announced resource. Some attributes are even categorized as non-announcable and are never included in the announced resource.
    The optionality of attributes is specified in the oneM2M standard for each resource type.
  • Updates to the original resource are propagated to the announced resource(s). Similarly, updates to attributes in the announced resource can be propagated back to the original resource, if enabled.
  • Announced resources can be de-announced when they are no longer needed. They are also automatically de-announced when the original resource is deleted.

Announcement Attributes

When announcing a resource, the following attributes from the original resource control the announcement behavior:

announcedTo (at)
The target CSE(s) to which the resource is announced. Without this attribute, a resource will not be announced. This attribute is usually a list of CSE IDs to which the resource is announced. The announced resource will then be created under an announced version of the <CSEBase> resource in the target CSE.
However, the resource ID(s) can also be in SP-relative or absolute format and point to somewhere else in the target CSE's resource tree. In this case, the announced resource will be created at the specified location.

announcedAttribute (aa)
A list of optional attributes from the original resource that should be included in the announced resource. Only attributes that are categorized as optional announceable can be included here. If this attribute is not set, only the mandatory attributes will be included in the announced resource.

announceSyncType (ast)
Controls the synchronization behavior between the announced resource and the original resource. Possible values are:

  • 1 (uni-directional): Updates to the original resource are propagated to the announced resource, but not vice versa.
  • 2 (bi-directional): Updates to both the original resource and the announced resource are propagated to each other.

The default value is 1 (uni-directional).

Replicating the Original Resource Tree

When a resource is announced, the CSE hosting the original resource will try to replicate the original resource's structure in the target CSE(s). This is done by creating the announced resource under the announced version its parent resources in the target CSE.

However, if the original resource's parent resources do not yet exist in the target CSE (ie. they have not been announced yet), the announced resource will be created directly under the announced <CSEBase> resource of the target CSE.

Examples

The following examples illustrate how to work with announced resources. We assume that both CSEs are registered in the oneM2M network.

Announcing a Resource

Consider an AE registered to a hosting CSE (HCSE) that wants to announce one of its AEs to another target CSE (TCSE). The AE creates the AE resource with the following announcement attributes set in addition to the regular attributes:

  • at: "/TCSE" - the CSE ID of the target CSE
  • aa: "lbl" - the optionally announced label attribute should be included in the announced resource
  • ast: "bi-directional" - updates should be synchronized in both directions

The sequence diagram below illustrates the process:

Create a resource with announcement

Figure 2: Create a resource with announcement

After the normal CREATE processing, the "/HCSE" CSE will send a CREATE request to the "/TCSE" CSE to create the announced resource. The "/TCSE" CSE will create the announced resource under its announced <CSEBase> resource, including only the mandatory attributes and the optionally announced label attribute as specified in the announcedAttribute attribute. After this, the "/HCSE" CSE will complete the CREATE processing and return a response to the AE.

The following Python snippet demonstrates how to create/register an AE resource with announcement attributes.

Announcing an AE Resource
import requests

cse_base_url = "http://hcse.example.com:8080/~/id-in/cse-in"

headers = {
    "X-M2M-Origin": "CannouncedTest",         # AE's originator ID
    "Content-Type": "application/json;ty=2",  # Resource type 2 = AE
    "X-M2M-RI": "12345",                      # Request ID
    "X-M2M-RVI": "4"                          # Release version indicator
}

ae_resource = {
    "m2m:ae": {
        "rn": "myAnnouncedAE",
        "api": "N.myApp.001",
        "rr": True,
        "srv": ["4"],
        "lbl": ["aLabel"],                   # Optional label attribute
        "at": ["/TCSE"],                     # Announce to target CSE
        "aa": ["lbl"],                       # Announce 'label' attribute
        "ast": 2                             # Bi-directional synchronization
    }
}

response = requests.post(cse_base_url, json=ae_resource, headers=headers)

Updating an Announcement

The AE now wants to update the label attribute of the original AE resource. Since the resource was announced, this update should also be reflected in the announced resource at the "/TCSE" CSE.

The sequence diagram below illustrates the process:

Update a resource with announcement

Figure 3: Update a resource with announcement

The AE sends a normal UPDATE request to the "/HCSE" CSE with the new label value. The "/HCSE" CSE processes the UPDATE request and then propagates the update to the "/TCSE" CSE, which updates the announced resource accordingly. Finally, the "/HCSE" CSE completes the UPDATE processing and returns a response to the AE.

The following Python snippet extends the previous example by updating the label attribute of the original AE resource:

Update an AE Resource with Announcement
...
headers = {
    "X-M2M-Origin": "CannouncedTest",    # AE's originator ID
    "Content-Type": "application",       # Resource type 2 = AE
    "X-M2M-RI": "12345",                 # Request ID
    "X-M2M-RVI": "4"                     # Release version indicator
}

ae_resource = {
    "m2m:ae": {
        "lbl": ["anotherLabel"]  # Updated label attribute
    }
}

response = requests.put(f"{cse_base_url}/myAnnouncedAE", json=ae_resource, headers=headers)

Updating an Announced Resource

If the announcement synchronization type is set to bi-directional, it is also possible to update attributes in the announced resource at the target CSE. These updates will then be propagated back to the original resource at the hosting CSE.

The sequence diagram below illustrates the process:

Update an announced resource

Figure 4: Update an announced resource

In this example, another AE (AE2) registered to the "/TCSE" CSE wants to update the label attribute of the announced AE resource. The "/TCSE" CSE processes the UPDATE request and then propagates the update back to the "/HCSE" CSE, which updates the original resource accordingly. Finally, the "/TCSE" CSE completes the UPDATE processing and returns a response to AE2.

De-announcing an Resource

To de-announce a resource, the AE can simply delete the announcedTo attribute from the original resource, or by removing an announcement target from that list. This will trigger the hosting CSE to delete the announced resource(s) from the target CSE(s).

Of course, an announced resource can also be de-announced by deleting the original resource itself. This will automatically remove all announced versions of the resource from the target CSEs.

The sequence diagram below illustrates the process of de-announcing a resource by removing the announcedTo attribute:

Unannounce a resource

Figure 5: Unannounce a resource

In this example, the AE sends an UPDATE request to the "/HCSE" CSE to remove the announcedTo attribute from the original AE resource. The "/HCSE" CSE processes the UPDATE request and then sends a DELETE request to the "/TCSE" CSE to delete the announced resource. Finally, the "/HCSE" CSE completes the UPDATE processing and returns a response to the AE.

Update an AE Resource with Announcement
...
ae_resource = {
    "m2m:ae": {
        "at": None  # Remove announcedTo attribute
    }
}

response = requests.put(f"{cse_base_url}/myAnnouncedAE", json=ae_resource, headers=headers)

Summary

Announcing resources to other CSEs in a oneM2M network is a powerful feature that enables resource sharing and data accessibility across different CSEs. By utilizing announcement attributes, AEs can control how their resources are announced, which attributes are included, and how updates are synchronized. This mechanism enhances interoperability and data exchange in IoT applications built on the oneM2M standard.


by Andreas Kraft, 2025-12-22