Skip to content

Commit

Permalink
Merge pull request #227 from slankka/neutron-list-fields
Browse files Browse the repository at this point in the history
Neutron:list port support fields to query
  • Loading branch information
olivergondza committed Apr 3, 2024
2 parents 4aef873 + 74aabbb commit fc30c79
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/src/main/java/org/openstack4j/api/networking/PortService.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.openstack4j.api.networking;

import java.util.List;
import java.util.Map;

import org.openstack4j.common.RestService;
import org.openstack4j.model.common.ActionResponse;
Expand Down Expand Up @@ -29,6 +30,15 @@ public interface PortService extends RestService {
*/
List<? extends Port> list(PortListOptions options);

/**
* Lists all Ports authorized by the current Tenant
* <br/>
* Supports multiple values, eg: fields=id&fields=name
* @param params filtering options
* @return the list of ports
*/
List<? extends Port> list(Map<String, ? extends Iterable<?>> params);

/**
* Gets the Port by ID
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.openstack4j.openstack.networking.internal;

import java.util.List;
import java.util.Map;
import java.util.Objects;

import org.openstack4j.api.networking.PortService;
Expand Down Expand Up @@ -34,6 +35,14 @@ public List<? extends Port> list(PortListOptions options) {
return get(Ports.class, uri("/ports")).params(options.getOptions()).execute().getList();
}

/**
* {@inheritDoc}
*/
@Override
public List<? extends Port> list(Map<String, ? extends Iterable<?>> params) {
return get(Ports.class, uri("/ports")).paramLists(params).execute().getList();
}

/**
* {@inheritDoc}
*/
Expand Down

0 comments on commit fc30c79

Please sign in to comment.