Bug #21580

Compute attributes returned from api need to be normalized

Added by Tomáš Strachota 7 months ago. Updated 1 day ago.

Status:Ready For Testing
Priority:Normal
Assigned To:Tomáš Strachota
Category:Compute resources
Target version:Team Marek Iteration 25
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4980
Story points-
Velocity based estimate-

Description

Foreman saves compute attributes as a serialized hash that comes directly from the compute attribute form without any pre-processing. Read API returns that hash as is. This approach has several negative side effects. The API response is significantly different from what foreman standardly returns and is quite difficult to use.

Following issues in compute attributes API responses should be fixed:
  • fileds containing IDs must be named as "*_id"
  • the API must provide "*_name" alternatives for all "*_id" fields (where possible) and vice versa
  • memory and storage sizes must be provided in common format and units
  • empty strings saved from empty form fields must be mapped to nil
  • collections must be consistently returned either as a numbered hash or an array
  • field names must be in snake case
  • boolean values saved as strings like "1", "0", "true", "false" must be casted to true/false
  • nics_attributes vs interfaces_attributes must be consistent

Related issues

Related to Foreman - Bug #22037: Compute attributes create and update API miss validations New 12/20/2017
Blocks Hammer CLI - Feature #6344: Commands for read operations around compute profiles and ... Assigned 06/23/2014

History

#1 Updated by Tomáš Strachota 7 months ago

  • Blocks Feature #6344: Commands for read operations around compute profiles and attributes added

#2 Updated by Tomáš Strachota 7 months ago

  • Description updated (diff)

#3 Updated by The Foreman Bot 7 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4980 added

#4 Updated by Marek Hulán 6 months ago

  • Target version changed from Foreman - Team Marek Iteration 23 to Foreman - Team Marek Iteration 24

#5 Updated by Marek Hulán 5 months ago

  • Target version changed from Foreman - Team Marek Iteration 24 to Team Marek Iteration 25

#6 Updated by Tomáš Strachota 5 months ago

  • Related to Bug #22037: Compute attributes create and update API miss validations added

Also available in: Atom PDF