az dt model
Note
This reference is part of the azure-iot extension for the Azure CLI (version 2.59.0 or higher). The extension will automatically install the first time you run an az dt model command. Learn more about extensions.
Manage DTDL models and definitions on a Digital Twins instance.
Commands
Name | Description | Type | Status |
---|---|---|---|
az dt model create |
Uploads one or more models. |
Extension | GA |
az dt model delete |
Delete a model. A model can only be deleted if no other models reference it. |
Extension | GA |
az dt model delete-all |
Delete all models within a Digital Twins instance. |
Extension | GA |
az dt model list |
List model metadata, definitions and dependencies. |
Extension | GA |
az dt model show |
Retrieve a target model or model definition. |
Extension | GA |
az dt model update |
Updates the metadata for a model. Currently a model can only be decommisioned. |
Extension | GA |
az dt model create
Uploads one or more models.
--models can be inline json or file path. Size of input model set (ontology) is constrained by max number of models which the DT instance can store (default is 10000 models).
az dt model create --dt-name --dtn
[--failure-policy --fp {None, Rollback}]
[--fd --from-directory]
[--max-models-per-batch --mmpb]
[--models]
[--resource-group]
Examples
Bulk upload all .json or .dtdl model files from a target directory. Model processing is recursive.
az dt model create -n {instance_or_hostname} --from-directory {directory_path}
Upload model json inline or from file path.
az dt model create -n {instance_or_hostname} --models {file_path_or_inline_json}
Required Parameters
Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Indicates the failure policy when an error occurs while processing a models batch. In the 'Rollback' mode all models created in previous batches are deleted one at a time. When selected as 'None' the models created in previous batches are not deleted from DT instance.
Property | Value |
---|---|
Parameter group: | Models Input Arguments |
Default value: | Rollback |
Accepted values: | None, Rollback |
The directory JSON model files will be parsed from. Please Note: Models are created atomically when directory contains 250 or lesser models, hence in case of an error none of the models get created.Input model set is chunked & created in batches when directory has more than 250 models(API limit). In case of an error processing a batch, the behavior is determined by the --failure-policy parameter.
Property | Value |
---|---|
Parameter group: | Models Input Arguments |
The maximum model size per batch when creating more than 250 models.Reduce this number to prevent a DTDLParser error.
Property | Value |
---|---|
Parameter group: | Models Input Arguments |
Default value: | 30 |
Inline model JSON or file path to model JSON. Please Note: Models are created atomically when model JSON contains 250 or lesser models, hence in case of an error none of the models get created.Input model set is chunked & created in batches when model JSON has more than 250 models(API limit). In case of an error processing a batch, the behavior is determined by the --failure-policy parameter.
Property | Value |
---|---|
Parameter group: | Models Input Arguments |
Digital Twins instance resource group. You can configure the default group using az configure --defaults group={name}
.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az dt model delete
Delete a model. A model can only be deleted if no other models reference it.
az dt model delete --dt-name --dtn
--dtmi --model-id
[--resource-group]
Examples
Delete a target model.
az dt model delete -n {instance_or_hostname} --dtmi "dtmi:com:example:Floor;1"
Required Parameters
Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.
Digital Twins model Id. Example: dtmi:com:example:Room;2.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Digital Twins instance resource group. You can configure the default group using az configure --defaults group={name}
.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az dt model delete-all
Delete all models within a Digital Twins instance.
Twins configurations are not affected but may be broken without model definitions.
az dt model delete-all --dt-name --dtn
[--resource-group]
[--yes]
Examples
Delete all models.
az dt model delete-all -n {instance_or_hostname}
Required Parameters
Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Digital Twins instance resource group. You can configure the default group using az configure --defaults group={name}
.
Do not prompt for confirmation.
Property | Value |
---|---|
Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az dt model list
List model metadata, definitions and dependencies.
az dt model list --dt-name --dtn
[--def --definition {false, true}]
[--dependencies-for]
[--resource-group]
Examples
List model metadata
az dt model list -n {instance_or_hostname}
List model definitions
az dt model list -n {instance_or_hostname} --definition
List dependencies of particular pre-existing model(s). Space separate dtmi values.
az dt model list -n {instance_or_hostname} --dependencies-for {model_id0} {model_id1}
Required Parameters
Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The operation will retrieve the model definition.
Property | Value |
---|---|
Default value: | False |
Accepted values: | false, true |
The set of models which will have their dependencies retrieved. If omitted, all models are retrieved. Format is a whitespace separated list.
Digital Twins instance resource group. You can configure the default group using az configure --defaults group={name}
.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az dt model show
Retrieve a target model or model definition.
az dt model show --dt-name --dtn
--dtmi --model-id
[--def --definition {false, true}]
[--resource-group]
Examples
Show model meta data
az dt model show -n {instance_or_hostname} --dtmi "dtmi:com:example:Floor;1"
Show model meta data and definition
az dt model show -n {instance_or_hostname} --dtmi "dtmi:com:example:Floor;1" --definition
Required Parameters
Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.
Digital Twins model Id. Example: dtmi:com:example:Room;2.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The operation will retrieve the model definition.
Property | Value |
---|---|
Default value: | False |
Accepted values: | false, true |
Digital Twins instance resource group. You can configure the default group using az configure --defaults group={name}
.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az dt model update
Updates the metadata for a model. Currently a model can only be decommisioned.
az dt model update --dt-name --dtn
--dtmi --model-id
[--decommission {false, true}]
[--resource-group]
Examples
Decommision a target model
az dt model update -n {instance_or_hostname} --dtmi "dtmi:com:example:Floor;1" --decommission
Required Parameters
Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.
Digital Twins model Id. Example: dtmi:com:example:Room;2.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Indicates intent to decommission a target model.
Property | Value |
---|---|
Accepted values: | false, true |
Digital Twins instance resource group. You can configure the default group using az configure --defaults group={name}
.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |