Public bug reported:

Looks like our getPorts needs a NetworkId parameter:

@param {string} networkId
     * The network id to retrieve ports for. Required.


And it passes it directly to the apiService

return apiService.get('/api/neutron/ports/', networkId)


But looking at other services that accept params for filtering, this does not 
look like the correct way of doing it, see glance getImages for example:

function getImages(params) {
      var config = (params) ? { 'params' : params} : {};
      return apiService.get('/api/glance/images/', config)


So when passing anything as networkId, you will always get ALL ports that the 
tenant has access instead of filtering by network_id.


This should be changed so it looks more like the glance service and a random 
number of params can be passed to getPorts.

Also while networkId is marked in our code as it being required, its not as per 
the neutron documentation:
http://developer.openstack.org/api-ref-networking-v2.html#ports

and instead you just use query filtering to filter:
https://wiki.openstack.org/wiki/Neutron/APIv2-specification#Filtering_and_Column_Selection

** Affects: horizon
     Importance: Undecided
     Assignee: Itxaka Serrano (itxakaserrano)
         Status: New

** Changed in: horizon
     Assignee: (unassigned) => Itxaka Serrano (itxakaserrano)

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

Title:
  Angular: neutron.service getPorts is using the wrong call parameters

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  Looks like our getPorts needs a NetworkId parameter:

  @param {string} networkId
       * The network id to retrieve ports for. Required.

  
  And it passes it directly to the apiService

  return apiService.get('/api/neutron/ports/', networkId)

  
  But looking at other services that accept params for filtering, this does not 
look like the correct way of doing it, see glance getImages for example:

  function getImages(params) {
        var config = (params) ? { 'params' : params} : {};
        return apiService.get('/api/glance/images/', config)

  
  So when passing anything as networkId, you will always get ALL ports that the 
tenant has access instead of filtering by network_id.

  
  This should be changed so it looks more like the glance service and a random 
number of params can be passed to getPorts.

  Also while networkId is marked in our code as it being required, its not as 
per the neutron documentation:
  http://developer.openstack.org/api-ref-networking-v2.html#ports

  and instead you just use query filtering to filter:
  
https://wiki.openstack.org/wiki/Neutron/APIv2-specification#Filtering_and_Column_Selection

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1536586/+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