summaryrefslogtreecommitdiffstats
path: root/nova-client/src/main
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2019-04-17 04:43:37 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-17 04:43:37 +0000
commit3b3f44756f22a01ff44b2ce6dcfa5e55293163d4 (patch)
treedff2632077547cad607d0101e59f3e47fe9d0e5f /nova-client/src/main
parent5155f1573db52c121cd17e216ef6739545d8226f (diff)
parent189a8f019f3b6b0609960b846f8c5de34365558f (diff)
Merge "Code Enhancement (Sonar Fixes)"
Diffstat (limited to 'nova-client/src/main')
-rw-r--r--nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java27
1 files changed, 13 insertions, 14 deletions
diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java
index 4b39b2e..d1ae7f4 100644
--- a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java
+++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java
@@ -28,13 +28,13 @@ import com.woorea.openstack.nova.model.FloatingIp;
import com.woorea.openstack.nova.model.FloatingIps;
public class FloatingIpsExtension {
-
+
private final OpenStackClient CLIENT;
-
+
public FloatingIpsExtension(OpenStackClient client) {
CLIENT = client;
}
-
+
public class List extends OpenStackRequest<FloatingIps> {
public List() {
@@ -44,40 +44,39 @@ public class FloatingIpsExtension {
}
public class Allocate extends OpenStackRequest<FloatingIp> {
-
+
public Allocate(Entity<?> entity) {
super(CLIENT, HttpMethod.POST, "/os-floating-ips", entity, FloatingIp.class);
}
}
-
+
public class Deallocate extends OpenStackRequest<Void> {
-
+
public Deallocate(String id) {
super(CLIENT, HttpMethod.DELETE, new StringBuffer("/os-floating-ips/").append(id).toString(), null, Void.class);
}
-
+
}
public List list() {
return new List();
}
-
+
public Allocate allocate(String pool) {
Entity<?> entity=null;
if(pool!=null) {
- Map<String, String> body = new HashMap<String, String>();
+ Map<String, String> body = new HashMap<>();
body.put("pool", pool);
entity=Entity.json(body);
}
return new Allocate(entity);
}
-
+
public Deallocate deallocate(String id) {
return new Deallocate(id);
}
-
-
-
-}
+
+
+}