Open scout208 opened 3 years ago
@valluriraj @yang-hai-feng @prbans
@scout208, the error looks like shows can't read input file, can you try to create a local json file(request.json) with
{
"schemaVersion": "1.0",
"items": [
{
"id": "$edgeAgent",
"filter": {
"tail": 10
}
}
],
"encoding": "none",
"contentType": "text"
}
Execute command
az iot central device command run -n {appid} -d {deviceid} -i {interfaceid} --cn 'GetModuleLogs' -k "request.json"
BTW, would you please also provide the request id that CLI output?
@yang-hai-feng I've tried it with a file instead and now I'm getting this response:
{'code': 'NotFound', 'message': 'The requested resource was not found. You can contact support at https://aka.ms/iotcentral-support. Please include the following information. Request ID: 1rdzkqj5, Time: Thu, 03 Jun 2021 23:02:01 GMT.', 'requestId': '1rdzkqj5', 'time': 'Thu, 03 Jun 2021 23:02:01 GMT'}
Unfortunately I closed my old Powershell session and I can't find the request ID of my original request. But, changing it to a file payload seems to have gotten a different result anyways.
Checked the backend logs, looks like the resource was not found for "b0qynpqqpkv", is "b0qynpqqpkv" your device id or interface name?
That's my interface id I got from the device template
@scout208, would you please share with me your device template? try to figure out the root cause, but all my local created template is working.
@yang-hai-feng Yes, is there a way to download it somehow? I only know how to access it through the web portal and I'd like to avoid having to screenshot every page if possible.
Click on your device template name, and choose the top level of the model, click export, if it's not feasible to share here, you can send to my email: hayang@microsoft.com.
Okay here is my device template:
[
{
"@id": "dtmi:d8bbddxvps:capabilitymodel:b0qynpqqpkv;4",
"@type": "Interface",
"contents": [
{
"@id": "dtmi:d8bbddxvps:capabilitymodel:b0qynpqqpkv:ZeroPositions;1",
"@type": [
"Relationship",
"EdgeModule"
],
"displayName": {
"en": "ZeroPositions"
},
"maxMultiplicity": 1,
"name": "ZeroPositions",
"target": [
"dtmi:d8bbddxvps:ZeroPositions;1"
]
},
{
"@id": "dtmi:d8bbddxvps:capabilitymodel:b0qynpqqpkv:License;1",
"@type": [
"Relationship",
"EdgeModule"
],
"displayName": {
"en": "License"
},
"maxMultiplicity": 1,
"name": "License",
"target": [
"dtmi:d8bbddxvps:License;1"
]
}
],
"displayName": {
"en": "Azure IoT Edge Capability Model b0qynpqqpkv"
},
"@context": [
"dtmi:iotcentral:context;2",
"dtmi:dtdl:context;2"
]
},
{
"@id": "dtmi:d8bbddxvps:ZeroPositions;1",
"@type": "Interface",
"contents": [],
"displayName": {
"en": "Module ZeroPositions"
},
"extends": [
"dtmi:d8bbddxvps:ZeroPositions:manage;1"
],
"@context": [
"dtmi:iotcentral:context;2",
"dtmi:dtdl:context;2"
]
},
{
"@context": [
"dtmi:iotcentral:context;2",
"dtmi:dtdl:context;2"
],
"@id": "dtmi:d8bbddxvps:ZeroPositions:manage;1",
"@type": [
"Interface",
"NamedInterface"
],
"contents": [
{
"@id": "dtmi:d8bbddxvps:ZeroPositions:manage:YawZero;1",
"@type": "Property",
"displayName": {
"en": "YawZero"
},
"name": "YawZero",
"schema": "double",
"writable": true
},
{
"@id": "dtmi:d8bbddxvps:ZeroPositions:manage:PitchZero;1",
"@type": "Property",
"displayName": {
"en": "PitchZero"
},
"name": "PitchZero",
"schema": "double",
"writable": true
},
{
"@id": "dtmi:d8bbddxvps:ZeroPositions:manage:RotatorZero;1",
"@type": "Property",
"displayName": {
"en": "RotatorZero"
},
"name": "RotatorZero",
"schema": "double",
"writable": true
},
{
"@id": "dtmi:d8bbddxvps:ZeroPositions:manage:FeedZero;1",
"@type": "Property",
"displayName": {
"en": "FeedZero"
},
"name": "FeedZero",
"schema": "double",
"writable": true
}
],
"displayName": {
"en": "Manage"
},
"name": "management"
},
{
"@id": "dtmi:d8bbddxvps:License;1",
"@type": "Interface",
"contents": [],
"displayName": {
"en": "Module License"
},
"extends": [
"dtmi:d8bbddxvps:License:manage;1"
],
"@context": [
"dtmi:iotcentral:context;2",
"dtmi:dtdl:context;2"
]
},
{
"@context": [
"dtmi:iotcentral:context;2",
"dtmi:dtdl:context;2"
],
"@id": "dtmi:d8bbddxvps:License:manage;1",
"@type": [
"Interface",
"NamedInterface"
],
"contents": [
{
"@id": "dtmi:d8bbddxvps:License:manage:Type;1",
"@type": "Property",
"displayName": {
"en": "Type"
},
"name": "Type",
"schema": "string",
"writable": true
},
{
"@id": "dtmi:d8bbddxvps:License:manage:ExpirationDate;1",
"@type": "Property",
"displayName": {
"en": "ExpirationDate"
},
"name": "ExpirationDate",
"schema": "string",
"writable": true
},
{
"@id": "dtmi:d8bbddxvps:License:manage:IsActive;1",
"@type": "Property",
"displayName": {
"en": "IsActive"
},
"name": "IsActive",
"schema": "boolean",
"writable": true
}
],
"displayName": {
"en": "Manage"
},
"name": "management"
}
]
@scout208 , Edge command is not supported in CLI today, we are still working on this feature support, will get you updated once the new version released.
@scout208, we just released edge support a recent version of CLI extensions which had edge support on device, please check az iot central device edge -h
on latest iot extensions.
Docs: https://docs.microsoft.com/en-us/cli/azure/iot/central/device/edge?view=azure-cli-latest
Describe the bug
Trying to run the GetModuleLogs command on an IoT Central device throws an exception. See the trace below.
Command Name
az iot central device command run Extension Name: azure-iot. Version: 0.10.11.
Errors:
To Reproduce:
Expected Behavior
This command should return the logs from the module.
Environment Summary
Additional Context