Project

General

Profile

Actions

Bug #13672

open

PUTing protected attributes to /api/v2/hosts/:id results in 500 ISE

Added by Walden Raines over 8 years ago. Updated over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

JSON provided to API (a subset of what was given by a GET to /api/v2/hosts/:id):

{
    "created_at": "2016-01-29 23:27:58 UTC",
    "updated_at": "2016-02-11 13:55:34 UTC",
    "id": 1,
    "interfaces": [{
        "id": 1
    }]
}

The error:

{
  "error": {
    "message": "Can't mass-assign protected attributes for Host::Managed: id, updated_at, created_at, interface_ids" 
  }
}

These protected attributes should be ignored rather than the API complaining about them being provided.

Ultimately, one should be able to provide the exact same JSON received from a GET on /api/v2/hosts/:id back as a PUT without errors.


Related issues 1 (1 open0 closed)

Related to Foreman - Bug #13759: 500 when attempting to update a hostReady For Testing02/17/2016Actions
Actions

Also available in: Atom PDF