← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1846656] Re: Compute API in nova - show/list servers with details says security_groups is required in response but it's optional

 

Reviewed:  https://review.opendev.org/686517
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a7c3108bf78d2f48b48876a491ecbc69a7ce984f
Submitter: Zuul
Branch:    master

commit a7c3108bf78d2f48b48876a491ecbc69a7ce984f
Author: Takashi NATSUME <natsume.takashi@xxxxxxxxxxxxx>
Date:   Fri Oct 4 11:37:55 2019 +0900

    api-ref: Fix security groups parameters
    
    The security groups parameters are optional
    in the response of the following APIs.
    
    - GET /servers/detail
    - GET /servers/{server_id}
    - PUT /servers/{server_id}
    - POST /servers/{server_id}/action (rebuild)
    
    So fix them.
    
    Change-Id: Icc2315fd8b8c085de9d560de6ddf4c05aaaf6acb
    Closes-Bug: #1846656


** Changed in: nova
       Status: In Progress => Fix Released

-- 
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/1846656

Title:
  Compute API in nova - show/list servers with details says
  security_groups is required in response but it's optional

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  - [x] This doc is inaccurate in this way:

  This came up in review:

  https://review.opendev.org/#/c/685927/2//COMMIT_MSG@9

  https://docs.openstack.org/api-ref/compute/#show-server-details

  and

  https://docs.openstack.org/api-ref/compute/#list-servers-detailed

  response parameter tables both say that "security_groups" is a
  required field in the response but that's not true if the server does
  not have any attached ports which is possible. This is the server view
  builder code:

  https://github.com/openstack/nova/blob/867401e575d2b27b9bc63ceda41cd85233545cd5/nova/api/openstack/compute/views/servers.py#L627

  Note the key is not in the GET response if the server is not attached
  to any ports that have security groups.

  I recreated in devstack by creating a server with no network:

  $ openstack --os-compute-api-version 2.37 server create --flavor
  m1.tiny --image cirros-0.4.0-x86_64-disk --nic none --wait vm-no-net

  And the security_groups key is not in the GET /servers/detail
  response:

  $ curl -H "X-Auth-Token: $token" http://10.128.0.6/compute/v2.1/servers/detail | python -m json.tool | grep security_groups
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  100  1388  100  1388    0     0   8213      0 --:--:-- --:--:-- --:--:--  8213

  
  -----------------------------------
  Release:  on 2019-09-19 17:55:19
  SHA: 9ca14e081860b1abcc0d676f253a472028690e29
  Source: https://opendev.org/openstack/nova/src/api-ref/source/index.rst
  URL: https://docs.openstack.org/api-ref/compute/

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


References