Remote CSE Registration
Resource Announcements
AE Registration
Running with MQTT Support
URL Mappings
Resource Tree and Deployment Infrastructure Diagram
Upper Tester Support
When a CSE is configured as an MN-CSE of ASN-CSE it can register to a remote CSE, respectively an IN-CSE and MN-CSE can receive connection requests from those CSE types. A <remoteCSE> resource is created in case of a successful registration. A CSE checks regularly the connection to other remote CSEs and removes the remoteCSE if the connection could not been established.
Announced resources and transit requests are supported by the CSE.
You must configure the details of the remote CSE in the configuration file.
When a resource is announced to a remote CSE then access is automatically granted when the announced resource's parent is the CSR of the original resource's hosting CSE.
Whenever a new <AE> registers itself with the CSE (using the originators C or S) then a new originator for that <AE> is created. This originator is the custodian (owner) of that resource and can freely send requests to the <AE> resource.
ACME supports Mca and Mcc communication via MQTT. This binding must be enabled in the configuration file under [client.mqtt].enable (see also Configuration).
ACME does not bring an own MQTT broker. Instead any MQTT broker that supports at least MQTT version 3.1.x can be used. This can be either be an own operated or a public broker installation (see, for example, https://test.mosquitto.org). The connection details need to be configured in the "[client.mqtt]" section as well.
The CSE can generate a diagram with an overview about the hosted resource tree and the current deployment infrastructure of remote CSEs. This is available by sending a GET request as follows:
$ curl localhost:8080/__structure__This returns a PlantUML diagram script:
This feature must be enabled in the configuration file under [server.http].enableStructureEndpoint (see also Configuration).
ATTENTION: Enabling this feature might reveal sensitive data. It should be disabled if not used.
When enabled the http server creates an additional endpoint /__structure__. A GET request to that endpoint returns a diagram description in PlantUML format that can be transformed in images with various tools (for example, with the online editor on the PlantUML website). An optional argument lvl=<int> can be provided to the URL to limit the size of the resource tree in the diagram.
A similar text representation of the resource tree can be retrieved from the endpoint /__structure__/text .
$ curl localhost:8080/__structure__/text
cse-in -> m2m:cb (csi=/id-in) | ri=id-in
├── acpCreateACPs -> m2m:acp | ri=acpCreateACPs
└── CAdmin -> m2m:ae | ri=CAdminThe CSE has limited support for the Upper Tester (UT) test protocol. This protocol is used to trigger a System Under Test (SUT) to perform certain oneM2M operations and other actions. See oneM2M's TS-0019, Abstract Test Suite and Implementation Information for Test specification for further details.
To support this feature an additional endpoint __UT__ is available under the HTTP server's root. It can be enabled by setting the configuration [http].enenableUpperTesterEndpoint in the configuration file to True.
ATTENTION: Only use this feature in a controlled environment. Enabling it may lead to a total loss of data because several internal functions and resources are exposed or can be managed without added security.
The Upper Tester endpoint currently only supports a limited set of the functionality specified in TS-0019, but offers additional functionality, such as sending commands with arguments and receiving return values. The following sections present an overview.
The X-M2M-UTCMD http header field is used to run a command by the CSE itself. The ACME CSE implements these commands as scripts that have the meta tag @uppertester set.
The following commands are available by default, but other can be added. Some of these scripts are used to reconfigure the CSE when running test cases.
| UT Functionality | Description |
|---|---|
| reset | Resets the CSE to its initial state. No other function or operation present in the request is executed. |
| status | Returns the CSE running status in the response header field X-M2M-UTRSP. |
| disableShortRequestExpiration | For running test cases: Disables short request expiration. |
| disableShortResourceExpiration | For running test cases: Disables short resource expiration. |
| enableShortRequestExpiration | For running test cases: Enables short request expiration. |
| enableShortResourceExpiration | For running test cases: Enables short resource expiration. |
In case a command returns a result then this is available in the header field X-M2M-UTRSP of the HTTP response.
This example initiates a reset of the CSE.
The successful execution is indicated by the Response Status Code header X-M2M-RSC: 2000
$ http POST localhost:8080/__ut__ X-M2M-UTCMD:reset
HTTP/1.1 200 OK
Content-Length: 0
Content-Type: text/plain; charset=utf-8
Server: ACME 0.10.0-dev
X-M2M-RSC: 2000This example requests the CSE status. It is returned in the X-M2M-UTRSP header.
$ http POST localhost:8080/__ut__ X-M2M-UTCMD:status
HTTP/1.1 200 OK
Content-Length: 0
Content-Type: text/plain; charset=utf-8
Server: ACME 0.10.0-dev
X-M2M-RSC: 2000
X-M2M-UTRSP: RUNNING