Skip to content

Commit dbec4c5

Browse files
committed
Add listAllVolumes api
1 parent 8993722 commit dbec4c5

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ after_success:
3030
# infrastructure. This should prevent the buffer overflow from
3131
# https://github.com/travis-ci/travis-ci/issues/5227
3232
sudo: false
33+
dist: trusty

core/src/main/java/org/openstack4j/api/storage/BlockVolumeService.java

+7
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ public interface BlockVolumeService extends RestService {
5656
*/
5757
List<? extends Volume> list(Map<String, String> filteringParams);
5858

59+
/**
60+
* Lists all Block Storage volumes for all tenants.
61+
*
62+
* @return List of all Volumes
63+
*/
64+
List<? extends Volume> listAll();
65+
5966
/**
6067
* Gets a Block Storage volume by ID
6168
* @param volumeId the volume identifier

core/src/main/java/org/openstack4j/openstack/storage/block/internal/BlockVolumeServiceImpl.java

+8
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ public List<? extends Volume> list(Map<String, String> filteringParams) {
5050
return volumeInvocation.execute().getList();
5151
}
5252

53+
/**
54+
* {@inheritDoc}
55+
*/
56+
@Override
57+
public List<? extends Volume> listAll() {
58+
return get(Volumes.class, uri("/volumes/detail")).param("all_tenants", 1).execute().getList();
59+
}
60+
5361
/**
5462
* {@inheritDoc}
5563
*/

0 commit comments

Comments
 (0)