Trying to sort on 'fault' results in a 400 as I'd expect:

stack@rocky:~$ curl http://162.253.55.188/compute/v2.1/servers?sort_key=fault 
-H "x-auth-token: $TOKEN" | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   875  100   875    0     0  77860      0 --:--:-- --:--:-- --:--:-- 79545
{
    "badRequest": {
        "code": 400,
        "message": "Invalid input for query parameters sort_key. Value: fault. 
u'fault' is not one of ['access_ip_v4', 'access_ip_v6', 'auto_disk_config', 
'availability_zone', 'config_drive', 'created_at', 'display_description', 
'display_name', 'host', 'hostname', 'image_ref', 'instance_type_id', 
'kernel_id', 'key_name', 'launch_index', 'launched_at', 'locked_by', 'node', 
'power_state', 'progress', 'project_id', 'ramdisk_id', 'root_device_name', 
'task_state', 'terminated_at', 'updated_at', 'user_id', 'uuid', 'vm_state', 
'architecture', 'cell_name', 'cleaned', 'default_ephemeral_device', 
'default_swap_device', 'deleted', 'deleted_at', 'disable_terminate', 
'ephemeral_gb', 'ephemeral_key_uuid', 'id', 'key_data', 'launched_on', 
'locked', 'memory_mb', 'os_type', 'reservation_id', 'root_gb', 
'shutdown_terminate', 'user_data', 'vcpus', 'vm_mode']"
    }
}
stack@rocky:~$ 


** Changed in: nova
       Status: Triaged => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1762870

Title:
  server fault is not blacklisted for filtering/sorting

Status in OpenStack Compute (nova):
  Invalid

Bug description:
  The server['fault'] response key is a joined column in the
  instance_faults table, but is not listed in the blacklisted list of
  joined table keys:

  
https://github.com/openstack/nova/blob/43f4755d5e034a6ff1cd5788d76851642027a54e/nova/api/openstack/compute/schemas/servers.py#L298

  it's also not listed as an ignored sort key, but we can't sort on
  fault since it's a dict in the response:

  
https://github.com/openstack/nova/blob/43f4755d5e034a6ff1cd5788d76851642027a54e/nova/api/openstack/compute/schemas/servers.py#L312

  I'm not sure what would happen if you tried sorting instances on
  fault, but I think filtering on fault probably results in a 500 error.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1762870/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to