Project

General

Profile

Bug #21580

Compute attributes returned from api need to be normalized

Added by Tomáš Strachota over 5 years ago. Updated over 4 years ago.

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

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 validationsNew2017-12-20
Blocks Hammer CLI - Feature #6344: Commands for read operations around compute profiles and attributesClosed

Associated revisions

Revision 56de025f (diff)
Added by Tomáš Strachota almost 5 years ago

Fixes #21580 - normalize compute attributes (#4980)

Normalizes compute attributes in API show actions. For backwards
compatibility reasons this patch adds a new rabl node instead of
replacing 'vm_attrs'.

Revision 0cab9e6b (diff)
Added by Tomáš Strachota almost 5 years ago

Refs #21580 - require rbvmomi

The compute resource for VMware was using rbvmomi classes wihout
explicitly requiring rbvmomi. That can cause issues in tests.

History

#1 Updated by Tomáš Strachota over 5 years ago

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

#2 Updated by Tomáš Strachota over 5 years ago

  • Description updated (diff)

#3 Updated by The Foreman Bot over 5 years 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 over 5 years ago

  • Target version changed from 1.16.2 to 1.16.1

#5 Updated by Marek Hulán over 5 years ago

  • Target version changed from 1.16.1 to 238

#6 Updated by Tomáš Strachota over 5 years ago

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

#7 Updated by Marek Hulán almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 353

#8 Updated by Tomáš Strachota almost 5 years ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#9 Updated by The Foreman Bot almost 5 years ago

  • Pull request https://github.com/theforeman/foreman/pull/5659 added

Also available in: Atom PDF