Skip to main content

Model

iot model add 
--name=model-name
--project=project-name
[--team="team-name"]
[--desc=model-description]
[--revision=model-revision-name]
[--display-name=model-display-name]
[--display-order=model-display-order]
[--image=model-image-url]
[--icon=model-image-icon]
[--require_position=model-require-position]
[--type=model-type]
[--security=model-security]
[--type=model-type]
[--storage=model-storage]
[--protocol=model-protocol]
[--connection=model-connection]
[--ml=model-ml]
[--hw_version=hardware-version]
[--template=model-template-name]
[--template_id=model-template-id]

iot model list
[--team="team-name"]
[--project=project-name]
[--name=model-name]
[--id=model-id]
[--full]

iot model update
--project=project-name
--name=model-name
[--team="team-name"]
[--desc=model-description]
[--revision=model-revision-name]
[--display-name=model-display-name]
[--display-order=model-display-order]
[--image=model-image-url]
[--icon=model-image-icon]
[--require_position=model-require-position]
[--type=model-type]
[--security=model-security]
[--type=model-type]
[--storage=model-storage]
[--protocol=model-protocol]
[--connection=model-connection]
[--ml=model-ml]
[--hw_version=hardware-version]

iot model delete
[--team="team-name"]
[--project=project-name]
[--name=model-name]
[--id=project-id]

A Model defines a single connected device and its capabilities. One or more Models may be defined inside a single Project.

Model names must be unique within the project and mapped to directory names in the Command-language interface. Using only upper and lower-case ASCII characters, numbers, or underlines in the naming scheme is recommended.

tip

You can avoid having to enter the --team parameter for every command by defining the IOT_TEAM environment variable. This is highly recommended. The following examples assume that the IOT_TEAM variable is set ahead of time, so it will not be needed for each command.

You can skip entering every project name by specifying the environment variable IOT_PROJECT.

On Mac:

> export IOT_TEAM="my-team-name"
> export IOT_PROJECT="my-project"
> iot model list

On Windows:

> $env:IOT_TEAM="my-team-name"
> $env:IOT_PROJECT="my-project"
> iot model list

iot model add

iot model add 
--name=model-name
--project=project-name
[--team="team-name"]
[--desc=model-description]
[--revision=model-revision-name]
[--display-name=model-display-name]
[--display-order=model-display-order]
[--image=model-image-url]
[--icon=model-image-icon]
[--require_position=model-require-position]
[--type=model-type]
[--security=model-security]
[--type=model-type]
[--storage=model-storage]
[--protocol=model-protocol]
[--connection=model-connection]
[--ml=model-ml]
[--hw_version=hardware-version]
[--template=model-template-name]
[--template_id=model-template-id]

Adds a single Model to a Project. Model names MUST be unique within the project. Model names are mapped to directory names in the Command-language-interface.

Using only upper- and lower-case ASCII characters, numbers, or underlines in the naming scheme is recommended.

Parameters:

ParameterValueDefinition
--projectProject Name(Required) name of 'project' to create. Alternately, define an environment variable IOT_PROJECT with the project's name.
--nameModel Name(Required) name of 'model' to create.
--descDescriptionOptional description to attach to model.
--revisionRevision NameOptional Model revision. Recommend using SemVer triple format (i.e. 1.0.3)
--display_nameModel Display NameOptional human-readable name of model.
--display_orderModel Display OrderOptional integer value to list Models in a given sequence.
--imageModel Image URLOptional URL where to download a public image for the model.
--iconModel Icon Image URLOptional URL where a small icon for the model can be downloaded publicly.
--require_position         Require PositionOptional - Model Requires Position Data to be specified.
--typeModel TypeDefaults to 'device' -- see section on Model Types.
--securityModel SecurityDefaults to 'device' -- see section on Model Security.
--storageModel StorageDefaults to 'none' -- see section on Model Storage.
--protocolModel ProtocolDefaults to 'mqtt' -- see section on Model Protocol.
--connectionModel ConnectionDefaults to 'direct' -- see section on Model Connection.
--mlModel MLDefaults to 'none' -- see section on Model ML.
--hw_versionHardware VersionModel hardware version (in SemVer format).
--templateModel Template NameOptionally create a model based on a model template.
--template_idModel Template IDOptionally create a model based on a model template ID.

