← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1208695] Re: Bug in flavor Nova v3 api when filtering flavors by minRam

 

The call for V3 api is,

v3/flavors/detail?min_ram=<value> and not

v3/flavors/detail?minRam=<value>.

its the same case with min_disk too (minDisk in V2)


I think this will be clear once we complete documentation for V3 api.

** Changed in: nova
       Status: New => Opinion

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

Title:
  Bug in flavor Nova v3 api when filtering flavors by minRam

Status in OpenStack Compute (Nova):
  Opinion

Bug description:
  V3 API for v3/flavors/detail?minRam=<value> is broken as it is unable
  to filter flavors by minRam Value. It doesn't respect the filter and
  instead lists all the flavors.

  Steps to reproduce:

  1. List the flavors and filter out the flavor by minRam value.

  curl -k -H 'Content-type: application/json' -H "X-Auth-Token: *****"
  -X 'GET'  http://*******/v3/flavors/detail?minRam=16384 | python -m
  json.tool

  
  Reponse recvd:
  ---------------------

  {
      "flavors": [
          {
              "disk": 1, 
              "ephemeral": "", 
              "id": "1", 
              "links": [
                  {
                      "href": "http://******/v3/flavors/1";, 
                      "rel": "self"
                  }, 
                  {
                      "href": "http://******/flavors/1";, 
                      "rel": "bookmark"
                  }
              ], 
              "name": "m1.tiny", 
              "os-flavor-access:is_public": true, 
              "os-flavor-disabled:disabled": false, 
              "ram": 512, 
              "rxtx_factor": 1.0, 
              "swap": "", 
              "vcpus": 1
          }, 
          {
              "disk": 20, 
              "ephemeral": "", 
              "id": "2", 
              "links": [
                  {
                      "href": "http://******/v3/flavors/2";, 
                      "rel": "self"
                  }, 
                  {
                      "href": "http://*********/flavors/2";, 
                      "rel": "bookmark"
                  }
              ], 
              "name": "m1.small", 
              "os-flavor-access:is_public": true, 
              "os-flavor-disabled:disabled": false, 
              "ram": 2048, 
              "rxtx_factor": 1.0, 
              "swap": "", 
              "vcpus": 1
          }, 
          {
              "disk": 40, 
              "ephemeral": "", 
              "id": "3", 
              "links": [
                  {
                      "href": "http://*********/v3/flavors/3";, 
                      "rel": "self"
                  }, 
                  {
                      "href": "http://*********/flavors/3";, 
                      "rel": "bookmark"
                  }
              ], 
              "name": "m1.medium", 
              "os-flavor-access:is_public": true, 
              "os-flavor-disabled:disabled": false, 
              "ram": 4096, 
              "rxtx_factor": 1.0, 
              "swap": "", 
              "vcpus": 2
          }, 
          {
              "disk": 80, 
              "ephemeral": "", 
              "id": "4", 
              "links": [
                  {
                      "href": "http://***********/v3/flavors/4";, 
                      "rel": "self"
                  }, 
                  {
                      "href": "http://**********/flavors/4";, 
                      "rel": "bookmark"
                  }
              ], 
              "name": "m1.large", 
              "os-flavor-access:is_public": true, 
              "os-flavor-disabled:disabled": false, 
              "ram": 8192, 
              "rxtx_factor": 1.0, 
              "swap": "", 
              "vcpus": 4
          }, 
          {
              "disk": 0, 
              "ephemeral": "", 
              "id": "42", 
              "links": [
                  {
                      "href": "http://**********/v3/flavors/42";, 
                      "rel": "self"
                  }, 
                  {
                      "href": "http://**********/flavors/42";, 
                      "rel": "bookmark"
                  }
              ], 
              "name": "m1.nano", 
              "os-flavor-access:is_public": true, 
              "os-flavor-disabled:disabled": false, 
              "ram": 64, 
              "rxtx_factor": 1.0, 
              "swap": "", 
              "vcpus": 1
          }, 
          {
              "disk": 160, 
              "ephemeral": "", 
              "id": "5", 
              "links": [
                  {
                      "href": "http://*************/v3/flavors/5";, 
                      "rel": "self"
                  }, 
                  {
                      "href": "http://*********/flavors/5";, 
                      "rel": "bookmark"
                  }
              ], 
              "name": "m1.xlarge", 
              "os-flavor-access:is_public": true, 
              "os-flavor-disabled:disabled": false, 
              "ram": 16384, 
              "rxtx_factor": 1.0, 
              "swap": "", 
              "vcpus": 8
          }, 
          {
              "disk": 0, 
              "ephemeral": "", 
              "id": "84", 
              "links": [
                  {
                      "href": "http://***********/v3/flavors/84";, 
                      "rel": "self"
                  }, 
                  {
                      "href": "http://************/flavors/84";, 
                      "rel": "bookmark"
                  }
              ], 
              "name": "m1.micro", 
              "os-flavor-access:is_public": true, 
              "os-flavor-disabled:disabled": false, 
              "ram": 128, 
              "rxtx_factor": 1.0, 
              "swap": "", 
              "vcpus": 1
          }
      ]
  }

  
  It is unable to filter only this value.

  Behaviour in v2 API
  --------------------------

  $ curl -k -H 'Content-type: application/json' -H "X-Auth-Token: *******" -X 'GET'  http://*******/v2/f9653b99395d47d38f8b992575f750fd/flavors/detail?minRam=16384 | python -m json.tool
  {
      "flavors": [
          {
              "OS-FLV-DISABLED:disabled": false, 
              "OS-FLV-EXT-DATA:ephemeral": 0, 
              "disk": 160, 
              "id": "5", 
              "links": [
                  {
                      "href": "http://*************/v2/f9653b99395d47d38f8b992575f750fd/flavors/5";, 
                      "rel": "self"
                  }, 
                  {
                      "href": "http://************/f9653b99395d47d38f8b992575f750fd/flavors/5";, 
                      "rel": "bookmark"
                  }
              ], 
              "name": "m1.xlarge", 
              "os-flavor-access:is_public": true, 
              "ram": 16384, 
              "rxtx_factor": 1.0, 
              "swap": "", 
              "vcpus": 8
          }
      ]
  }

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