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

IoTHub Manager Deployments API

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

Create deployment

POST /v1/deployments Creating an ADM or Edge deployment.

Basic structure of request:

{
	"DeviceGroupName":"Device Group Name",
	"PackageName":"Package Name",
	"DeviceGroupId":"default_AllDevices",
	"DeviceGroupQuery":"[]",
	"Name":"MyEdgeDeployment",
	"PackageContent":"{...}",
	"Priority":"10",
	"Type":"EdgeManifest"
}

Response

  • Status Code 200 - Deployment created successfully
  • Status Code 400 - Invalid input for example missing deviceGroupQuery.

Get a deployment by id

GET /v1/deployments/{id}

Get deployment details given a specific deployment id.

Example Response

  • Status Code 200 - Successfully found deployment
  • Status Code 400 - Invalid deployment id.
  • Status Code 404 - Deployment not found.
{
    "Id": "deploymentGuid",
    "Name": "testdeployment",
    "CreatedDateTimeUtc": "2019-01-23T20:51:30.9072831Z",
    "DeviceGroupId": "default_AllDevices",
    "DeviceGroupName": "All devices",
    "DeviceGroupQuery": null,
    "PackageContent": null,
    "PackageName": "DeploymentWithName.json",
    "Priority": 10,
    "PackageType": "EdgeManifest",
    "ConfigType": "",
    "Metrics": {
        "SystemMetrics": {
            "appliedCount": 0,
            "targetedCount": 0,
            "reportedSuccessfulCount": 0,
            "reportedFailedCount": 0,
            "pendingCount": 0
        },
        "CustomMetrics": {},
        "DeviceStatuses": null
    },
    "$metadata": {
        "$type": "DevicePropertyList;1",
        "$url": "/v1/deviceproperties"
    }
}

Get all deployments

Retrieves all deployments in the corresponding IoTHub

GET /v1/deployments

Response

  • Status Code 200 - Desc
{
    "Items": [
        {
            "Id": "deploymentGuid",
            "Name": "testdeployment",
            "CreatedDateTimeUtc": "2019-01-23T20:51:30.9072831Z",
            "DeviceGroupId": "default_AllDevices",
            "DeviceGroupName": "All devices",
            "DeviceGroupQuery": null,
            "PackageContent": null,
            "PackageName": "DeploymentWithName.json",
            "Priority": 10,
            "PackageType": "EdgeManifest",
            "ConfigType": "",
            "Metrics": {
                "SystemMetrics": {
                    "appliedCount": 0,
                    "targetedCount": 0
                },
                "CustomMetrics": {},
                "DeviceStatuses": null
            },
            "$metadata": {
                "$type": "DevicePropertyList;1",
                "$url": "/v1/deviceproperties"
            }
        }
    ],
    "$metadata": {
        "$type": "DevicePropertyList;1",
        "$url": "/v1/deviceproperties"
    }
}

Delete deployments

Delete deployment of the given id

DELETE /v1/deployments/{id}

Response

  • Status Code 200 - Successfully deleted deployment.
  • Status Code 400 - Empty id provided.
  • Status Code 404 - Unable to find deployment to delete.