Project

General

Profile

Actions

Bug #21580

closed

Compute attributes returned from api need to be normalized

Added by Tomáš Strachota about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Compute resources
Target version:
Fixed in Releases:
Found in Releases:

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 2 (1 open1 closed)

Related to Foreman - Bug #22037: Compute attributes create and update API miss validationsNew12/20/2017Actions
Blocks Hammer CLI - Feature #6344: Commands for read operations around compute profiles and attributesClosedTomáš StrachotaActions
Actions

Also available in: Atom PDF