diff options
author | 2017-01-31 13:57:24 +0100 | |
---|---|---|
committer | 2017-01-31 14:55:11 +0100 | |
commit | 2e984294ac28c6f2ede290c38164c5d536ccaf4a (patch) | |
tree | 5eba5a929b7a961c98749fa69e03cfea58e1a724 /quantum-client/src/main/java/com/woorea/openstack/quantum/api/NetworksResource.java | |
parent | 86c0f28c8ed469486b64d6422dc53e3a7bcc8adb (diff) |
Initial OpenECOMP MSO OpenStack SDK lib commit
Change-Id: Ieaacb2b2c0dcc469669880e73f0cda9fa59a6c5a
Signed-off-by: ChrisC <cc697w@intl.att.com>
Diffstat (limited to 'quantum-client/src/main/java/com/woorea/openstack/quantum/api/NetworksResource.java')
-rw-r--r-- | quantum-client/src/main/java/com/woorea/openstack/quantum/api/NetworksResource.java | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/quantum-client/src/main/java/com/woorea/openstack/quantum/api/NetworksResource.java b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/NetworksResource.java new file mode 100644 index 0000000..97a919a --- /dev/null +++ b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/NetworksResource.java @@ -0,0 +1,84 @@ +package com.woorea.openstack.quantum.api; + + +import com.woorea.openstack.base.client.Entity; +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.quantum.model.Network; +import com.woorea.openstack.quantum.model.Networks; + +public class NetworksResource { + + private final OpenStackClient CLIENT; + + public NetworksResource(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public Create create(Network net) { + return new Create(net); + } + + public Update update(Network net) { + return new Update(net); + } + + public Delete delete(String netId){ + return new Delete(netId); + } + + public Show show(String netId){ + return new Show(netId); + } + + public class List extends OpenStackRequest<Networks> { + + public List() { + super(CLIENT, HttpMethod.GET, "networks", null, Networks.class); + } + } + + public class Query extends OpenStackRequest<Networks> { + + public Query(Network network) { + //super(network); +// target = target.path("v2.0").path("networks"); +// target = queryParam(target); +// return target.request(MediaType.APPLICATION_JSON).get(Networks.class); + } + } + + + public class Create extends OpenStackRequest<Network> { + + public Create(Network net) { + super(CLIENT, HttpMethod.POST, "networks", Entity.json(net), Network.class); + } + } + + public class Update extends OpenStackRequest<Network> { + + public Update(Network net) { + super(CLIENT, HttpMethod.PUT, buildPath("networks/", net.getId()), Entity.json(net), Network.class); + } + } + + public class Show extends OpenStackRequest<Network> { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, buildPath("networks/", id), null, Network.class); + } + } + + public class Delete extends OpenStackRequest<Void> { + + public Delete(String id){ + super(CLIENT, HttpMethod.DELETE, buildPath("networks/", id), null, Void.class); + } + } +} |