stack list filter keys inconsistent with stack views

Bug #1461838 reported by Qiming Teng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Qiming Teng

Bug Description

For some reasons, we do a stack object format before returning the result to users. This format is causing some confusion from API users' perspective. For example, a user will see the following map when doing stack_show or stack_list:

  {
   'stack': {
    'stack_name': ...,
    'stack_action': ...,
    'stack_status': ...,
    'stack_status_reason': ...,
    'stack_owner': ...,
    'parent': ...,
  }

When a user sees this, they may believe that a stack has a 'stack_name' property that can be used as filter key, but that is not true. Instead, when they do filtering in stack list, they need to specify the following keys respectively:

  name -> stack_name
  action -> stack_action
  status -> stack_status
  username -> stack_owner
  owner_id -> parent

 This is causing some problems in projects that invoke Heat apis.

Qiming Teng (tengqim)
Changed in heat:
assignee: nobody → Qiming Teng (tengqim)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/188411

Changed in heat:
status: New → In Progress
Changed in heat:
importance: Undecided → Medium
Changed in heat:
assignee: Qiming Teng (tengqim) → shangxdy (shangxdy)
Changed in heat:
assignee: shangxdy (shangxdy) → Qiming Teng (tengqim)
Changed in heat:
milestone: none → liberty-3
Angus Salkeld (asalkeld)
Changed in heat:
milestone: liberty-3 → liberty-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/188411
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=b910a27d5ff0b924f3fba3933e6f90621f3c1bf3
Submitter: Jenkins
Branch: master

commit b910a27d5ff0b924f3fba3933e6f90621f3c1bf3
Author: tengqm <email address hidden>
Date: Thu Jun 4 10:09:28 2015 -0400

    Fix filter name inconsistency in stack_list

    As described in the bug report, filter names used in stack_list API are
    not consistent with what users see when creating or retrieving stacks.
    We cannot simply change the exposed filter key names because that will
    break existing users.

    This patch adds a translation logic from STACK_KEYS like 'stack_name' to
    its corresponding db column name, i.e. 'name'. The intent is to provide
    compatibility with existing use cases while enforcing API consistency
    regarding the "properties" a user sees from the API.

    At engine API layer, we also try a simple parsing of the 'status' key,
    which may be of simple form 'FAILED' or complex form 'CREATE_COMPLETE'.

    Change-Id: Ia6fe4345ca9feaf20c3bd020ff454e5d701a458e
    Closes-Bug: 1461838

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-rc1 → 5.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.