From 3f9a0c3183480d150089c0d5a6e507c877f7d121 Mon Sep 17 00:00:00 2001 From: "Smokowski, Steve (ss835w)" Date: Thu, 2 May 2019 09:42:55 -0400 Subject: Enhance Openstack Client Update Openstack Client to support additional fields Updat all formatting issues Issue-ID: SO-1844 Change-Id: I1369e0c18cc25274db8df7e12855a020b8da38da Signed-off-by: Smokowski, Steve (ss835w) --- cinder-client/pom.xml | 46 +++++++++++----------- .../java/com/woorea/openstack/cinder/Cinder.java | 4 +- .../woorea/openstack/cinder/LimitsExtension.java | 4 +- .../openstack/cinder/SchedulerStatsExtension.java | 8 +++- .../openstack/cinder/SnapshotsExtension.java | 21 +++++----- .../openstack/cinder/VolumeTypesExtension.java | 4 +- .../woorea/openstack/cinder/VolumesExtension.java | 35 +++++++--------- 7 files changed, 63 insertions(+), 59 deletions(-) (limited to 'cinder-client') diff --git a/cinder-client/pom.xml b/cinder-client/pom.xml index 47978ac..61f5959 100755 --- a/cinder-client/pom.xml +++ b/cinder-client/pom.xml @@ -1,26 +1,26 @@ - 4.0.0 - - org.onap.so.libs - openstack-java-sdk - 1.4.0-SNAPSHOT - - cinder-client - OpenStack Cinder Client - OpenStack Cinder Client - - - org.onap.so.libs.openstack-java-sdk - openstack-client - ${project.version} - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.onap.so.libs + openstack-java-sdk + 1.4.0-SNAPSHOT + + cinder-client + OpenStack Cinder Client + OpenStack Cinder Client + + + org.onap.so.libs.openstack-java-sdk + openstack-client + ${project.version} + - - org.onap.so.libs.openstack-java-sdk - cinder-model - ${project.version} - - - org.onap.so.libs.openstack-java-sdk + + org.onap.so.libs.openstack-java-sdk + cinder-model + ${project.version} + + + org.onap.so.libs.openstack-java-sdk \ No newline at end of file diff --git a/cinder-client/src/main/java/com/woorea/openstack/cinder/Cinder.java b/cinder-client/src/main/java/com/woorea/openstack/cinder/Cinder.java index ca65d3f..beb1570 100755 --- a/cinder-client/src/main/java/com/woorea/openstack/cinder/Cinder.java +++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/Cinder.java @@ -1,4 +1,5 @@ -/* ============LICENSE_START======================================================= +/*- + * ============LICENSE_START======================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,6 +14,7 @@ * ============LICENSE_END========================================================= */ + package com.woorea.openstack.cinder; import com.woorea.openstack.base.client.OpenStackClient; diff --git a/cinder-client/src/main/java/com/woorea/openstack/cinder/LimitsExtension.java b/cinder-client/src/main/java/com/woorea/openstack/cinder/LimitsExtension.java index 32c05d7..58256c1 100755 --- a/cinder-client/src/main/java/com/woorea/openstack/cinder/LimitsExtension.java +++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/LimitsExtension.java @@ -1,4 +1,5 @@ -/* ============LICENSE_START======================================================= +/*- + * ============LICENSE_START======================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,6 +13,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package com.woorea.openstack.cinder; import com.woorea.openstack.base.client.HttpMethod; diff --git a/cinder-client/src/main/java/com/woorea/openstack/cinder/SchedulerStatsExtension.java b/cinder-client/src/main/java/com/woorea/openstack/cinder/SchedulerStatsExtension.java index 09ad3ac..36ea91d 100755 --- a/cinder-client/src/main/java/com/woorea/openstack/cinder/SchedulerStatsExtension.java +++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/SchedulerStatsExtension.java @@ -1,4 +1,5 @@ -/* ============LICENSE_START======================================================= +/*- + * ============LICENSE_START======================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,6 +13,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package com.woorea.openstack.cinder; import com.woorea.openstack.base.client.HttpMethod; @@ -37,7 +39,9 @@ public class SchedulerStatsExtension { public class List extends OpenStackRequest { public List(boolean detail) { - super(CLIENT, HttpMethod.GET, (new StringBuilder("/scheduler-stats/get_pools")).append(detail ? "?detail=True":""), null, Pools.class); + super(CLIENT, HttpMethod.GET, + (new StringBuilder("/scheduler-stats/get_pools")).append(detail ? "?detail=True" : ""), null, + Pools.class); } } diff --git a/cinder-client/src/main/java/com/woorea/openstack/cinder/SnapshotsExtension.java b/cinder-client/src/main/java/com/woorea/openstack/cinder/SnapshotsExtension.java index d01bdc9..a7b0cb8 100755 --- a/cinder-client/src/main/java/com/woorea/openstack/cinder/SnapshotsExtension.java +++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/SnapshotsExtension.java @@ -1,4 +1,5 @@ -/* ============LICENSE_START======================================================= +/*- + * ============LICENSE_START======================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,6 +13,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package com.woorea.openstack.cinder; import com.woorea.openstack.base.client.Entity; @@ -95,8 +97,8 @@ public class SnapshotsExtension { public class Update extends OpenStackRequest { public Update(String id, SnapshotForUpdate snapshot) { - super(CLIENT, HttpMethod.PUT, new StringBuilder("/snapshots/").append(id).toString(), - Entity.json(snapshot), Void.class); + super(CLIENT, HttpMethod.PUT, new StringBuilder("/snapshots/").append(id).toString(), Entity.json(snapshot), + Void.class); } } @@ -104,11 +106,8 @@ public class SnapshotsExtension { public class ShowMetadata extends OpenStackRequest { public ShowMetadata(String id) { - super(CLIENT, - HttpMethod.GET, - new StringBuilder("/snapshots/").append(id).append("/metadata").toString(), - null, - Metadata.class); + super(CLIENT, HttpMethod.GET, new StringBuilder("/snapshots/").append(id).append("/metadata").toString(), + null, Metadata.class); } } @@ -116,9 +115,9 @@ public class SnapshotsExtension { public class UpdateMetadata extends OpenStackRequest { public UpdateMetadata(String snapshotId, Metadata metadata) { - super(CLIENT, HttpMethod.PUT, new StringBuilder("/snapshots/").append(snapshotId) - .append("/metadata") - .toString(), Entity.json(metadata), Void.class); + super(CLIENT, HttpMethod.PUT, + new StringBuilder("/snapshots/").append(snapshotId).append("/metadata").toString(), + Entity.json(metadata), Void.class); } } diff --git a/cinder-client/src/main/java/com/woorea/openstack/cinder/VolumeTypesExtension.java b/cinder-client/src/main/java/com/woorea/openstack/cinder/VolumeTypesExtension.java index ded5768..7514771 100755 --- a/cinder-client/src/main/java/com/woorea/openstack/cinder/VolumeTypesExtension.java +++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/VolumeTypesExtension.java @@ -1,4 +1,5 @@ -/* ============LICENSE_START======================================================= +/*- + * ============LICENSE_START======================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,6 +13,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package com.woorea.openstack.cinder; import com.woorea.openstack.base.client.Entity; diff --git a/cinder-client/src/main/java/com/woorea/openstack/cinder/VolumesExtension.java b/cinder-client/src/main/java/com/woorea/openstack/cinder/VolumesExtension.java index 3e6bf97..e8026ef 100755 --- a/cinder-client/src/main/java/com/woorea/openstack/cinder/VolumesExtension.java +++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/VolumesExtension.java @@ -1,4 +1,5 @@ -/* ============LICENSE_START======================================================= +/*- + * ============LICENSE_START======================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,6 +13,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package com.woorea.openstack.cinder; import com.woorea.openstack.base.client.Entity; @@ -82,8 +84,7 @@ public class VolumesExtension { public class List extends OpenStackRequest { public List(boolean detail) { - super(CLIENT, HttpMethod.GET, detail ? "/volumes/detail" - : "/volumes", null, Volumes.class); + super(CLIENT, HttpMethod.GET, detail ? "/volumes/detail" : "/volumes", null, Volumes.class); } } @@ -91,8 +92,7 @@ public class VolumesExtension { public class Create extends OpenStackRequest { public Create(VolumeForCreate volume) { - super(CLIENT, HttpMethod.POST, "/volumes", Entity.json(volume), - Volume.class); + super(CLIENT, HttpMethod.POST, "/volumes", Entity.json(volume), Volume.class); } } @@ -102,8 +102,8 @@ public class VolumesExtension { public class UploadToImage extends OpenStackRequest { public UploadToImage(VolumeForImageCreate volumeForImageCreate) { - super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/") - .append(volumeForImageCreate.getVolumeId() + "/action").toString(), + super(CLIENT, HttpMethod.POST, + new StringBuilder("/volumes/").append(volumeForImageCreate.getVolumeId() + "/action").toString(), Entity.json(volumeForImageCreate), Void.class); } @@ -112,8 +112,7 @@ public class VolumesExtension { public class Show extends OpenStackRequest { public Show(String id) { - super(CLIENT, HttpMethod.GET, new StringBuilder("/volumes/") - .append(id).toString(), null, Volume.class); + super(CLIENT, HttpMethod.GET, new StringBuilder("/volumes/").append(id).toString(), null, Volume.class); } } @@ -121,9 +120,8 @@ public class VolumesExtension { public class ShowMetadata extends OpenStackRequest { public ShowMetadata(String id) { - super(CLIENT, HttpMethod.GET, new StringBuilder("/volumes/") - .append(id).append("/metadata").toString(), null, - Metadata.class); + super(CLIENT, HttpMethod.GET, new StringBuilder("/volumes/").append(id).append("/metadata").toString(), + null, Metadata.class); } } @@ -131,8 +129,7 @@ public class VolumesExtension { public class Delete extends OpenStackRequest { public Delete(String id) { - super(CLIENT, HttpMethod.DELETE, new StringBuilder("/volumes/") - .append(id).toString(), null, Void.class); + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/volumes/").append(id).toString(), null, Void.class); } } @@ -140,8 +137,8 @@ public class VolumesExtension { public class Update extends OpenStackRequest { public Update(String id, VolumeForUpdate volume) { - super(CLIENT, HttpMethod.PUT, new StringBuilder("/volumes/").append(id).toString(), - Entity.json(volume), Void.class); + super(CLIENT, HttpMethod.PUT, new StringBuilder("/volumes/").append(id).toString(), Entity.json(volume), + Void.class); } } @@ -158,8 +155,7 @@ public class VolumesExtension { public class InitializeConnection extends OpenStackRequest { public InitializeConnection(String id, ConnectionForInitialize connectionForInitialize) { - super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/") - .append(id).append("/action").toString(), + super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/").append(id).append("/action").toString(), Entity.json(connectionForInitialize), ConnectionInfo.class); } @@ -168,8 +164,7 @@ public class VolumesExtension { public class TerminateConnection extends OpenStackRequest { public TerminateConnection(String id, ConnectionForTerminate connectionForTerminate) { - super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/") - .append(id).append("/action").toString(), + super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/").append(id).append("/action").toString(), Entity.json(connectionForTerminate), Void.class); } -- cgit 1.2.3-korg