Device to Cloud Command Line Interface Application Commands
Overview
This chapter describes the commands of d2c to manage applications. Most of the commands such as add-application or updatey-application return with a JSON output which data model is described in the d2c client sided domain model
.
Available Commands
| Command | Short | Description |
|---|---|---|
| add-application | aa | Creates a new application object in DMO. |
| get-applications | ga | Gets an application object by its name or id or a list of all application objects from DMO. |
| update-application | ua | Updates the attributes of an application object in DMO. |
| delete-application | da | Deletes an application object by its name or id from DMO. |
d2c you need to configure a DMO access profile and activate it (see Manage DMO access profiles
). Without an active DMO access profile d2c cannot access DMO.Before d2c can drop requests to the DMO API you need to create an oneM2M application entity for d2c in DMO. To do so run the command
d2c add-d2ccli-application
add-application
- Description
- Options
- Global Options
- Samples
With the command d2c add-application you can create new application objects which can be configured to be notified with the received device uplink messages. Such an application can be e.g. the WebHook endpoint of your application.
d2c add-device --name <string> | -n <string>
[--description <string> | -de <string>]
[--application-type <application-type> | -at <application-type>]
[--urls <list-of-urls> | -s <list-of-urls>]
[--connection-properties <json-object> | -cp <json-object>]
[--profile-file <file> | -p <file>]
[--origin <string> | -o <string>]
[--help | -h]
[--debug]
[--info]
[--outfile <filepath>]
[--config-directory <directory>]
[--config-file <file>]
--name <string>, -n <string>
The required --name option defines the unique identifier of the application object.
Valid characters for the application name are: digits (0-9), lower and upper case ascii characters (A-Z and a-z), special characters “-”, “_”.--description <string>, -de <string>
An additonal description for the application.--application-type <application-type>, --at <application-type>
With the option --application-type the type of the application can be defined. As default value webHook is used.
Following application types are currently supported
| Application Type Identifier | Description |
|---|---|
| webHook | HTTP web hook url which can contain also url parameters |
--urls <list-of-urls>, -us <list-of-urls>
With the --urls option you can define one or multiple application urls. In the normal case you only define a single url per application. But for special casses such as debugging multiple urls are supported.
You have the following possibilities to define the list of associated urls:
| Case | Option Sample |
|---|---|
| Define single url | –urls “https://my-company.com/uplink-messages?log-level=info" |
| Define multiple urls | –urls “https://my-company.com/uplink-messages?log-level=info,https://api.scs.iot.telekom.com/message-monitor?print-header=true" |
| Define multiple urls | –urls ‘[“https://my-company.com/uplink-messages?log-level=info”,“https://api.scs.iot.telekom.com/message-monitor?print-header=true”]’ |
--connection-properties <json-object>, -cp <json-object>
With the option --connection-properties you can configure the connection of the application. It is a key/value map as json object. In the case of a webHook application thoses connection properties are the header fields which are attached to each HTTP POST request to forward the received device uplink messages to the application.
--connection-properties '{
"Authorization":"cm9sYW5kLmJhbGRpbkB0ZWxla29tLmRlOlI5OXR0RCM/P3F0P0htJkE=",
"iot-decoding-selector":"adeunis"
}'
--profile-file <file>, -p <file>
DMO access profile file which shall be used instead of the current activated on in the d2c configuration.--origin <string>, -o <string>
Each request to the DMO API requires the HTTP header field X-M2M-ORIGIN. With the option –origin you can overwrite the default value of d2ccli. By convension oneM2M requires that the X-M2M-ORIGIN value is prefixed with a C character. This is done automatically by d2c, so please define the origin without the leading C.
--help, -hDisplays the help for this command.
--infoTurn on info logging.
--debugTurn on debug logging.
--outfile <file>File into which the info or debug outputs shall be written additionaly.
--config-directory <directory>Path to the directory within which the file config.json can be found. By default this directory is
$HOME/.d2c.--config-file <file>Path to the configuration file. By default this path is
$HOME/.d2c/config.json.d2c add-application --name message-monitor-001 \
--application-type webHook \
--urls "https://api.scs.iot.telekom.com/message-monitor?print-header=true" \
--connection-properties '{
"Authorization":"cm9sYW5kLP0htJkE="
}'
{
"id": "68529a2dd6c5ce68589e730a",
"name": "message-monitor-001",
"creationTime": "2025-06-18T10:51:25",
"lastModificationTime": "2025-06-18T10:51:25",
"type": "webHook",
"urls": [
"https://api.scs.iot.telekom.com/message-monitor?print-header=true"
],
"connectionProperties": {
"Authorization": "cm9sYW5kLP0htJkE="
},
"description": null
}
d2c add-application --name message-monitor-002 \
--application-type webHook \
--urls '[
"https://mycompany.com/uplink-messages",
"https://api.scs.iot.telekom.com/message-monitor?print-header=true"
]' \
--connection-properties '{
"Authorization":"cm9sYW5kLP0htJkE="
}'
{
"id": "68529b00740ea8755fe1c19e",
"name": "message-monitor-002",
"creationTime": "2025-06-18T10:54:56",
"lastModificationTime": "2025-06-18T10:54:56",
"type": "webHook",
"urls": [
"https://mycompany.com/uplink-messages",
"https://api.scs.iot.telekom.com/message-monitor?print-header=true"
],
"connectionProperties": {
"Authorization": "cm9sYW5kLP0htJkE="
},
"description": null
}
get-applications
- Description
- Options
- Global Options
- Samples
The command d2c get-applications retrievs information about a single or a list of multiple applications from DMO. To identify a single application you can use the option --name or --id.
d2c get-applications [--name <string> | -n <string> | --id <string> | -i <string>]
[--select <select fields> | -s <select fields>]
[--format <CSV | JSON> | -f <CSV | JSON>]
[--separator-char <char> | -sc <char>]
[--result-content-indicator <rci> | -rci <rci>]
[--limit <int> | -li <int>]
[--offset <int> | -os <int>]
[--profile-file <file> | -p <file>]
[--origin <string> | -o <string>]
[--help | -h]
[--debug]
[--info]
[--outfile <filepath>]
[--config-directory <directory>]
[--config-file <file>]
--name <string>, -n <string>
In case you want to retriev the detail information of specific application you can use the option --name to identify the application.--id <string>, -i <string>
In case you want to retriev the detail information of specific application you can use the option --id to identify the application.--select <select fields>, -s <select fields>
A comma seperated list of element names which shall be selected from the returned objects and written to stdout as CSV or JSON format. To control if the output is written in CSV or JSON format use the –format option. To understand which fields are available to select you can run d2c get-applications without –select option to see which fields are part of the queried devices or you can read the documentation Key Concepts of Device to Cloud
.--format <CSV | JSON>, -f <CSV | JSON>
With the –format option you can control in which format the queried resource objects shall be written to stdout. If you don’t define any select fields with –select option the default format is JSON. If you define select fields with –select option the default format is CSV.--separator-char <char>
If the –select option is used the selected elements are written to the stdout as CSV. With –separator-char you can control which character shall be used to seperate the different fields from each other in the output. By default ; is used as separator character.--result-content-indicator <rci>, -rci <rci>
With the option –result-content-indicator you can control the amount of content which is returned as a result. The following indicators can be used:
| Result content indicator | Short |
|---|---|
| return-nothing | rn |
| return-all | ra |
| return-modified | rm |
| attributes | a |
| attributes-and-children | ac |
| children | c |
--limit <int>, -li <int>
To controll the number of resource objects in the result you can use the option –limit. With the –limit option in combination with the –offset option, you can implement a pagination process to walk through large amounts of resource objects.--offset <int>, -offset <int>
With the –offset option you can define the index or offset of the first object in the response. Normally you use the –offset option together with the –limit option to implement a pagination process.--profile-file <file>, -p <file>
DMO access profile file which shall be used instead of the current activated on in the d2c configuration.--origin <string>, -o <string>
Each request to the DMO API requires the HTTP header field X-M2M-ORIGIN. With the option –origin you can overwrite the default value of d2ccli. By convension oneM2M requires that the X-M2M-ORIGIN value is prefixed with a C character. This is done automatically by d2c, so please define the origin without the leading C.
--help, -hDisplays the help for this command.
--infoTurn on info logging.
--debugTurn on debug logging.
--outfile <file>File into which the info or debug outputs shall be written additionaly.
--config-directory <directory>Path to the directory within which the file config.json can be found. By default this directory is
$HOME/.d2c.--config-file <file>Path to the configuration file. By default this path is
$HOME/.d2c/config.json.d2c get-applications --name scs-message-monitor-002
{
"id": "68502cead2a48861fe1a9463",
"name": "scs-message-monitor-002",
"creationTime": "2025-06-16T14:40:42",
"lastModificationTime": "2025-06-19T13:13:46",
"type": "webHook",
"urls": [
"https://api.scs.iot.telkom.com/message-monitor"
],
"connectionProperties": {
"Authorization": "cm9sYW5kLmJhbGRpbkB0ZWxla"
},
"description": "Prints received messages to stdout of the k8s pod."
}
d2c get-applications --select "name,urls"
rootEntity;[] scs-message-monitor-002;['https://api.scs.iot.telkom.com/message-monitor'] d2c-customer-poa-app121;['https://d2c-customer01-api01.free.beeceptor.com', 'https://d2c-customer01-api02.free.beeceptor.com'] application01-1574;['https://dev.scs.iot.telekom.com/scs-callback-dummy'] application01-1575;['https://dev.scs.iot.telekom.com/scs-callback-dummy']
d2c get-applications --select "name,creationTime" | sort -t';' -k2
application01-1567;2025-06-16 06:40:43 application01-1568;2025-06-16 06:45:29 application01-1569;2025-06-16 07:26:14 application01-1581;2025-06-16 09:02:40 scs-message-monitor-002;2025-06-16 14:40:42
update-application
- Description
- Options
- Global Options
- Samples
With the command d2c update-application you can update the attributes of an existing application.
d2c update-application --name <string> | -n <string>
[--description <string> | -de <string>]
[--urls <list-of-urls> | -s <list-of-urls>]
[--connection-properties <json-object> | -cp <json-object>]
[--profile-file <file> | -p <file>]
[--origin <string> | -o <string>]
[--help | -h]
[--debug]
[--info]
[--outfile <filepath>]
[--config-directory <directory>]
[--config-file <file>]
--name <string>, -n <string>
The required --name option defines the unique identifier of the application. Alternatively you can use --id option instead of --name to identify the application.--id <string>, -i <string>
The required --id option defines the unique identifier of the application. Alternatively you can use --name option instead of --id to identify the application.--description <string>, -de <string>
With --description option you can define the description of the application.--urls <list-of-urls>, -us <list-of-urls>
With the --urls option you can modify the list of application urls. In the normal case you only define a single url per application. But for special casses such as debugging multiple urls are supported.
You have the following possibilities to modify the list of associated urls:
| Case | Option Sample |
|---|---|
| Define single url | –urls “https://my-company.com/uplink-messages?log-level=info" |
| Define multiple urls | –urls “https://my-company.com/uplink-messages?log-level=info,https://api.scs.iot.telekom.com/message-monitor?print-header=true" |
| Define multiple urls | –urls ‘[“https://my-company.com/uplink-messages?log-level=info”,“https://api.scs.iot.telekom.com/message-monitor?print-header=true”]’ |
| Remove url from the list | –urls ‘["-https://api.scs.iot.telekom.com/message-monitor?print-header=true”]’ |
| Remove url from the list | –urls “\-https://api.scs.iot.telekom.com/message-monitor?print-header=true” |
| Add url to the list | –urls “+https://api.scs.iot.telekom.com/message-monitor?print-header=true” |
| Add and remove urls to and from the list in one operation | ["-https://my-company.com/uplink-messages?log-level=info”,"+https://my-company.com/uplink-messages?log-level=debug"]' |
| Remove all urls | –devices “\-*” |
| Remove all urls | –devices ‘["-*"]’ |
--connection-properties <json-object>, -cp <json-object>
With the option --connection-properties you can configure the connection of an application. It is a key/value map as json object. In the case of a webHook application thoses connection properties are the header fields which are attached to each HTTP POST request to forward the received device uplink messages to the application.
--connection-properties '{
"Authorization":"cm9sYW5kLmJhbGRpbkB0ZWxla29tLmRlOlI5OXR0RCM/P3F0P0htJkE=",
"iot-decoding-selector":"adeunis"
}'
To control if a single property shall be added to or deleted from the current map of properties you can prefix the property name with one of the following operation indicators:
| Operation Indicator | Description |
|---|---|
| No operation indicator defaults to + if the the assign value is NOT null. If the assigned values is null the operation indicator defaults to -. | |
| + | Add the property current map of properties. |
| - | Delete the property from the current map of properties. |
To replace the current map of properties with a new one just don’t prefix any propery with an operation indicator.
--profile-file <file>, -p <file>
DMO access profile file which shall be used instead of the current activated on in the d2c configuration.--origin <string>, -o <string>
Each request to the DMO API requires the HTTP header field X-M2M-ORIGIN. With the option –origin you can overwrite the default value of d2ccli. By convension oneM2M requires that the X-M2M-ORIGIN value is prefixed with a C character. This is done automatically by d2c, so please define the origin without the leading C.
--help, -hDisplays the help for this command.
--infoTurn on info logging.
--debugTurn on debug logging.
--outfile <file>File into which the info or debug outputs shall be written additionaly.
--config-directory <directory>Path to the directory within which the file config.json can be found. By default this directory is
$HOME/.d2c.--config-file <file>Path to the configuration file. By default this path is
$HOME/.d2c/config.json.d2c update-application --name scs-message-monitor-002 \
--urls "https://api.scs.iot.telekom.com/message-monitor?print-header=true" \
--description "Prints message and header to stdout of k8s pod"
{
"id": "68502cead2a48861fe1a9463",
"name": "scs-message-monitor-002",
"creationTime": "2025-06-16T14:40:42",
"lastModificationTime": "2025-06-19T14:08:08",
"type": "webHook",
"urls": [
"https://api.scs.iot.telekom.com/message-monitor?print-header=true"
],
"connectionProperties": {
"Authorization": "cm9sYW5kLmJhbGRpbkB0ZWxla"
},
"description": "Prints message and header to stdout of k8s pod"
}
d2c update-application --name scs-message-monitor-002 \
--urls "+https://dev.scs.iot.telekom.com/message-monitor?sent-to-reporting-db=true"
{
"id": "68502cead2a48861fe1a9463",
"name": "scs-message-monitor-002",
"creationTime": "2025-06-16T14:40:42",
"lastModificationTime": "2025-06-19T14:10:52",
"type": "webHook",
"urls": [
"https://api.scs.iot.telekom.com/message-monitor?print-header=true",
"https://dev.scs.iot.telekom.com/message-monitor?sent-to-reporting-db=true"
],
"connectionProperties": {
"Authorization": "cm9sYW5kLmJhbGRpbkB0ZWxla"
},
"description": "Prints message and header to stdout of k8s pod"
}
d2c update-application --name scs-message-monitor-002 \#
--connection-properties '{
"+loglevel":"debug"
}'
{
"id": "68502cead2a48861fe1a9463",
"name": "scs-message-monitor-002",
"creationTime": "2025-06-16T14:40:42",
"lastModificationTime": "2025-06-19T14:13:52",
"type": "webHook",
"urls": [
"https://api.scs.iot.telekom.com/message-monitor?print-header=true",
"https://dev.scs.iot.telekom.com/message-monitor?sent-to-reporting-db=true"
],
"connectionProperties": {
"Authorization": "cm9sYW5kLmJhbGRpbkB0ZWxla",
"loglevel": "debug"
},
"description": "Prints message and header to stdout of k8s pod"
}
d2c update-application --name scs-message-monitor-002 \
--connection-properties '{
"-loglevel": "debug",
"+Authorization": "s78s7s7s7s7s7s7"
}'
{
"id": "68502cead2a48861fe1a9463",
"name": "scs-message-monitor-002",
"creationTime": "2025-06-16T14:40:42",
"lastModificationTime": "2025-06-19T14:16:09",
"type": "webHook",
"urls": [
"https://api.scs.iot.telekom.com/message-monitor?print-header=true",
"https://dev.scs.iot.telekom.com/message-monitor?sent-to-reporting-db=true"
],
"connectionProperties": {
"Authorization": "s78s7s7s7s7s7s7"
},
"description": "Prints message and header to stdout of k8s pod"
}
delete-application
- Description
- Options
- Global Options
- Samples
With the command d2c delete-application you can delete an existing application object by its name or id.
d2c delete-application --name <string> | -n <string> | --id <string> | -i <string>
[--profile-file <file> | -p <file>]
[--origin <string> | -o <string>]
[--help | -h]
[--debug]
[--info]
[--outfile <filepath>]
[--config-directory <directory>]
[--config-file <file>]
--name <string>, -n <string>The required
--name option defines the unique identifier of the application which shall be deleted. Alternatively you can use --id option instead of --name to identify the application.--id <string>, -i <string>The required
--id option defines the unique identifier of the application. Alternatively you can use --name option instead of --id to identify the application.--profile-file <file>, -p <file>DMO access profile file which shall be used instead of the current activated on in the d2c configuration.
--origin <string>, -o <string>Each request to the DMO API requires the HTTP header field
X-M2M-ORIGIN. With the option –origin you can overwrite the default value of d2ccli. By convension oneM2M requires that the X-M2M-ORIGIN value is prefixed with a C character. This is done automatically by d2c, so please define the origin without the leading C.--help, -hDisplays the help for this command.
--infoTurn on info logging.
--debugTurn on debug logging.
--outfile <file>File into which the info or debug outputs shall be written additionaly.
--config-directory <directory>Path to the directory within which the file config.json can be found. By default this directory is
$HOME/.d2c.--config-file <file>Path to the configuration file. By default this path is
$HOME/.d2c/config.json.d2c delete-application --name scs-message-monitor-018
d2c delete-application --id 67e6aa86e9b543a53b197f84