The simplest way to create a Model is to provide a name and a project:

> iot add --project=my-project --name=my_model_name

You can also create a model based on a Template. Templates pre-define the model and one or more associated Datatypes. This allows you to create a model with all the necessary definitions with a single command line.

> iot add model --project=my_project_name --model=my_model_name --template=my_model_template

An alternative way to specify a template is to use its template_id:

> iot add model --project=my_project_name --model=my_model_name --template_id=0234234242...

iot model list

iot model list 
[--team="team-name"]
[--project=project-name]
[--name=model-name]
[--id=model-id]
[--full]

Use the list command to get a list of all models. You can request specific models by name or ID and whether to get detailed information about a single model. Add the -- full flag to get detailed information on a single project.

Parameters:

ParameterValueDefinition
--project      Project Name(Required) name of 'project' to create. Alternately, define an environment variable IOT_PROJECT with the project's name.
--nameModel Name(Required) name of 'model' to create.
--idModel IDID of the model to list.
--fullFlagIf specified, it will display full information on a single model.

To get a list of all models in a project:

> iot model list --project=my-project-name

To get information on a single model by name:

> iot model list --project=my-project-name --name=my-model-name

To get information on a single model by ID:

> iot model list --id=model-id

To get complete information on a single model, specify either name or id and a --full flag:

> iot model list --project=my-project-name --name=my-model-name --full

Or

> iot model list --id=my-model-id --full

iot model update

iot [--team="team-name"] model update --project=project-name --name=model-name
[--desc=model-description] [--revision=model-revision-name]
[--display-name=model-display-name] [--display-order=model-display-order]
[--image=model-image-url] [--icon=model-image-icon]
[--require_position=model-require-position] [--type=model-type]
[--security=model-security] [--type=model-type]
[--storage=model-storage] [--protocol=model-protocol]
[--connection=model-connection] [--ml=model-ml]
[--hw_version=hardware-version]

Most attributes of a Model (other than the ID value and templates used to create) can be modified if needed. To alter a Model name, the ID needs to be specified.

Parameters:

ParameterValueDefinition
--projectProject Name(Required) name of 'project' to update. Alternately, define an environment variable IOT_PROJECT with the project's name.
--nameModel Name(Required) name of 'model' to update.
--descDescriptionOptional description to attach to model.
--revisionRevision NameOptional Model revision. Recommend using SemVer triple format (i.e. 1.0.3)
--display_nameModel Display NameOptional human-readable name of model.
--display_orderModel Display OrderOptional integer value that can be used to list Models in a given sequence.
--imageModel Image URLOptional URL where an image for the model can be downloaded publicly.
--iconModel Icon Image URLOptional URL where a small icon for the model can be downloaded publicly.
--require_position           Require PositionOptional - Model Requires Position Data to be specified.
--typeModel TypeDefaults to 'device' -- see section on Model Types.
--securityModel SecurityDefaults to 'device' -- see section on Model Security.
--storageModel StorageDefaults to 'none' -- see section on Model Storage.
--protocolModel ProtocolDefaults to 'mqtt' -- see section on Model Protocol.
--connectionModel ConnectionDefaults to 'direct' -- see section on Model Connection.
--mlModel MLDefaults to 'none' -- see section on Model ML.
--hw_versionHardware VersionModel hardware version (in SemVer format).

iot model delete

iot model delete 
[--team="team-name"]
[--project=project-name]
[--name=model-name]
[--id=project-id]
caution

WARNING: deleting a model is a highly destructive operation and should only be performed with care. This operation cascades to delete all related entities, including device instances, datatypes, etc.

If applicable, it will also remove related resources like AWS IOT Things, certificates, and policies.

Parameters

ParameterValueDefinition
--project     Project Name(Required) name of project. Alternately, define an environment variable IOT_PROJECT with the project's name.
--idModel IDID of the model to delete.
--nameModel NameName of an existing model to delete.

To delete a model, use:

> iot model delete --project=my-project-name --name=my-model-name

Or

> iot model delete --id=my-model-id