mAttach #
Attach multiple devices to multiple tenants.
The device document will be duplicated inside the tenant "devices" collection.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/device-manager/devices/_mAttach[?refresh=wait_for][&strict]
Method: PUT
Body:{
    // Using JSON
    "records" [{
        "tenantId": "tenant-kuzzle",
        "deviceId": "test-id"
    }],
    // Using CSV syntax
    "csv": "tenantId,deviceId\ntenant-kuzzle,test-id"
}Other protocols #
{
    "controller": "device-manager/device",
    "action": "mAttach",
    "body": {
        // Using JSON
        "records" [{
            "tenantId": "tenant-kuzzle",
            "deviceId": "test-id"
        }],
        // Using CSV syntax
        "csv": "tenantId,deviceId\ntenant-kuzzle,test-id",
    }
}Body properties #
Body properties, must contain at least one of
records: an array of object containingtenantIdanddeviceIdcsv: a csv syntax compatible containing at least this two headerstenantId,deviceIdwith their corresponding values
Optional: #
refresh: if set towait_for, Kuzzle will not respond until the documents are indexedstrict: (boolean) if set, makes the process fail preemptively if at least one link cannot be applied (e.g. devices that aren't attached to a tenant, or because of non-existing assets)
Response #
{
    "status": 200,
    "error": null,
    "controller": "device-manager/device",
    "action": "mAttach",
    "requestId": "<unique request identifier>",
    "result": {
        "errors": [],
        "successes": []
    }
}