diff options
author | Smokowski, Steve (ss835w) <ss835w@us.att.com> | 2020-02-24 11:54:21 -0500 |
---|---|---|
committer | Smokowski, Steve (ss835w) <ss835w@us.att.com> | 2020-02-24 11:54:21 -0500 |
commit | 4667e90557eb0216af7c11bc9c1a3faf487d96bb (patch) | |
tree | 3daa9f9fe805b778ff0d71c5cc4d4fef795f1870 /nova-client/src | |
parent | 1389746c1a81aca1b82a5e1e43d25a2d6e8c9229 (diff) |
Update Nova Client to support Hypervisor endpoint
Issue-ID: SO-2677
Change-Id: I44b872c6bf1a33a10cf0f5b2ad17a101289288f5
Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
Change-Id: I03364df162e2888fe85dba118948bebdf6fb9ea4
Diffstat (limited to 'nova-client/src')
-rw-r--r-- | nova-client/src/main/java/com/woorea/openstack/nova/Nova.java | 8 | ||||
-rw-r--r-- | nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HypervisorsExtension.java | 44 |
2 files changed, 51 insertions, 1 deletions
diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/Nova.java b/nova-client/src/main/java/com/woorea/openstack/nova/Nova.java index 0125179..908e1e9 100644 --- a/nova-client/src/main/java/com/woorea/openstack/nova/Nova.java +++ b/nova-client/src/main/java/com/woorea/openstack/nova/Nova.java @@ -27,6 +27,7 @@ import com.woorea.openstack.nova.api.ServersResource; import com.woorea.openstack.nova.api.extensions.AggregatesExtension; import com.woorea.openstack.nova.api.extensions.FloatingIpsExtension; import com.woorea.openstack.nova.api.extensions.HostsExtension; +import com.woorea.openstack.nova.api.extensions.HypervisorsExtension; import com.woorea.openstack.nova.api.extensions.KeyPairsExtension; import com.woorea.openstack.nova.api.extensions.SecurityGroupsExtension; import com.woorea.openstack.nova.api.extensions.SnapshotsExtension; @@ -58,6 +59,8 @@ public class Nova extends OpenStackClient { private final HostsExtension hosts; + private final HypervisorsExtension hypervisor; + public Nova(String endpoint, OpenStackClientConnector connector) { super(endpoint, connector); extensions = new ExtensionsResource(this); @@ -72,6 +75,7 @@ public class Nova extends OpenStackClient { aggregates = new AggregatesExtension(this); quotaSets = new QuotaSetsResource(this); hosts = new HostsExtension(this); + hypervisor = new HypervisorsExtension(this); } public Nova(String endpoint) { @@ -125,4 +129,8 @@ public class Nova extends OpenStackClient { public HostsExtension hosts() { return hosts; } + + public HypervisorsExtension hypervisors() { + return hypervisor; + } } diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HypervisorsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HypervisorsExtension.java index b092b0c..a785971 100644 --- a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HypervisorsExtension.java +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HypervisorsExtension.java @@ -16,6 +16,48 @@ package com.woorea.openstack.nova.api.extensions; -public interface HypervisorsExtension { +import com.woorea.openstack.base.client.HttpMethod; +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.nova.model.Hypervisor; +import com.woorea.openstack.nova.model.Hypervisors; +public class HypervisorsExtension { + + private final OpenStackClient client; + + public HypervisorsExtension(OpenStackClient client) { + this.client = client; + } + + public List list() { + return new List(); + } + + public ListDetail listDetail() { + return new ListDetail(); + } + + public Show show(String id) { + return new Show(id); + } + + public class List extends OpenStackRequest<Hypervisors> { + public List() { + super(client, HttpMethod.GET, "/os-hypervisors", null, Hypervisors.class); + } + } + + public class ListDetail extends OpenStackRequest<Hypervisors> { + public ListDetail() { + super(client, HttpMethod.GET, "/os-hypervisors/detail", null, Hypervisors.class); + } + } + + public class Show extends OpenStackRequest<Hypervisor> { + public Show(String id) { + super(client, HttpMethod.GET, new StringBuffer("/hypervisors").append(id).toString(), null, + Hypervisor.class); + } + } } |