Apply device profile
Applies a device profile (a saved bundle of sensors, and optionally credentials) to one or more devices. Apply runs as a background job — the tool blocks for up to `poll_timeout_seconds` (default 60s, max 120s) waiting for completion. If the job finishes within that window, per-device results are returned. If it times out, a partial state is returned; you can wait and call this tool again with the same arguments — apply is idempotent in REPLACE mode. IMPORTANT: a successful call does NOT mean every requested device was configured. Report the apply as complete only when `applied_count` covers every requested device; any other count being non-zero means it is not. Consult `retryable` rather than your own judgement before calling again. Devices on collectors you lack the Device Management permission on are skipped: they come back with result WITHHELD and an explanation. Whenever the apply is dispatched, every requested device carries exactly one verdict in `per_device` — OK, FAIL, WITHHELD, NOT_APPLIED (the job did not cover it), UNKNOWN (outcome undeterminable) or PENDING — and the per-verdict counts add up to the devices you asked for. Sometimes no job is created at all — `job_status` is NOT_STARTED, `retryable` is false and calling again cannot change the outcome; the cause varies (every device withheld, no devices matched, the profile has no modules), so relay the `message` instead of assuming a permission problem. `other_issues` carries anything the backend reported about something other than a device; it is normally empty, and a non-empty one is worth relaying rather than ignoring. If the profile contains credential modules, applying it WILL OVERWRITE existing credentials on the targeted devices (the confirmation prompt discloses this when relevant). For applying alert rules to devices, use `bind_alert_rule_to_device` instead. Devices named in `failed_device_ids` carry no reason for their failure; WITHHELD devices, and devices affected by a job that failed or was cancelled as a whole, do carry one. Input-validation and dispatch errors return an `error` with a `message` and `retryable`, and no per-device detail.