summaryrefslogtreecommitdiffstats
path: root/nova-client
diff options
context:
space:
mode:
Diffstat (limited to 'nova-client')
-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);
}
-
-
-
-}
+
+
+}