Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

IoTHub Manager Modules API

Elvin Morales edited this page Jan 24, 2019 · 1 revision

Get a list of modules by query

POST /v1/modules/query

Body should contain the query to search for in the format of the "Where" clause of official IoTHub query string, except keyword WHERE. Example: "deviceId IN ['TestEdgeDevice','OtherEdgeDevice'] AND moduleId = '$edgeAgent'"

Response

  • Returns 200 OK and list of module objects:
{
    "$metadata": {
        "$type": "DeviceList;1",
        "$uri": "/v1/devices"
    },
    "ContinuationToken": null,
    "Items": [
        {
            "Reported": {
                "schemaVersion": "1.0",
                "version": {
                    "version": "1.0.5",
                    "build": "19141174",
                    "commit": "d76e0316c6f324345d77c48a83ce836d09392699"
                },
                "lastDesiredStatus": {
                    "code": 200,
                    "description": ""
                },
                "runtime": {...},
                "systemModules": {
                    "edgeAgent": {...},
                    "edgeHub": {...}
                },
                "lastDesiredVersion": 6,
                "modules": {...}
            },
            "Desired": {
                "schemaVersion": "1.0",
                "runtime": {
                    "type": "docker",
                    "settings": {
                        "loggingOptions": "",
                        "minDockerVersion": "v1.25"
                    }
                },
                "systemModules": {
                    "edgeAgent": {
                        "type": "docker",
                        "settings": {
                            "image": "mcr.microsoft.com/azureiotedge-agent:1.0",
                            "createOptions": ""
                        }
                    },
                    "edgeHub": {...}
                },
                "modules": {...}
            },
            "DeviceId": "TestEdgeDevice",
            "ModuleId": "$edgeAgent"
        }
    ]
}

Get a list of modules by query

GET /v1/modules?query=query Same as above but with the query in the query string.

Response Same as above

Get a module by the deviceId and the moduleId

Retrieve just a single module by the deviceId and moduleId.

GET /v1/modules/deviceId/moduleId

Response

  • Status Code 200 and device module as shown above
  • Status Code 400 missing deviceId or moduleId
  • Status Code 404 DeviceId/moduleId combination not found.