模块孪生 JSON 架构Module twin JSON schema

设备孪生是存储设备状态信息(包括元数据、配置和条件)的 JSON 文档。Device twins are JSON documents that store device state information including metadata, configurations, and conditions. Azure IoT 中心为连接到 IoT 中心的每台设备保留一个设备孪生。Azure IoT Hub maintains a device twin for each device that you connect to IoT Hub. 有关详细说明,请参阅了解并在 IoT 中心内使用模块孪生For detailed explanation, see Understand and use module twins in IoT Hub

本主题介绍 IoT Edge 上的实时视频分析的模块孪生 JSON 架构。This topic describes module twin JSON schema of Live Video Analytics on IoT Edge.

备注

若要有权访问媒体服务资源和媒体服务 API,必须先进行身份验证。To be authorized to access Media Services resources and the Media Services API, you must first be authenticated. 有关详细信息,请参阅访问 Azure 媒体服务 APIFor more information, see Accessing the Azure Media Services API.

模块孪生属性Module twin properties

IoT Edge 上的实时视频分析公开以下模块孪生属性。Live Video Analytics on IoT Edge exposes the following module twin properties.

属性Property 必须Required 动态Dynamic 说明Description
applicationDataDirectoryapplicationDataDirectory Yes No 用于持久配置的已装入卷的路径。Path to a mounted volume for persisting configuration.
azureMediaServicesArmIdazureMediaServicesArmId Yes No 媒体服务帐户的唯一 Azure 资源管理器标识符。Unique Azure Resource Manage identifier for the Media Services Account.
aadTenantIdaadTenantId Yes No 客户 Azure AD 租户 ID。Customer Azure AD Tenant ID.
aadServicePrincipalAppIdaadServicePrincipalAppId “是”Yes “是”Yes 客户创建的 Azure AD AppId。Customer created Azure AD AppId.
aadServicePrincipalCertificateaadServicePrincipalCertificate *Yes* Yes 客户创建的 Azure AD AppId 证书。Customer created Azure AD AppId certificate.
aadServicePrincipalPasswordaadServicePrincipalPassword *Yes* Yes 客户创建的 Azure AD AppId 密码。Customer created Azure AD AppId password.
aadEndpointaadEndpoint No No 特定于云的 Azure AD 终结点。Cloud-specific Azure AD endpoint.
默认:https://login.chinacloudapi.cnDefault: https://login.chinacloudapi.cn
aadResourceIdaadResourceId No No 特定于云的 Azure AD 受众/资源 IDCloud-specific Azure AD audience/resource ID
默认:https://management.core.chinacloudapi.cn/Default: https://management.core.chinacloudapi.cn/
armEndpointarmEndpoint No No 特定于云的 Azure 资源管理器终结点。Cloud-specific Azure Resource Manage endpoint.
默认:https://management.chinacloudapi.cn/Default: https://management.chinacloudapi.cn/
diagnosticsLeveldiagnosticsLevel No Yes 事件详细程度:Events verbosity:
信息 ❘ 警告 ❘ 错误 ❘ 严重 ❘ 无Information ❘ Warning ❘ Error ❘ Critical ❘ None
diagnosticsEventsOutputNamediagnosticsEventsOutputName No Yes 诊断事件的中心输出。Hub output for diagnostics events.
(空表示未发布诊断)(Empty means diagnostics are not published)
operationalEventsOutputNameoperationalEventsOutputName No Yes 操作事件的中心输出。Hub output for operational events.
(空表示未发布操作事件)(Empty means operational events are not published)
logLevellogLevel No Yes 下列类型作之一:One of the following:
· 详细· Verbose
· 信息(默认值)· Information (Default)
· 警告· Warning
· 错误· Error
· 无· None
logCategorieslogCategories No Yes 以下内容的逗号分隔列表:应用程序、MediaPipeline、事件A comma-separated list of the following: Application, MediaPipeline, Events
默认值:应用程序、事件Default: Application, Events
debugLogsDirectorydebugLogsDirectory No Yes 调试日志的目录。Directory for debug logs. 如果存在则生成日志,如果不存在则禁用调试日志。If present logs are generated, if not present debug logs are disabled.

*必须提供服务主体证书或密码。*You MUST provide either service principal certificate or password.

无需重启模块即可更新动态属性。Dynamic properties can be updated without the restarting the module. 可按照访问媒体服务 API 一文中的说明,获取其中几个属性的值。You can obtain the values for several of these properties by following the instruction in the Getting access to Media Services API article.

有关可选诊断设置的角色的详细信息,请参阅监视和日志记录See the article on Monitoring and logging for more information about the role of the optional diagnostics settings.

{ 
    "properties.desired": { 
        // Required 
        "applicationDataDirectory": "/var/lib/azuremediaservices", 
        "azureMediaServicesArmId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/<rgname>/providers/microsoft.media/mediaservices/<ams_account>", 
        "aadTenantId": "00000000-0000-0000-0000-000000000000", 
        "aadServicePrincipalAppId": "00000000-0000-0000-0000-000000000000", 
        "aadServicePrincipalPassword": "{Service principal password}", 

        // Optional API Access 
        "aadEndpoint": "https://<aad-endpoint>", 
        "aadResourceId": "https://management.core.chinacloudapi.cn/", 
        "armEndpoint": "https://management.chinacloudapi.cn/", 
        
        // Optional Diagnostics 
        "diagnosticsEventsOutputName": "lvaEdgeDiagnostics",
        "operationalEventsOutputName": "lvaEdgeOperational",
        "logLevel": "Information",
        "logCategories": "Application,Events"
    } 
} 

后续步骤Next steps

直接方法Direct methods