File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
core-test/src/main/java/org/openstack4j/api/storage
core/src/main/java/org/openstack4j
openstack/storage/block/domain Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public void listVolumesV1() throws Exception {
3131 respondWith ("/storage/v1/volumes.json" );
3232 List <? extends Volume > volumes = os ().blockStorage ().volumes ().list ();
3333 assertEquals (volumes .size (), 3 );
34+ assertEquals (volumes .get (0 ).getTenantId (), "b0b5ed7ae06049688349fe43737796d4" );
3435
3536 // Check that the list request is the one we expect
3637 RecordedRequest listRequest = server .takeRequest ();
@@ -84,6 +85,8 @@ public void getVolumeV1() throws Exception {
8485 assertEquals (attachments .get (0 ).getId (), "8a9287b7-4f4d-4213-8d75-63470f19f27c" );
8586 assertEquals (attachments .get (0 ).getServerId (), "eaa6a54d-35c1-40ce-831d-bb61f991e1a9" );
8687 assertEquals (attachments .get (0 ).getVolumeId (), "8a9287b7-4f4d-4213-8d75-63470f19f27c" );
88+
89+ assertEquals (volume .getTenantId (), "b0b5ed7ae06049688349fe43737796d4" );
8790 }
8891
8992 @ SuppressWarnings ("unchecked" )
Original file line number Diff line number Diff line change @@ -146,4 +146,9 @@ public static MigrationStatus fromValue(String migrationStatus) {
146146 * @return the status of volume migrate status, default null
147147 */
148148 MigrationStatus getMigrateStatus ();
149+
150+ /**
151+ * @return the tenant id
152+ */
153+ String getTenantId ();
149154}
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ public class CinderVolume implements Volume {
5959 private Map <String , Object > imageMetadata ;
6060 @ JsonProperty ("os-vol-mig-status-attr:migstat" )
6161 private MigrationStatus migrateStatus ;
62+ @ JsonProperty ("os-vol-tenant-attr:tenant_id" )
63+ private String tenantId ;
6264 /**
6365 * {@inheritDoc}
6466 */
@@ -194,7 +196,15 @@ public Map<String, String> getMetaData() {
194196 public List <? extends VolumeAttachment > getAttachments () {
195197 return attachments ;
196198 }
197-
199+
200+ /**
201+ * {@inheritDoc}
202+ */
203+ @ Override
204+ public String getTenantId () {
205+ return tenantId ;
206+ }
207+
198208 /**
199209 * {@inheritDoc}
200210 */
You can’t perform that action at this time.
0 commit comments