tumblr / collins

groovy kind of love
tumblr.github.com/collins
Apache License 2.0
571 stars 99 forks source link

Allow updating intake attributes via API #485

Closed discordianfish closed 7 years ago

discordianfish commented 7 years ago

Some attributes like POWER_PORT, RACK_POSITION or SERVICE_TAG can only be updated in the webbased intake phase. Since those could be come from a 3rd party system or script, it should be possible to change them via the API.

Right now they can be updated with feature.sloppyTags but using this is discouraged.

byxorna commented 7 years ago

They can be updated when an asset is in "New" status as well (aka performing physical induction again)

discordianfish commented 7 years ago

@byxorna I've tried that, it didn't work. If this is intended, then there is a bug somewhere. I always get an error saying the attribute is restricted. Can you verify it's working even without sloppyTags? The documentation also says RACK_POSITION: Only accepted for New assets during the web based intake process which seems to be correct. You can set them only via the web ui, not the API. I've also chatted with @Primer42 about it and he was surprised about this as well.

byxorna commented 7 years ago

those 3 attributes need to be updated together. (i believe the ruby api calls this set_multi_attribute!). If you take a look at collins source, you will see that it infers you are trying to reinduct a machine when status=New and those 3 attributes are present in the POST.

discordianfish commented 7 years ago

@byxorna Oh! Good to know. Will try this next week. But this isn't documented anywhere, correct?

byxorna commented 7 years ago

@discordianfish yea, i believe not. It is implied in the docs here https://tumblr.github.io/collins/api.html#api-asset-asset-update, but not explicitly called out.

discordianfish commented 7 years ago

Closing this, should be resolved by fixing docs (#484)