diff --git a/.gitignore b/.gitignore
index 34dd271b8..a9ddaa685 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
*~
+*.iml
+.idea/
.settings/
.classpath
.project
@@ -16,4 +18,5 @@ openstack-ui/src/main/webapp/ui/
openstack-ui/src/main/webapp/WEB-INF/lib/
openstack-ui/.gwt/
openstack-ui/deploy.sh
-test-output/
\ No newline at end of file
+test-output/
+bin
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..f2ad391ed
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,3 @@
+language: java
+
+install: mvn clean package -DskipTests=true
\ No newline at end of file
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 000000000..d64569567
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/NEWS.md b/NEWS.md
new file mode 100644
index 000000000..1ebc1c989
--- /dev/null
+++ b/NEWS.md
@@ -0,0 +1,50 @@
+# 3.2.9 / 2020-04-07
+* glance: Add Support for Image Service API v2
+
+# 3.2.8 / 2020-01-29
+* jackson upgraded to com.fasterxml version 2.9.x
+* commons-httpclient upgraded to org.apache.httpcomponents 4.5
+
+# 3.2.7 / 2019-05-03
+* Remove maven-gpg-plugin
+
+# 3.2.6 / 2019-05-03
+* RESTEasyConnector: Support RESTEasy 3.6.3.Final
+
+# 3.2.5 / 2018-11-14
+* neutron: Add support for `port_security_enabled` on Networks
+
+# 3.2.4 / 2018
+* Improved backward compatibility to 3.1.3
+
+# 3.2.3 / 2018-06-24
+* No user visible changes
+
+# 3.2.2 / 2018-06-23
+* Add keystone v3 support
+* Add missing nova utility methods for server actions
+* Add heat support
+* Add router support
+* All fixes and improvements up to 3.1.3
+
+# 3.1.3 / 2018-05-18
+* Cinder: Add support for `os-terminate_connection`
+* neutron: Support parameter mtu
+
+# 3.1.2 / 2017-01-28
+* RESTEasyConnector: Isolate the creation of ClientExecutor
+
+# 3.1.1 / 2015-05-06
+* cinder: introduce client and model
+* java 7
+* Fixes and improvements up to 3.0.6
+
+# 3.2.1 / 2013-07-26
+* No user visible changes
+
+# 3.2.0 / 2013-07-26
+* support quota/limits/usage operations
+* logging enhancements
+
+# 3.1.0 / 2013-07-21
+
diff --git a/README.textile b/README.textile
index 4e7cccd86..ff07ffab2 100644
--- a/README.textile
+++ b/README.textile
@@ -1,200 +1,125 @@
-h1. OpenStack Java SDK
+h1. OpenStack Java SDK v2.0
-h2. Maven
-
-|groupId|artifactId|version|
-|org.openstack|openstack-java-sdk|1.0-RC2|
-
-https://raw.github.com/woorea/maven/master/releases/
-
-h2. Configuration
-
-You can configure the client in a properties file
-
-h3. openstack.properties
+h1. Important
-
-verbose=true
-
-#for HPCloud
-#auth.credentials=apiAccessKeyCredentials
-#auth.accessKey=
-#auth.secretKey=
-#auth.tenantId=
-
-auth.credentials=passwordCredentials
-auth.username=demo
-auth.password=secret0
-#auth.tenantId=123456789
-auth.tenantName=demo
-
-
-identity.endpoint.publicURL=http://192.168.1.43:5000/v2.0
-identity.endpoint.internalURL=http://192.168.1.43:5000/v2.0
-identity.endpoint.adminURL=http://192.168.1.43:35357/v2.0
-identity.admin.token=secret0
-
-test.glance=false
-test.swift=false
-
+You can continue using the latest source from v1.x essex branch
-h2. Example
+h2. Maven
-h3. Identity API (keystone)
+|groupId|artifactId|version|
+|com.woorea|keystone-client|3.0.0-SNAPSHOT|
+|com.woorea|nova-client|3.0.0-SNAPSHOT|
+|com.woorea|glance-client|3.0.0-SNAPSHOT|
+|com.woorea|swift-client|3.0.0-SNAPSHOT|
-h4. Access
+h3. Maven Repositories
-
-// X-Auth-Token
-OpenStackClient openstack = OpenStackClient.authenticate(properties);
+https://maven.java.net/content/repositories/snapshots
+https://raw.github.com/woorea/maven/master/snapshots
-IdentityAdministrationEndpoint identity = openstack.getIdentityAdministationEndpoint();
-
+h1. Available artifacts
-h4. Tenants
+h2. OpenStack Identity Service
-
-//GET tenants available
-TenantList tenants = identity.tenants().get();
-
-//POST tenant
-KeystoneTenant kst = new KeystoneTenant();
-kst.setName("test");
-kst.setDescription("desc");
-kst.setEnabled(true);
-Tenant tenant = identity.tenants().post(kst);
+OpenStack Keystone Model
-//GET tenant
-tenant = identity.tenants().tenant(tenant.getId()).get();
-
-//DELETE tenant
-identity.tenants().tenant(tenant.getId()).delete();
-
-
-h4. Users
+OpenStack Keystone Client
-UserList users = identity.users().get();
-
-KeystoneUser ksu = new KeystoneUser();
-ksu.setName("test");
-ksu.setPassword("secret0");
-ksu.setEmail("test@test.com");
-ksu.setEnabled(true);
-User user = identity.users().post(ksu);
-
-user = identity.users().user(user.getId()).get();
-
-identity.users().user(user.getId()).delete();
-
+KeystoneClient keystone = new KeystoneClient(KEYSTONE_AUTH_URL);
+Authentication authentication = new Authentication();
+PasswordCredentials passwordCredentials = new PasswordCredentials();
+passwordCredentials.setUsername(KEYSTONE_USERNAME);
+passwordCredentials.setPassword(KEYSTONE_PASSWORD);
+authentication.setPasswordCredentials(passwordCredentials);
-h4. Roles
+//access with unscoped token
+Access access = keystone.execute(new Authenticate(authentication));
-
-RoleList roles = identity.roles().get();
-
-KeystoneRole ksr = new KeystoneRole();
-ksr.setName("test");
-Role role = identity.roles().post(ksr);
+//use the token in the following requests
+keystone.setToken(access.getToken().getId());
-role = identity.roles().role(role.getId()).get();
+Tenants tenants = keystone.execute(new ListTenants());
-identity.roles().role(role.getId()).delete();
+//try to exchange token using the first tenant
+if(tenants.getList().size() > 0) {
+
+ authentication = new Authentication();
+ Token token = new Token();
+ token.setId(access.getToken().getId());
+ authentication.setToken(token);
+ authentication.setTenantId(tenants.getList().get(0).getId());
+
+ access = keystone.execute(new Authenticate(authentication));
+
+ ...
-h4. Services
-
-
-ServiceList services = identity.services().get();
+h2. OpenStack Compute Service
-KeystoneService kss = new KeystoneService();
-kss.setName("test");
-kss.setType("compute");
-kss.setDescription("Nova 3.0");
-Service service = identity.services().post(kss);
-
-service = identity.services().service(service.getId()).get();
-
-identity.services().service(service.getId()).delete();
-
+OpenStack Nova Model
-h4. Endpoints (Not implemented yet)
+OpenStack Nova Client
-501 HTTP Error from Keystone Server API
+NovaClient novaClient = new NovaClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "compute", null, "public"), access.getToken().getId());
+
+Servers servers = novaClient.execute(ServersCore.listServers());
+for(Server server : servers) {
+ System.out.println(server);
+}
-h3. Compute API (nova)
+h2. OpenStack Image Store Service
-h4. Select a Tenant
+OpenStack Glance Model
-
-// Authenticate on admin tenant
-openstack = openstack.reauthenticateOnTenant("admin");
-TenantResource compute = openstack.getComputeEndpoint();
-
+OpenStack Glance Client
-h4. Servers
+h2. OpenStack Object Store Service
-
-ServerList servers = compute.servers().get();
-
+OpenStack Swift Model
-h5. Server Actions
+OpenStack Swift Client
-
-TODO
-
+h2. OpenStack Ceilometer Service
-h4. Images
+h3. MongoDB Installation
-
-ImageList images = compute.images().get();
-
+OpenStack Ceilometer Service uses MongoDB as storage.
-h4. Flavors
+h3. Ceilometer Compute Agent Installation
-
-FlavorList flavors = compute.flavors().get();
-
+OpenStack Ceilometer Compute Agent
-h4. Key Pairs
+This artefact should be installed on each compute node
-KeyPairList keypairs = compute.keyPairs().get();
+mvn clean compile assembly:assembly
+Properties can be configured in /etc/ceilometer/ceilometer-agent.properties
+java -jar ceilometer-compute-agent-jar-with-dependencies.jar
-h4. Security Groups
+h3. Ceilometer Collector Installation
-
-SecurityGroupList securityGroups = compute.securityGroups().get();
-
-
-h4. Volumes
+OpenStack Ceilometer Collector
-VolumeList volumes = compute.volumes().get();
+mvn clean compile assembly:assembly
+Properties can be configured in /etc/ceilometer/ceilometer-collector.properties
+java -jar ceilometer-collector.jar
-h3. Image Store (glance)
+h3. OpenStack Ceilometer API Installation
-
-org.openstack.model.images.ImageList gImages = openstack.getImagesEndpoint().get();
-
-
-h3. Object Store (swift)
+OpenStack Ceilometer API
-List sAccount = openstack.getStorageEndpoint().get();
+mvn clean compile assembly:assembly
+Properties can be configured in /etc/ceilometer/ceilometer-api.properties
+java -jar ceilometer-api.jar
-
-h1. Maven
-
-We use maven to build the project. Some helpful maven commands:
-
-@mvn eclipse:eclipse@ _Create the eclipse projects_
-@mvn install@ _Builds everything, runs unit & integration tests, installs into your maven repo_
-@mvn install -Dmaven.test.skip=true@ _As above, but without running tests_
+OpenStack Ceilometer Client
h1. License
@@ -202,7 +127,6 @@ h1. License
This software is licensed under the Apache 2 license, quoted below.
Copyright 2012 Luis Gervaso and OpenStack Java SDK
-Copyright 2012 Justin Santa Barbara
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
@@ -215,4 +139,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
-
+
\ No newline at end of file
diff --git a/etc/release.sh b/bundle.sh
similarity index 100%
rename from etc/release.sh
rename to bundle.sh
diff --git a/ceilometer-client/pom.xml b/ceilometer-client/pom.xml
new file mode 100644
index 000000000..0c0ea41c1
--- /dev/null
+++ b/ceilometer-client/pom.xml
@@ -0,0 +1,23 @@
+
+ 4.0.0
+
+ com.woorea
+ openstack-java-sdk
+ 3.2.10-SNAPSHOT
+
+ ceilometer-client
+ OpenStack Ceilometer Client
+ OpenStack Ceilometer Client
+
+
+ com.woorea
+ openstack-client
+ 3.2.10-SNAPSHOT
+
+
+ com.woorea
+ ceilometer-model
+ 3.2.10-SNAPSHOT
+
+
+
diff --git a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/Ceilometer.java b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/Ceilometer.java
new file mode 100644
index 000000000..05cda3551
--- /dev/null
+++ b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/Ceilometer.java
@@ -0,0 +1,34 @@
+package com.woorea.openstack.ceilometer;
+
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackClientConnector;
+import com.woorea.openstack.ceilometer.v2.api.MetersResource;
+import com.woorea.openstack.ceilometer.v2.api.ResourcesResource;
+
+public class Ceilometer extends OpenStackClient {
+
+ private final MetersResource METERS;
+
+ private final ResourcesResource RESOURCES;
+
+ public Ceilometer(String endpoint, OpenStackClientConnector connector) {
+ super(endpoint, connector);
+ METERS = new MetersResource(this);
+ RESOURCES = new ResourcesResource(this);
+ }
+
+ public Ceilometer(String endpoint) {
+ this(endpoint, null);
+
+ }
+
+ public ResourcesResource resources() {
+ return RESOURCES;
+ }
+
+ public MetersResource meters() {
+ return METERS;
+ }
+
+}
diff --git a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java
new file mode 100644
index 000000000..444c052cb
--- /dev/null
+++ b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java
@@ -0,0 +1,58 @@
+package com.woorea.openstack.ceilometer;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.woorea.openstack.base.client.OpenStackRequest;
+
+public abstract class QueriableCeilometerCommand extends OpenStackRequest {
+
+ protected List fields = new ArrayList();
+
+ protected List ops = new ArrayList();
+
+ protected List values = new ArrayList();
+
+ private T filter(String field, String op, Serializable value) {
+ fields.add(field);
+ ops.add(op);
+ values.add(value);
+ return (T) this;
+ }
+
+ public T lt(String field, Serializable value) {
+ return filter(field, "lt", value);
+ }
+
+ public T le(String field, Serializable value) {
+ return filter(field, "le", value);
+ }
+
+ public T eq(String field, Serializable value) {
+ return filter(field, "eq", value);
+ }
+
+ public T ne(String field, Serializable value) {
+ return filter(field, "ne", value);
+ }
+
+ public T ge(String field, Serializable value) {
+ return filter(field, "ge", value);
+ }
+
+ public T gt(String field, Serializable value) {
+ return filter(field, "gt", value);
+ }
+
+ /*
+ public WebTarget query(WebTarget target) {
+ if(fields.size() > 0) {
+ target = target.queryParam("q.field", fields.toArray());
+ target = target.queryParam("q.op", ops.toArray());
+ target = target.queryParam("q.value", values.toArray());
+ }
+ return target;
+ }
+ */
+}
diff --git a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/MetersResource.java b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/MetersResource.java
new file mode 100644
index 000000000..e44dbe649
--- /dev/null
+++ b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/MetersResource.java
@@ -0,0 +1,71 @@
+package com.woorea.openstack.ceilometer.v2.api;
+
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackRequest;
+import com.woorea.openstack.ceilometer.QueriableCeilometerCommand;
+import com.woorea.openstack.ceilometer.v2.model.Sample;
+
+public class MetersResource {
+
+ private final OpenStackClient CLIENT;
+
+ public MetersResource(OpenStackClient client) {
+ CLIENT = client;
+ }
+
+ public List list() {
+ return new List();
+ }
+
+ public Show show() {
+ return new Show();
+ }
+
+ public Statistics statistics() {
+ return new Statistics();
+ }
+
+ public class List extends QueriableCeilometerCommand> {
+ public List() {
+ //return query(target.path("meters")).request(MediaType.APPLICATION_JSON).get(new GenericType>() {});
+ }
+ }
+
+ public class Show extends QueriableCeilometerCommand> {
+
+ private String name;
+
+ public Show name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Show() {
+// if(name == null) {
+// throw new UnsupportedOperationException("meter id is mandatory");
+// }
+// return query(target.path("meters").path(name)).request(MediaType.APPLICATION_JSON).get(new GenericType>() {});
+ }
+
+ }
+
+ public class Statistics extends QueriableCeilometerCommand> {
+
+ private String name;
+
+ public Statistics name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Statistics() {
+// if(name == null) {
+// throw new UnsupportedOperationException("meter id is mandatory");
+// }
+// return query(target.path("meters").path(name).path("statistics")).request(MediaType.APPLICATION_JSON).get(new GenericType>(){});
+ }
+
+ }
+
+}
diff --git a/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/ResourcesResource.java b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/ResourcesResource.java
new file mode 100644
index 000000000..900168719
--- /dev/null
+++ b/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/ResourcesResource.java
@@ -0,0 +1,45 @@
+package com.woorea.openstack.ceilometer.v2.api;
+
+import java.util.List;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackRequest;
+import com.woorea.openstack.ceilometer.QueriableCeilometerCommand;
+import com.woorea.openstack.ceilometer.v2.model.Resource;
+
+public class ResourcesResource {
+
+ private final OpenStackClient CLIENT;
+
+ public ResourcesResource(OpenStackClient client) {
+ CLIENT = client;
+ }
+
+ public class ResourceList extends QueriableCeilometerCommand> {
+
+ public ResourceList() {
+ OpenStackRequest request = new OpenStackRequest();
+ //return query(target.path("resources")).request(MediaType.APPLICATION_JSON).get(new GenericType>() {});
+ }
+
+ }
+
+ public class ResourceShow extends OpenStackRequest {
+
+ private String id;
+
+ public ResourceShow id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ public ResourceShow(OpenStackClient client) {
+// if(id == null) {
+// throw new UnsupportedOperationException("resource id is mandatory");
+// }
+// return target.path("resources").path(id).request(MediaType.APPLICATION_JSON).get(Resource.class);
+ }
+
+ }
+
+}
diff --git a/ceilometer-model/pom.xml b/ceilometer-model/pom.xml
new file mode 100644
index 000000000..d2fd429ac
--- /dev/null
+++ b/ceilometer-model/pom.xml
@@ -0,0 +1,11 @@
+
+ 4.0.0
+
+ com.woorea
+ openstack-java-sdk
+ 3.2.10-SNAPSHOT
+
+ ceilometer-model
+ OpenStack Ceilometer Model
+ OpenStack Ceilometer Model
+
diff --git a/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Meter.java b/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Meter.java
new file mode 100644
index 000000000..53f192b54
--- /dev/null
+++ b/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Meter.java
@@ -0,0 +1,54 @@
+package com.woorea.openstack.ceilometer.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Meter {
+
+ @JsonProperty("user_id")
+ private String user;
+
+
+ private String name;
+
+ @JsonProperty("resource_id")
+ private String resource;
+
+ @JsonProperty("project_id")
+ private String project;
+
+ private String type;
+
+ private String unit;
+
+ public String getUser() {
+ return user;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getResource() {
+ return resource;
+ }
+
+ public String getProject() {
+ return project;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public String getUnit() {
+ return unit;
+ }
+
+ @Override
+ public String toString() {
+ return "Meter [user=" + user + ", name=" + name + ", resource="
+ + resource + ", project=" + project + ", type=" + type
+ + ", unit=" + unit + "]";
+ }
+
+}
diff --git a/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Resource.java b/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Resource.java
new file mode 100644
index 000000000..7ca1fb089
--- /dev/null
+++ b/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Resource.java
@@ -0,0 +1,50 @@
+package com.woorea.openstack.ceilometer.v2.model;
+
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Resource {
+ //{"resource_id": "23b55841eedd41e99d5f3f32149ca086", "timestamp": "2013-03-03T15:19:00", "project_id": "23b55841eedd41e99d5f3f32149ca086", "user_id": null, "metadata": {}}
+
+ @JsonProperty("resource_id")
+ private String resource;
+
+ private String timestamp;
+
+ @JsonProperty("project_id")
+ private String project;
+
+ @JsonProperty("user_id")
+ private String user;
+
+ private Map metadata;
+
+ public String getResource() {
+ return resource;
+ }
+
+ public String getTimestamp() {
+ return timestamp;
+ }
+
+ public String getProject() {
+ return project;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public Map getMetadata() {
+ return metadata;
+ }
+
+ @Override
+ public String toString() {
+ return "Resource [resource=" + resource + ", timestamp=" + timestamp
+ + ", project=" + project + ", user=" + user + ", metadata="
+ + metadata + "]";
+ }
+
+}
diff --git a/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Sample.java b/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Sample.java
new file mode 100644
index 000000000..c17d34159
--- /dev/null
+++ b/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Sample.java
@@ -0,0 +1,94 @@
+package com.woorea.openstack.ceilometer.v2.model;
+
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Sample {
+
+ @JsonProperty("counter_type")
+ private String counterType;
+
+ @JsonProperty("counter_name")
+ private String counterName;
+
+ @JsonProperty("counter_unit")
+ private String counterUnit;
+
+ @JsonProperty("counter_volume")
+ private String counterVolume;
+
+ private String source;
+
+ @JsonProperty("project_id")
+ private String project;
+
+ @JsonProperty("user_id")
+ private String user;
+
+ @JsonProperty("resource_id")
+ private String resource;
+
+ private String timestamp;
+
+ @JsonProperty("message_id")
+ private String message;
+
+ @JsonProperty("resource_metadata")
+ private Map metadata;
+
+ public String getCounterType() {
+ return counterType;
+ }
+
+ public String getCounterName() {
+ return counterName;
+ }
+
+ public String getCounterUnit() {
+ return counterUnit;
+ }
+
+ public String getCounterVolume() {
+ return counterVolume;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public String getProject() {
+ return project;
+ }
+
+ public String getUser() {
+ return user;
+ }
+
+ public String getResource() {
+ return resource;
+ }
+
+ public String getTimestamp() {
+ return timestamp;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public Map getMetadata() {
+ return metadata;
+ }
+
+ @Override
+ public String toString() {
+ return "Sample [counterType=" + counterType + ", counterName="
+ + counterName + ", counterUnit=" + counterUnit
+ + ", counterVolume=" + counterVolume + ", source=" + source
+ + ", project=" + project + ", user=" + user + ", resource="
+ + resource + ", timestamp=" + timestamp + ", message="
+ + message + ", metadata=" + metadata + "]";
+ }
+
+}
diff --git a/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Statistics.java b/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Statistics.java
new file mode 100644
index 000000000..f8236aa21
--- /dev/null
+++ b/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Statistics.java
@@ -0,0 +1,88 @@
+package com.woorea.openstack.ceilometer.v2.model;
+
+import java.math.BigDecimal;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Statistics {
+
+ private BigDecimal avg;
+
+ private BigDecimal count;
+
+ private BigDecimal duration;
+
+ @JsonProperty("duration_start")
+ private String durationStart;
+
+ @JsonProperty("duration_end")
+ private String durationEnd;
+
+ private BigDecimal max;
+
+ private BigDecimal min;
+
+ private BigDecimal period;
+
+ @JsonProperty("period_start")
+ private String periodStart;
+
+ @JsonProperty("period_end")
+ private String periodEnd;
+
+ private BigDecimal sum;
+
+ public BigDecimal getAvg() {
+ return avg;
+ }
+
+ public BigDecimal getCount() {
+ return count;
+ }
+
+ public BigDecimal getDuration() {
+ return duration;
+ }
+
+ public String getDurationStart() {
+ return durationStart;
+ }
+
+ public String getDurationEnd() {
+ return durationEnd;
+ }
+
+ public BigDecimal getMax() {
+ return max;
+ }
+
+ public BigDecimal getMin() {
+ return min;
+ }
+
+ public BigDecimal getPeriod() {
+ return period;
+ }
+
+ public String getPeriodStart() {
+ return periodStart;
+ }
+
+ public String getPeriodEnd() {
+ return periodEnd;
+ }
+
+ public BigDecimal getSum() {
+ return sum;
+ }
+
+ @Override
+ public String toString() {
+ return "Statistics [avg=" + avg + ", count=" + count + ", duration="
+ + duration + ", durationStart=" + durationStart
+ + ", durationEnd=" + durationEnd + ", max=" + max + ", min="
+ + min + ", period=" + period + ", periodStart=" + periodStart
+ + ", periodEnd=" + periodEnd + ", sum=" + sum + "]";
+ }
+
+}
diff --git a/cinder-client/pom.xml b/cinder-client/pom.xml
new file mode 100644
index 000000000..e953379d9
--- /dev/null
+++ b/cinder-client/pom.xml
@@ -0,0 +1,24 @@
+
+ 4.0.0
+
+ com.woorea
+ openstack-java-sdk
+ 3.2.10-SNAPSHOT
+
+ cinder-client
+ OpenStack Cinder Client
+ OpenStack Cinder Client
+
+
+ com.woorea
+ openstack-client
+ 3.2.10-SNAPSHOT
+
+
+
+ com.woorea
+ cinder-model
+ 3.2.10-SNAPSHOT
+
+
+
\ 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
new file mode 100644
index 000000000..4230e8b12
--- /dev/null
+++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/Cinder.java
@@ -0,0 +1,50 @@
+package com.woorea.openstack.cinder;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackClientConnector;
+
+public class Cinder extends OpenStackClient {
+
+ private final VolumesExtension VOLUMES;
+
+ private final SnapshotsExtension SNAPSHOTS;
+
+ private final VolumeTypesExtension VOLUME_TYPES;
+
+ private final LimitsExtension LIMITS;
+
+ private final SchedulerStatsExtension SCHEDULER_STATS;
+
+ public Cinder(String endpoint, OpenStackClientConnector connector) {
+ super(endpoint, connector);
+ VOLUMES = new VolumesExtension(this);
+ SNAPSHOTS = new SnapshotsExtension(this);
+ VOLUME_TYPES = new VolumeTypesExtension(this);
+ LIMITS = new LimitsExtension(this);
+ SCHEDULER_STATS = new SchedulerStatsExtension(this);
+ }
+
+ public Cinder(String endpoint) {
+ this(endpoint, null);
+ }
+
+ public final VolumesExtension volumes() {
+ return VOLUMES;
+ }
+
+ public final SnapshotsExtension snapshots() {
+ return SNAPSHOTS;
+ }
+
+ public final VolumeTypesExtension volumeTypes() {
+ return VOLUME_TYPES;
+ }
+
+ public final LimitsExtension limits() {
+ return LIMITS;
+ }
+
+ public final SchedulerStatsExtension schedulerStats() {
+ return SCHEDULER_STATS;
+ }
+}
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
new file mode 100644
index 000000000..0d4a78597
--- /dev/null
+++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/LimitsExtension.java
@@ -0,0 +1,28 @@
+package com.woorea.openstack.cinder;
+
+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.cinder.model.Limits;
+
+public class LimitsExtension {
+
+ private final OpenStackClient CLIENT;
+
+ public LimitsExtension(OpenStackClient client) {
+ CLIENT = client;
+ }
+
+ public List list() {
+ return new List();
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List() {
+ super(CLIENT, HttpMethod.GET, "/limits", null, Limits.class);
+ }
+
+ }
+
+}
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
new file mode 100644
index 000000000..7af0f273a
--- /dev/null
+++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/SchedulerStatsExtension.java
@@ -0,0 +1,30 @@
+package com.woorea.openstack.cinder;
+
+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.cinder.model.Pools;
+
+/**
+ * Cinder Scheduler Stats Management
+ */
+public class SchedulerStatsExtension {
+
+ private final OpenStackClient CLIENT;
+
+ public SchedulerStatsExtension(OpenStackClient client) {
+ this.CLIENT = client;
+ }
+
+ public List list(boolean detail) {
+ return new List(detail);
+ }
+
+ 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);
+ }
+ }
+
+}
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
new file mode 100644
index 000000000..c5bab0743
--- /dev/null
+++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/SnapshotsExtension.java
@@ -0,0 +1,111 @@
+package com.woorea.openstack.cinder;
+
+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.cinder.model.Metadata;
+import com.woorea.openstack.cinder.model.Snapshot;
+import com.woorea.openstack.cinder.model.SnapshotForCreate;
+import com.woorea.openstack.cinder.model.SnapshotForUpdate;
+import com.woorea.openstack.cinder.model.Snapshots;
+
+public class SnapshotsExtension {
+
+ private final OpenStackClient CLIENT;
+
+ public SnapshotsExtension(OpenStackClient client) {
+ CLIENT = client;
+ }
+
+ public List list(boolean detail) {
+ return new List(detail);
+ }
+
+ public Create create(SnapshotForCreate snapshotForCreate) {
+ return new Create(snapshotForCreate);
+ }
+
+ public Show show(String id) {
+ return new Show(id);
+ }
+
+ public ShowMetadata showMetadata(String snapshotId) {
+ return new ShowMetadata(snapshotId);
+ }
+
+ public UpdateMetadata updateMetadata(String snapshotId, Metadata metadata) {
+ return new UpdateMetadata(snapshotId, metadata);
+ }
+
+ public Delete delete(String id) {
+ return new Delete(id);
+ }
+
+ public Update update(String id, SnapshotForUpdate snapshot) {
+ return new Update(id, snapshot);
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List(boolean detail) {
+ super(CLIENT, HttpMethod.GET, detail ? "/snapshots/detail" : "/snapshots", null, Snapshots.class);
+ }
+
+ }
+
+ public class Create extends OpenStackRequest {
+
+ public Create(SnapshotForCreate snapshotForCreate) {
+ super(CLIENT, HttpMethod.POST, "/snapshots", Entity.json(snapshotForCreate), Snapshot.class);
+ }
+
+ }
+
+ public class Show extends OpenStackRequest {
+
+ public Show(String id) {
+ super(CLIENT, HttpMethod.GET, new StringBuilder("/snapshots/").append(id).toString(), null, Snapshot.class);
+ }
+
+ }
+
+ public class Delete extends OpenStackRequest {
+
+ public Delete(String id) {
+ super(CLIENT, HttpMethod.DELETE, new StringBuilder("/snapshots/").append(id).toString(), null, Void.class);
+ }
+
+ }
+
+ 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);
+ }
+
+ }
+
+ public class ShowMetadata extends OpenStackRequest {
+
+ public ShowMetadata(String id) {
+ super(CLIENT,
+ HttpMethod.GET,
+ new StringBuilder("/snapshots/").append(id).append("/metadata").toString(),
+ null,
+ Metadata.class);
+ }
+
+ }
+
+ 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);
+ }
+
+ }
+}
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
new file mode 100644
index 000000000..5951e1cfd
--- /dev/null
+++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/VolumeTypesExtension.java
@@ -0,0 +1,70 @@
+package com.woorea.openstack.cinder;
+
+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.cinder.model.VolumeType;
+import com.woorea.openstack.cinder.model.VolumeTypeForCreate;
+import com.woorea.openstack.cinder.model.VolumeTypes;
+
+public class VolumeTypesExtension {
+
+ private final OpenStackClient CLIENT;
+
+ public VolumeTypesExtension(OpenStackClient client) {
+ CLIENT = client;
+ }
+
+ public List list() {
+ return new List();
+ }
+
+ public Create create(VolumeTypeForCreate volumeTypeForCreate) {
+ return new Create(volumeTypeForCreate);
+ }
+
+ public Show show(String id) {
+ return new Show(id);
+ }
+
+ public Delete delete(String id) {
+ return new Delete(id);
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List() {
+ super(CLIENT, HttpMethod.GET, "/types", null, VolumeTypes.class);
+ }
+
+ }
+
+ public class Create extends OpenStackRequest {
+
+ private VolumeTypeForCreate volumeTypeForCreate;
+
+ public Create(VolumeTypeForCreate volumeTypeForCreate) {
+ super(CLIENT, HttpMethod.POST, "/types", Entity.json(volumeTypeForCreate), VolumeType.class);
+ this.volumeTypeForCreate = volumeTypeForCreate;
+ }
+
+ }
+
+ public class Show extends OpenStackRequest {
+
+ public Show(String id) {
+ super(CLIENT, HttpMethod.GET, new StringBuilder("/types/").append(id).toString(), null, VolumeType.class);
+ }
+
+ }
+
+ public class Delete extends OpenStackRequest {
+
+ public Delete(String id) {
+ super(CLIENT, HttpMethod.DELETE, new StringBuilder("/types/").append(id).toString(), null, Void.class);
+ }
+
+ }
+
+}
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
new file mode 100644
index 000000000..39bcc0e4d
--- /dev/null
+++ b/cinder-client/src/main/java/com/woorea/openstack/cinder/VolumesExtension.java
@@ -0,0 +1,164 @@
+package com.woorea.openstack.cinder;
+
+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.cinder.model.ConnectionForInitialize;
+import com.woorea.openstack.cinder.model.ConnectionForTerminate;
+import com.woorea.openstack.cinder.model.ConnectionInfo;
+import com.woorea.openstack.cinder.model.Metadata;
+import com.woorea.openstack.cinder.model.Volume;
+import com.woorea.openstack.cinder.model.VolumeForCreate;
+import com.woorea.openstack.cinder.model.VolumeForExtend;
+import com.woorea.openstack.cinder.model.VolumeForImageCreate;
+import com.woorea.openstack.cinder.model.VolumeForUpdate;
+import com.woorea.openstack.cinder.model.Volumes;
+
+public class VolumesExtension {
+
+ private final OpenStackClient CLIENT;
+
+ public VolumesExtension(OpenStackClient client) {
+ CLIENT = client;
+ }
+
+ public List list(boolean detail) {
+ return new List(detail);
+ }
+
+ public Create create(VolumeForCreate volume) {
+ return new Create(volume);
+ }
+
+ public UploadToImage uploadToImage(VolumeForImageCreate volumeForImage) {
+ return new UploadToImage(volumeForImage);
+ }
+
+ public Show show(String id) {
+ return new Show(id);
+ }
+
+ public ShowMetadata showMetadata(String id) {
+ return new ShowMetadata(id);
+ }
+
+ public Delete delete(String id) {
+ return new Delete(id);
+ }
+
+ public Update update(String id, VolumeForUpdate volume) {
+ return new Update(id, volume);
+ }
+
+ public Extend extend(String id, int newSize) {
+ VolumeForExtend volume = new VolumeForExtend();
+ volume.setSize(newSize);
+ return new Extend(id, volume);
+ }
+
+ public InitializeConnection initializeConnection(String id, ConnectionForInitialize connectionForInitialize) {
+ return new InitializeConnection(id, connectionForInitialize);
+ }
+
+ public TerminateConnection terminateConnection(String id, ConnectionForTerminate connectionForTerminate) {
+ return new TerminateConnection(id, connectionForTerminate);
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List(boolean detail) {
+ super(CLIENT, HttpMethod.GET, detail ? "/volumes/detail"
+ : "/volumes", null, Volumes.class);
+ }
+
+ }
+
+ public class Create extends OpenStackRequest {
+
+ public Create(VolumeForCreate volume) {
+ super(CLIENT, HttpMethod.POST, "/volumes", Entity.json(volume),
+ Volume.class);
+ }
+
+ }
+
+ // Upload volume to image service as image
+
+ public class UploadToImage extends OpenStackRequest {
+
+ public UploadToImage(VolumeForImageCreate volumeForImageCreate) {
+ super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/")
+ .append(volumeForImageCreate.getVolumeId() + "/action").toString(),
+ Entity.json(volumeForImageCreate), Void.class);
+ }
+
+ }
+
+ public class Show extends OpenStackRequest {
+
+ public Show(String id) {
+ super(CLIENT, HttpMethod.GET, new StringBuilder("/volumes/")
+ .append(id).toString(), null, Volume.class);
+ }
+
+ }
+
+ public class ShowMetadata extends OpenStackRequest {
+
+ public ShowMetadata(String id) {
+ super(CLIENT, HttpMethod.GET, new StringBuilder("/volumes/")
+ .append(id).append("/metadata").toString(), null,
+ Metadata.class);
+ }
+
+ }
+
+ public class Delete extends OpenStackRequest {
+
+ public Delete(String id) {
+ super(CLIENT, HttpMethod.DELETE, new StringBuilder("/volumes/")
+ .append(id).toString(), null, Void.class);
+ }
+
+ }
+
+ 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);
+ }
+
+ }
+
+ public class Extend extends OpenStackRequest {
+
+ public Extend(String id, VolumeForExtend volume) {
+ super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/").append(id).append("/action").toString(),
+ Entity.json(volume), Void.class);
+ }
+
+ }
+
+ public class InitializeConnection extends OpenStackRequest {
+
+ public InitializeConnection(String id, ConnectionForInitialize connectionForInitialize) {
+ super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/")
+ .append(id).append("/action").toString(),
+ Entity.json(connectionForInitialize), ConnectionInfo.class);
+ }
+
+ }
+
+ public class TerminateConnection extends OpenStackRequest {
+
+ public TerminateConnection(String id, ConnectionForTerminate connectionForTerminate) {
+ super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/")
+ .append(id).append("/action").toString(),
+ Entity.json(connectionForTerminate), Void.class);
+ }
+
+ }
+
+}
diff --git a/cinder-model/pom.xml b/cinder-model/pom.xml
new file mode 100644
index 000000000..b5fcc3577
--- /dev/null
+++ b/cinder-model/pom.xml
@@ -0,0 +1,11 @@
+
+ 4.0.0
+
+ com.woorea
+ openstack-java-sdk
+ 3.2.10-SNAPSHOT
+
+ cinder-model
+ OpenStack Cinder Model
+ OpenStack Cinder Model
+
\ No newline at end of file
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/BaseConnection.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/BaseConnection.java
new file mode 100644
index 000000000..e2fc8c2ed
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/BaseConnection.java
@@ -0,0 +1,28 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public abstract class BaseConnection implements Serializable {
+ @JsonProperty("connector")
+ private Map connector = new HashMap();
+
+ /**
+ * @return the connector
+ */
+ public Map getConnector() {
+ return connector;
+ }
+
+ /**
+ * @param connector
+ * the connector to set
+ */
+ public void setConnector(Map connector) {
+ this.connector = connector;
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Capabilities.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Capabilities.java
new file mode 100644
index 000000000..c8cd98b6b
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Capabilities.java
@@ -0,0 +1,139 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+/**
+ * Model for Volume
+ */
+@JsonRootName("capabilities")
+public class Capabilities implements Serializable {
+
+ @JsonProperty("pool_name")
+ private String poolName;
+ @JsonProperty("QoS_support")
+ private boolean qosSupport;
+ @JsonProperty("allocated_capacity_gb")
+ private Long allocatedCapacityGb;
+ @JsonProperty("driver_version")
+ private String driverVersion;
+ @JsonProperty("free_capacity_gb")
+ private Long freeCapacityGb;
+ @JsonProperty("location_info")
+ private String locationInfo;
+
+ private String timestamp;
+ @JsonProperty("volume_backend_name")
+ private String volumeBackendName;
+ @JsonProperty("total_capacity_gb")
+ private Long totalCapacityGb;
+ @JsonProperty("reserved_percentage")
+ private Integer reservedPercentage;
+ @JsonProperty("vendor_name")
+ private String vendorName;
+ @JsonProperty("storage_protocol")
+ private String storageProtocol;
+ @JsonProperty("extra_specs")
+ private Map extraSpecs;
+
+ public String getPoolName() {
+ return poolName;
+ }
+ public void setPoolName(String poolName) {
+ this.poolName = poolName;
+ }
+ public boolean isQosSupport() {
+ return qosSupport;
+ }
+ public void setQosSupport(boolean qosSupport) {
+ this.qosSupport = qosSupport;
+ }
+ public Long getAllocatedCapacityGb() {
+ return allocatedCapacityGb;
+ }
+ public void setAllocatedCapacityGb(Long allocatedCapacityGb) {
+ this.allocatedCapacityGb = allocatedCapacityGb;
+ }
+ public String getDriverVersion() {
+ return driverVersion;
+ }
+ public void setDriverVersion(String driverVersion) {
+ this.driverVersion = driverVersion;
+ }
+ public Long getFreeCapacityGb() {
+ return freeCapacityGb;
+ }
+ public void setFreeCapacityGb(Long freeCapacityGb) {
+ this.freeCapacityGb = freeCapacityGb;
+ }
+ public String getLocationInfo() {
+ return locationInfo;
+ }
+ public void setLocationInfo(String locationInfo) {
+ this.locationInfo = locationInfo;
+ }
+ public String getTimestamp() {
+ return timestamp;
+ }
+ public void setTimestamp(String timestamp) {
+ this.timestamp = timestamp;
+ }
+ public String getVolumeBackendName() {
+ return volumeBackendName;
+ }
+ public void setVolumeBackendName(String volumeBackendName) {
+ this.volumeBackendName = volumeBackendName;
+ }
+ public Long getTotalCapacityGb() {
+ return totalCapacityGb;
+ }
+ public void setTotalCapacityGb(Long totalCapacityGb) {
+ this.totalCapacityGb = totalCapacityGb;
+ }
+ public Integer getReservedPercentage() {
+ return reservedPercentage;
+ }
+ public void setReservedPercentage(Integer reservedPercentage) {
+ this.reservedPercentage = reservedPercentage;
+ }
+ public String getVendorName() {
+ return vendorName;
+ }
+ public void setVendorName(String vendorName) {
+ this.vendorName = vendorName;
+ }
+ public String getStorageProtocol() {
+ return storageProtocol;
+ }
+ public void setStorageProtocol(String storageProtocol) {
+ this.storageProtocol = storageProtocol;
+ }
+ public Map getExtraSpecs() {
+ return extraSpecs;
+ }
+ public void setExtraSpecs(Map extraSpecs) {
+ this.extraSpecs = extraSpecs;
+ }
+
+ @Override
+ public String toString() {
+ return "Capabilities{"
+ + "poolName='" + poolName
+ + ", qosSupport='" + qosSupport
+ + ", allocatedCapacityGb='" + allocatedCapacityGb
+ + ", driverVersion='" + driverVersion
+ + ", freeCapacityGb='" + freeCapacityGb
+ + ", locationInfo='" + locationInfo
+ + ", timestamp='" + timestamp
+ + ", volumeBackendName='" + volumeBackendName
+ + ", totalCapacityGb='" + totalCapacityGb
+ + ", reservedPercentage='" + reservedPercentage
+ + ", vendorName='" + vendorName
+ + ", storageProtocol='" + storageProtocol
+ + ", extraSpecs='" + extraSpecs
+ + '}';
+ }
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionForInitialize.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionForInitialize.java
new file mode 100644
index 000000000..47218054c
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionForInitialize.java
@@ -0,0 +1,20 @@
+package com.woorea.openstack.cinder.model;
+
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+import java.io.Serializable;
+
+@JsonRootName("os-initialize_connection")
+public class ConnectionForInitialize extends BaseConnection implements Serializable {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "ConnectionForInitialize [connector=" + getConnector() + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionForTerminate.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionForTerminate.java
new file mode 100644
index 000000000..7fee326b4
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionForTerminate.java
@@ -0,0 +1,20 @@
+package com.woorea.openstack.cinder.model;
+
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+import java.io.Serializable;
+
+@JsonRootName("os-terminate_connection")
+public class ConnectionForTerminate extends BaseConnection implements Serializable {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "ConnectionForInitialize [connector=" + getConnector() + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionInfo.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionInfo.java
new file mode 100644
index 000000000..362aaca02
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionInfo.java
@@ -0,0 +1,58 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("connection_info")
+public class ConnectionInfo implements Serializable {
+
+ @JsonProperty("driver_volume_type")
+ private String driverVolumeType;
+
+ private Map data;
+
+ /**
+ * @return the driverVolumeType
+ */
+ public String getDriverVolumeType() {
+ return driverVolumeType;
+ }
+
+ /**
+ * @param driverVolumeType
+ * the driverVolumeType to set
+ */
+ public void setDriverVolumeType(String driverVolumeType) {
+ this.driverVolumeType = driverVolumeType;
+ }
+
+ /**
+ * @return the data
+ */
+ public Map getData() {
+ return data;
+ }
+
+ /**
+ * @param data
+ * the data to set
+ */
+ public void setData(Map data) {
+ this.data = data;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "ConnectionInfo [driverVolumeType=" + driverVolumeType + "," +
+ " data=" + data + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Limits.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Limits.java
new file mode 100644
index 000000000..d6ef7762d
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Limits.java
@@ -0,0 +1,246 @@
+package com.woorea.openstack.cinder.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+import java.io.Serializable;
+import java.util.Calendar;
+import java.util.List;
+
+@JsonRootName("limits")
+public class Limits implements Serializable {
+
+ public static final class RateLimit implements Serializable {
+
+ public static final class LimitEntry implements Serializable {
+
+ @JsonProperty("next-available")
+ private Calendar nextAvailable;
+
+ private String unit;
+
+ private String verb;
+
+ private Integer remaining;
+
+ private Integer available;
+
+ private Integer value;
+
+ /**
+ * @return the nextAvailable
+ */
+ public Calendar getNextAvailable() {
+ return nextAvailable;
+ }
+
+ /**
+ * @return the unit
+ */
+ public String getUnit() {
+ return unit;
+ }
+
+ /**
+ * @return the verb
+ */
+ public String getVerb() {
+ return verb;
+ }
+
+ /**
+ * @return the remaining
+ */
+ public Integer getRemaining() {
+ return remaining;
+ }
+
+ /**
+ * @return the available
+ */
+ public Integer getAvailable() {
+ return available;
+ }
+
+ /**
+ * @return the value
+ */
+ public Integer getValue() {
+ return value;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "LimitEntry [nextAvailable=" + nextAvailable + ", unit="
+ + unit + ", verb=" + verb + ", remaining=" + remaining
+ + ", available=" + available + ", value=" + value + "]";
+ }
+
+ }
+
+ private String regex;
+
+ private String uri;
+
+ private List limit;
+
+ /**
+ * @return the regex
+ */
+ public String getRegex() {
+ return regex;
+ }
+
+ /**
+ * @return the uri
+ */
+ public String getUri() {
+ return uri;
+ }
+
+ /**
+ * @return the limit
+ */
+ public List getLimit() {
+ return limit;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "RateLimit [regex=" + regex + ", uri=" + uri + ", limit="
+ + limit + "]";
+ }
+
+ }
+
+ public static final class AbsoluteLimit {
+
+ private Integer maxTotalVolumes;
+ private Integer totalVolumesUsed;
+
+ private Integer maxTotalSnapshots;
+ private Integer totalSnapshotsUsed;
+
+ private Integer maxTotalVolumeGigabytes;
+ private Integer totalGigabytesUsed;
+
+ private Integer maxTotalBackups;
+ private Integer totalBackupsUsed;
+
+ private Integer maxTotalBackupGigabytes;
+ private Integer totalBackupGigabytesUsed;
+
+ /**
+ * @return the maxTotalVolumes
+ */
+ public Integer getMaxTotalVolumes() {
+ return maxTotalVolumes;
+ }
+
+ /**
+ * @return the totalVolumesUsed
+ */
+ public Integer getTotalVolumesUsed() {
+ return totalVolumesUsed;
+ }
+
+ /**
+ * @return the maxTotalSnapshots
+ */
+ public Integer getMaxTotalSnapshots() {
+ return maxTotalSnapshots;
+ }
+
+ /**
+ * @return the totalSnapshotsUsed
+ */
+ public Integer getTotalSnapshotsUsed() {
+ return totalSnapshotsUsed;
+ }
+
+ /**
+ * @return the maxTotalVolumeGigabytes
+ */
+ public Integer getMaxTotalVolumeGigabytes() {
+ return maxTotalVolumeGigabytes;
+ }
+
+ /**
+ * @return the totalGigabytesUsed
+ */
+ public Integer getTotalGigabytesUsed() {
+ return totalGigabytesUsed;
+ }
+
+ /**
+ * @return the maxTotalBackupGigabytes
+ */
+ public Integer getMaxTotalBackupGigabytes() {
+ return maxTotalBackupGigabytes;
+ }
+
+ /**
+ * @return the totalBackupGigabytesUsed
+ */
+ public Integer getTotalBackupGigabytesUsed() {
+ return totalBackupGigabytesUsed;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "AbsoluteLimit [maxTotalVolumes=" + maxTotalVolumes +
+ ", totalVolumesUsed=" + totalVolumesUsed +
+ ", maxTotalSnapshots=" + maxTotalSnapshots +
+ ", totalSnapshotsUsed=" + totalSnapshotsUsed +
+ ", maxTotalVolumeGigabytes=" + maxTotalVolumeGigabytes +
+ ", totalGigabytesUsed=" + totalGigabytesUsed +
+ ", maxTotalBackupGigabytes=" + maxTotalBackupGigabytes +
+ ", totalBackupGigabytesUsed=" + totalBackupGigabytesUsed +"]";
+ }
+
+ }
+
+ private List rate;
+
+ private AbsoluteLimit absolute;
+
+ /**
+ * @return the rate
+ */
+ public List getRate() {
+ return rate;
+ }
+
+ /**
+ * @return the absolute
+ */
+ public AbsoluteLimit getAbsolute() {
+ return absolute;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Limits [rate=" + rate + ", absolute=" + absolute + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Metadata.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Metadata.java
new file mode 100644
index 000000000..3949a853e
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Metadata.java
@@ -0,0 +1,35 @@
+package com.woorea.openstack.cinder.model;
+
+import java.util.Map;
+
+public class Metadata {
+
+ private Map metadata;
+
+ /**
+ * @return the metadata
+ */
+ public Map getMetadata() {
+ return metadata;
+ }
+
+ /**
+ * Set the metadata
+ *
+ * @param metadata
+ */
+ public void setMetadata(Map metadata) {
+ this.metadata = metadata;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Metadata [metadata=" + metadata + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Pool.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Pool.java
new file mode 100644
index 000000000..1e8da7166
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Pool.java
@@ -0,0 +1,42 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+/**
+ * Model for Pool
+ */
+@JsonRootName("pool")
+public class Pool implements Serializable {
+
+ private String name;
+
+ private Capabilities capabilities;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Capabilities getCapabilities() {
+ return capabilities;
+ }
+
+ public void setCapabilities(Capabilities capabilities) {
+ this.capabilities = capabilities;
+ }
+
+ @Override
+ public String toString() {
+ return "Pool{"
+ + "name='" + name
+ + ", capabilities='" + capabilities
+ + '}';
+ }
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Pools.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Pools.java
new file mode 100644
index 000000000..3816362f7
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Pools.java
@@ -0,0 +1,33 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Model for List of pools
+ */
+public class Pools implements Iterable, Serializable {
+
+ @JsonProperty("pools")
+ private List list;
+
+ public List getList() {
+ return list;
+ }
+
+ public void setList(List list) {
+ this.list = list;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return list.iterator();
+ }
+
+ @Override
+ public String toString() {
+ return "Pools [list=" + list + "]";
+ }
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Snapshot.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Snapshot.java
new file mode 100644
index 000000000..60b7ef13f
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Snapshot.java
@@ -0,0 +1,99 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("snapshot")
+public class Snapshot implements Serializable {
+
+ private String id;
+
+ private String status;
+
+ private String name;
+
+ private String description;
+
+ @JsonProperty("volume_id")
+ private String volumeId;
+
+ private Integer size;
+
+ @JsonProperty("created_at")
+ private String createdAt;
+
+ private Map metadata;
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @return the status
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @return the volumeId
+ */
+ public String getVolumeId() {
+ return volumeId;
+ }
+
+ /**
+ * @return the size
+ */
+ public Integer getSize() {
+ return size;
+ }
+
+ /**
+ * @return the createdAt
+ */
+ public String getCreatedAt() {
+ return createdAt;
+ }
+
+ /**
+ * @return the metadata
+ */
+ public Map getMetadata() {
+ return metadata;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Snapshot [id=" + id + ", status=" + status +
+ ", name=" + name + ", description=" + description +
+ ", volumeId=" + volumeId + ", size=" + size +
+ ", createdAt=" + createdAt + ", metadata=" + metadata + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/SnapshotForCreate.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/SnapshotForCreate.java
new file mode 100644
index 000000000..3634fcb0a
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/SnapshotForCreate.java
@@ -0,0 +1,91 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("snapshot")
+public class SnapshotForCreate implements Serializable {
+
+ @JsonProperty("volume_id")
+ private String volumeId;
+
+ private Boolean force;
+
+ private String name;
+
+ private String description;
+
+ /**
+ * @return the volumeId
+ */
+ public String getVolumeId() {
+ return volumeId;
+ }
+
+ /**
+ * @param volumeId
+ * the volumeId to set
+ */
+ public void setVolumeId(String volumeId) {
+ this.volumeId = volumeId;
+ }
+
+ /**
+ * @return the force
+ */
+ public Boolean getForce() {
+ return force;
+ }
+
+ /**
+ * @param force
+ * the force to set
+ */
+ public void setForce(Boolean force) {
+ this.force = force;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name
+ * the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @param description
+ * the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "SnapshotForCreate [volumeId=" + volumeId + ", force=" + force
+ + ", name=" + name + ", description=" + description + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/SnapshotForUpdate.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/SnapshotForUpdate.java
new file mode 100644
index 000000000..525ef3c31
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/SnapshotForUpdate.java
@@ -0,0 +1,54 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("snapshot")
+public class SnapshotForUpdate implements Serializable {
+
+ private String name;
+
+ private String description;
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name
+ * the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @param description
+ * the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "SnapshotForUpdate [name=" + name + ", description=" + description + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Snapshots.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Snapshots.java
new file mode 100644
index 000000000..176b1c459
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Snapshots.java
@@ -0,0 +1,36 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Snapshots implements Iterable, Serializable {
+
+ @JsonProperty("snapshots")
+ private List list;
+
+ /**
+ * @return the list
+ */
+ public List getList() {
+ return list;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Snapshots [list=" + list + "]";
+ }
+
+ @Override
+ public Iterator iterator() {
+ return list.iterator();
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Volume.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Volume.java
new file mode 100644
index 000000000..a5fda3f20
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Volume.java
@@ -0,0 +1,166 @@
+package com.woorea.openstack.cinder.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+@JsonRootName("volume")
+public class Volume implements Serializable {
+
+ private String id;
+
+ private String status;
+
+ private String name;
+
+ private String description;
+
+ @JsonProperty("availability_zone")
+ private String availabilityZone;
+
+ @JsonProperty("volume_type")
+ private String volumeType;
+
+ @JsonProperty("snapshot_id")
+ private String snapshotId;
+
+ @JsonProperty("source_volid")
+ private String sourceVolid;
+
+ @JsonProperty("bootable")
+ private Boolean bootable;
+
+ private List> attachments;
+
+ private Map metadata;
+
+ @JsonProperty("created_at")
+ private String createdAt;
+
+ private Integer size;
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @return the status
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @return the availabilityZone
+ */
+ public String getAvailabilityZone() {
+ return availabilityZone;
+ }
+
+ /**
+ * @return the volumeType
+ */
+ public String getVolumeType() {
+ return volumeType;
+ }
+
+ /**
+ * @return the snapshotId
+ */
+ public String getSnapshotId() {
+ return snapshotId;
+ }
+
+ /**
+ * @return the ID of an existing volume (specify in order to create a volume from an existing volume)
+ */
+ public String getSourceVolid() {
+ return sourceVolid;
+ }
+
+ /**
+ * @param sourceVolid
+ * to set
+ */
+ public void setSourceVolid(String sourceVolid) {
+ this.sourceVolid = sourceVolid;
+ }
+
+ /**
+ * @param volumeType
+ * to set
+ */
+ public void setVolumeType(String volumeType) {
+ this.volumeType = volumeType;
+ }
+
+ /**
+ * @return the bootable flag to set
+ */
+ public Boolean getBootable() {
+ return bootable;
+ }
+
+ /**
+ * @return the attachments
+ */
+ public List> getAttachments() {
+ return attachments;
+ }
+
+ /**
+ * @return the metadata
+ */
+ public Map getMetadata() {
+ return metadata;
+ }
+
+ /**
+ * @return the createdAt
+ */
+ public String getCreatedAt() {
+ return createdAt;
+ }
+
+ /**
+ * @return the size
+ */
+ public Integer getSize() {
+ return size;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Volume [id=" + id + ", status=" + status +
+ ", name=" + name + ", description=" + description +
+ ", availabilityZone=" + availabilityZone + ", volumeType=" + volumeType +
+ ", snapshotId=" + snapshotId + ", attachments=" + attachments +
+ ", metadata=" + metadata + ", createdAt=" + createdAt + ", size=" + size + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForCreate.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForCreate.java
new file mode 100644
index 000000000..44e6eced8
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForCreate.java
@@ -0,0 +1,211 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("volume")
+public class VolumeForCreate implements Serializable {
+
+ private Integer size;
+
+ @JsonProperty("availability_zone")
+ private String availabilityZone;
+
+ @JsonProperty("display_name")
+ private String name;
+
+ @JsonProperty("display_description")
+ private String description;
+
+ @JsonProperty("snapshot_id")
+ private String snapshotId;
+
+ @JsonProperty("source_volid")
+ private String sourceVolid;
+
+ @JsonProperty("imageRef")
+ private String imageRef;
+
+ @JsonProperty("volume_type")
+ private String volumeType;
+
+ @JsonProperty("bootable")
+ private Boolean bootable;
+
+ private Map metadata;
+
+ /**
+ * @return the size
+ */
+ public Integer getSize() {
+ return size;
+ }
+
+ /**
+ * @param size
+ * the size to set
+ */
+ public void setSize(Integer size) {
+ this.size = size;
+ }
+
+ /**
+ * @return the availabilityZone
+ */
+ public String getAvailabilityZone() {
+ return availabilityZone;
+ }
+
+ /**
+ * @param availabilityZone
+ * the availabilityZone to set
+ */
+ public void setAvailabilityZone(String availabilityZone) {
+ this.availabilityZone = availabilityZone;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name
+ * the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @param description
+ * the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * @return the snapshotId
+ */
+ public String getSnapshotId() {
+ return snapshotId;
+ }
+
+ /**
+ * @param snapshotId
+ * the snapshotId to set
+ */
+ public void setSnapshotId(String snapshotId) {
+ this.snapshotId = snapshotId;
+ }
+
+ /**
+ * @return the ID of an existing volume (specify in order to create a volume from an existing volume)
+ */
+ public String getSourceVolid() {
+ return sourceVolid;
+ }
+
+ /**
+ * @param sourceVolid
+ * to set
+ */
+ public void setSourceVolid(String sourceVolid) {
+ this.sourceVolid = sourceVolid;
+ }
+
+ /**
+ * @return the ID of the image from which you want to create the volume (required to create a bootable volume)
+ */
+ public String getImageRef() {
+ return imageRef;
+ }
+
+ /**
+ * @param imageRef
+ * to set
+ */
+ public void setImageRef(String imageRef) {
+ this.imageRef = imageRef;
+ }
+
+ /**
+ * @return the associated volume type
+ */
+ public String getVolumeType() {
+ return volumeType;
+ }
+
+ /**
+ * @param volumeType
+ * to set
+ */
+ public void setVolumeType(String volumeType) {
+ this.volumeType = volumeType;
+ }
+
+ /**
+ * @return the bootable flag to set
+ */
+ public Boolean getBootable() {
+ return bootable;
+ }
+
+ /**
+ * Enables or disables the bootable attribute. You can boot an instance from a bootable volume.
+ *
+ * @param bootable
+ * flag
+ */
+ public void setBootable(Boolean bootable) {
+ this.bootable = bootable;
+ }
+
+ /**
+ * @return the metadata
+ */
+ public Map getMetadata() {
+ return metadata;
+ }
+
+ /**
+ * @param metadata
+ * the metadata to set
+ */
+ public void setMetadata(Map metadata) {
+ this.metadata = metadata;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "VolumeForCreate [size=" + size +
+ ", availabilityZone=" + availabilityZone +
+ ", name=" + name +
+ ", description=" + description +
+ ", snapshotId=" + snapshotId +
+ ", source_volid=" + sourceVolid +
+ ", imageRef=" + imageRef +
+ ", volume_type=" + volumeType +
+ ", bootable=" + bootable +
+ ", metadata=" + metadata + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForExtend.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForExtend.java
new file mode 100644
index 000000000..5a73dc870
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForExtend.java
@@ -0,0 +1,39 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("os-extend")
+public class VolumeForExtend implements Serializable {
+
+ @JsonProperty("new_size")
+ private Integer size;
+
+ /**
+ * @return the size
+ */
+ public Integer getSize() {
+ return size;
+ }
+
+ /**
+ * @param size
+ * the size to set
+ */
+ public void setSize(Integer size) {
+ this.size = size;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "VolumeForExtend [size=" + size + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForImageCreate.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForImageCreate.java
new file mode 100644
index 000000000..4e67566f6
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForImageCreate.java
@@ -0,0 +1,71 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("os-volume_upload_image")
+public class VolumeForImageCreate implements Serializable {
+ String volumeId;
+ String tenantId;
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ @JsonProperty("force")
+ private Boolean force;
+
+ public Boolean getForce() {
+ return force;
+ }
+
+ public void setForce(Boolean force) {
+ this.force = force;
+ }
+
+ @JsonProperty("container_format")
+ String container_format;
+ @JsonProperty("disk_format")
+ String disk_format;
+ @JsonProperty("image_name")
+ String image_name;
+
+ public String getVolumeId() {
+ return volumeId;
+ }
+
+ public void setVolumeId(String volumeId) {
+ this.volumeId = volumeId;
+ }
+
+ public String getContainer_format() {
+ return container_format;
+ }
+
+ public void setContainer_format(String container_format) {
+ this.container_format = container_format;
+ }
+
+ public String getDisk_format() {
+ return disk_format;
+ }
+
+ public void setDisk_format(String disk_format) {
+ this.disk_format = disk_format;
+ }
+
+ public String getImage_name() {
+ return image_name;
+ }
+
+ public void setImage_name(String image_name) {
+ this.image_name = image_name;
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForUpdate.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForUpdate.java
new file mode 100644
index 000000000..6ea3306ca
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForUpdate.java
@@ -0,0 +1,54 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("volume")
+public class VolumeForUpdate implements Serializable {
+
+ private String name;
+
+ private String description;
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name
+ * the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @param description
+ * the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "VolumeForUpdate [name=" + name + ", description=" + description + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeType.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeType.java
new file mode 100644
index 000000000..702fc41b2
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeType.java
@@ -0,0 +1,50 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("volume_type")
+public class VolumeType implements Serializable {
+
+ private String id;
+
+ private String name;
+
+ @JsonProperty("extra_specs")
+ private Map extraSpecs;
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the extra_specs
+ */
+ public Map getExtraSpecs() {
+ return extraSpecs;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "VolumeType [id=" + id + ", name=" + name + ", extra_specs=" + extraSpecs + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeTypeForCreate.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeTypeForCreate.java
new file mode 100644
index 000000000..aaa6992e4
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeTypeForCreate.java
@@ -0,0 +1,57 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("volume_type")
+public class VolumeTypeForCreate implements Serializable {
+
+ private String name;
+
+ @JsonProperty("extra_specs")
+ private Map extraSpecs;
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name
+ * the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the extraSpecs
+ */
+ public Map getExtraSpecs() {
+ return extraSpecs;
+ }
+
+ /**
+ * @param extraSpecs
+ * the extra_specs to set
+ */
+ public void setExtraSpecs(Map extraSpecs) {
+ this.extraSpecs = extraSpecs;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "VolumeForCreate [name=" + name + ", metadata=" + extraSpecs + "]";
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeTypes.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeTypes.java
new file mode 100644
index 000000000..f341cafdd
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeTypes.java
@@ -0,0 +1,36 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class VolumeTypes implements Iterable, Serializable {
+
+ @JsonProperty("volume_types")
+ private List list;
+
+ /**
+ * @return the list
+ */
+ public List getList() {
+ return list;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Volume Types [list=" + list + "]";
+ }
+
+ @Override
+ public Iterator iterator() {
+ return list.iterator();
+ }
+
+}
diff --git a/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Volumes.java b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Volumes.java
new file mode 100644
index 000000000..6de026556
--- /dev/null
+++ b/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Volumes.java
@@ -0,0 +1,36 @@
+package com.woorea.openstack.cinder.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Volumes implements Iterable, Serializable {
+
+ @JsonProperty("volumes")
+ private List list;
+
+ /**
+ * @return the list
+ */
+ public List getList() {
+ return list;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Volumes [list=" + list + "]";
+ }
+
+ @Override
+ public Iterator iterator() {
+ return list.iterator();
+ }
+
+}
diff --git a/etc/config/checkstyle.xml b/etc/config/checkstyle.xml
deleted file mode 100644
index 846be85b7..000000000
--- a/etc/config/checkstyle.xml
+++ /dev/null
@@ -1,242 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/etc/config/findbugs-exclude.xml b/etc/config/findbugs-exclude.xml
deleted file mode 100644
index ee636f651..000000000
--- a/etc/config/findbugs-exclude.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/etc/config/javadoc-stylesheet.css b/etc/config/javadoc-stylesheet.css
deleted file mode 100644
index 593cd5612..000000000
--- a/etc/config/javadoc-stylesheet.css
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Page background color */
-body {
- background-color: #FFFFFF;
- margin:0 auto;
- font-family:'Lucida Grande', Geneva, Verdana, Arial, sans-serif;
- font-size:12px;
- padding:0em 2em;
- color:#333;
-
- }
-
-/* Common elements */
-
-font {
- font-family: inherit;
- font-size: inherit;
- color: inherit;
- font-weight: inherit; }
-
-hr {
- border: 0;
- color: #E6E7E8;
- background-color: #E6E7E8;
- height: 1px;
-}
-
-a { text-decoration: none; font-weight: bold }
-
-a:link { color:#333; }
-a:active { color:#222; }
-a:visited { color:#111; }
-a:hover { color:#000; }
-
-
-/* Headings */
-h1 {
- font-size: 145%;
- color:#182737;
- font-size:2em;
- padding:1.5em;
- margin-top: 0px;
- text-align:left;
-}
-
-
-/* Default Table elements and colors */
-
-th, table { border-collapse:collapse; border-color: #E6E7E8; }
-
-
-.TableHeadingColor {
- background:#CF2F19;
- color:#FFFFFF;
- font-size:12px;
- font-weight:bold;
- height:31px;
- text-align:left;
- padding:1.5em;
-}
-
-.TableHeadingColor th {
- padding-left: 10px;
-}
-
-
-.TableSubHeadingColor { background: #F5F5F5; border-color: #F1F1F1; }
-.TableRowColor { background: #FFFFFF; border-color: #E6E7E8;}
-.TableRowColor td { line-height: 175%; padding-left: 10px; border-color: #E6E7E8;}
-
-/* Font used in left-hand frame lists */
-.FrameTitleFont { font-size: 125%; font-family: Helvetica, Arial, sans-serif; font-weight: bold; margin-top: 1em; display: block; }
-.FrameHeadingFont { font-size: 125%; font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; font-weight: bold; margin-top: 1em; display: block; }
-.FrameItemFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif }
-
-/* Navigation bar fonts and colors */
-
-.NavBarCell1 {
- background-color: #F5F5F5;
- line-height:2em;
- padding-left:6px;
- padding-right:6px;
-}
-
-.NavBarFont1 {
- color: #444;
-}
-.NavBarCell1 a {
- color: #444;
-}
-
-.NavBarCell1Rev { background-color:#CF2F19; padding-left:6px; padding-right:6px; }
-.NavBarFont1 { color:#444;}
-.NavBarFont1Rev { color:#FFF;}
-
-.NavBarCell2 { background-color:#FFFFFF;}
-.NavBarCell3 { background-color:#FFFFFF;}
\ No newline at end of file
diff --git a/etc/deploy-snapshot.sh b/etc/deploy-snapshot.sh
deleted file mode 100755
index df64186ff..000000000
--- a/etc/deploy-snapshot.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-mvn -Dmaven.test.skip=true -DaltDeploymentRepository=snapshots::default::file:///Users/woorea/dev/maven/snapshots deploy
diff --git a/etc/deploy.sh b/etc/deploy.sh
deleted file mode 100755
index 5408baf4a..000000000
--- a/etc/deploy.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-mvn -Dmaven.test.skip=true -DaltDeploymentRepository=releases::default::file:///Users/woorea/dev/maven/releases deploy
diff --git a/etc/dockbkx.txt b/etc/dockbkx.txt
deleted file mode 100644
index 194573826..000000000
--- a/etc/dockbkx.txt
+++ /dev/null
@@ -1 +0,0 @@
-mvn docbkx:generate-html -P site
\ No newline at end of file
diff --git a/etc/eclipse/CodeFormat.xml b/etc/eclipse/CodeFormat.xml
deleted file mode 100644
index 313a7eadd..000000000
--- a/etc/eclipse/CodeFormat.xml
+++ /dev/null
@@ -1,291 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/etc/openstack.admin.properties b/etc/openstack.admin.properties
deleted file mode 100644
index 9127cc239..000000000
--- a/etc/openstack.admin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-verbose=true
-
-auth.credentials=passwordCredentials
-auth.username=admin
-auth.password=secret0
-#auth.tenant.id=123456789
-auth.tenantName=admin
-
-
-identity.endpoint.publicURL=http://192.168.1.43:5000/v2.0
-identity.endpoint.internalURL=http://192.168.1.43:5000/v2.0
-identity.endpoint.adminURL=http://192.168.1.43:35357/v2.0
-identity.admin.token=secret0
\ No newline at end of file
diff --git a/etc/openstack.public.properties b/etc/openstack.public.properties
deleted file mode 100644
index a059f2e15..000000000
--- a/etc/openstack.public.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-verbose=true
-
-auth.credentials=passwordCredentials
-auth.username=admin
-auth.password=secret0
-#auth.tenant.id=123456789
-auth.tenantName=admin
-
-
-identity.endpoint.publicURL=http://192.168.1.43:5000/v2.0
-identity.endpoint.internalURL=http://192.168.1.43:5000/v2.0
-identity.endpoint.adminURL=http://192.168.1.43:35357/v2.0
-identity.admin.token=secret0
-
-test.glance=true
-test.swift=true
\ No newline at end of file
diff --git a/glance-client/pom.xml b/glance-client/pom.xml
new file mode 100644
index 000000000..c0af557fa
--- /dev/null
+++ b/glance-client/pom.xml
@@ -0,0 +1,24 @@
+
+ 4.0.0
+
+ com.woorea
+ openstack-java-sdk
+ 3.2.10-SNAPSHOT
+
+ glance-client
+ OpenStack Glance Client
+ OpenStack Glance Client
+
+
+ com.woorea
+ openstack-client
+ 3.2.10-SNAPSHOT
+
+
+
+ com.woorea
+ glance-model
+ 3.2.10-SNAPSHOT
+
+
+
\ No newline at end of file
diff --git a/glance-client/src/main/java/com/woorea/openstack/glance/Glance.java b/glance-client/src/main/java/com/woorea/openstack/glance/Glance.java
new file mode 100644
index 000000000..67714e7f8
--- /dev/null
+++ b/glance-client/src/main/java/com/woorea/openstack/glance/Glance.java
@@ -0,0 +1,30 @@
+package com.woorea.openstack.glance;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackClientConnector;
+
+public class Glance extends OpenStackClient {
+
+ private final ImagesResource IMAGES;
+
+ private final SharedImagesResource SHARED_IMAGES;
+
+ public Glance(String endpoint, OpenStackClientConnector connector) {
+ super(endpoint, connector);
+ IMAGES = new ImagesResource(this);
+ SHARED_IMAGES = new SharedImagesResource(this);
+ }
+
+ public Glance(String endpoint) {
+ this(endpoint, null);
+ }
+
+ public final ImagesResource images() {
+ return IMAGES;
+ }
+
+ public final SharedImagesResource sharedImages() {
+ return SHARED_IMAGES;
+ }
+
+}
diff --git a/glance-client/src/main/java/com/woorea/openstack/glance/ImagesResource.java b/glance-client/src/main/java/com/woorea/openstack/glance/ImagesResource.java
new file mode 100644
index 000000000..aa56b7a0b
--- /dev/null
+++ b/glance-client/src/main/java/com/woorea/openstack/glance/ImagesResource.java
@@ -0,0 +1,280 @@
+package com.woorea.openstack.glance;
+
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+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.base.client.OpenStackResponse;
+import com.woorea.openstack.glance.model.Image;
+import com.woorea.openstack.glance.model.ImageDownload;
+import com.woorea.openstack.glance.model.ImageUpload;
+import com.woorea.openstack.glance.model.ImageMember;
+import com.woorea.openstack.glance.model.ImageMembers;
+import com.woorea.openstack.glance.model.Images;
+
+public class ImagesResource {
+
+ private final OpenStackClient CLIENT;
+
+ public ImagesResource(OpenStackClient client) {
+ CLIENT = client;
+ }
+
+ public List list(boolean detail) {
+ return new List(detail);
+ }
+
+ public Create create(Image image) {
+ return new Create(image);
+ }
+
+ public Show show(String id) {
+ return new Show(id);
+ }
+
+ public Update update(String id, Image image) {
+ return new Update(id, image);
+ }
+
+ public Delete delete(String id) {
+ return new Delete(id);
+ }
+
+ public Upload upload(ImageUpload image) {
+ return new Upload(image);
+ }
+
+ public Upload upload(String id, ImageUpload image) {
+ return new Upload(id, image);
+ }
+
+ public Download download(String id) {
+ return new Download(id);
+ }
+
+ public ListMembers listMembers(String id) {
+ return new ListMembers(id);
+ }
+
+ public ReplaceMembers replaceMembers(String id, Collection members) {
+ return new ReplaceMembers(id, members);
+ }
+
+ public AddMember addMember(String id, String tenantId) {
+ return new AddMember(id, tenantId);
+ }
+
+ public AddMember removeMember(String id, String tenantId) {
+ return new AddMember(id, tenantId);
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List(boolean detail) {
+ super(CLIENT, HttpMethod.GET, detail ? "/images/detail" : "images", null, Images.class);
+ }
+
+ }
+
+ public class Create extends OpenStackRequest {
+
+ public Create(Image image) {
+ super(CLIENT, HttpMethod.POST, "/images", null, Image.class);
+ for (Map.Entry entry : compose(image).entrySet()) {
+ header(entry.getKey(), entry.getValue());
+ }
+ }
+
+ }
+
+ public class Update extends OpenStackRequest {
+
+ public Update(String id, Image image) {
+ super(CLIENT, HttpMethod.PUT, new StringBuilder("/images/").append(id).toString(), Entity.json(image), Image.class);
+ }
+
+ }
+
+ public class Delete extends OpenStackRequest {
+
+ public Delete(String id) {
+ super(CLIENT, HttpMethod.DELETE, new StringBuilder("/images/").append(id).toString(), null, Void.class);
+ }
+
+ }
+
+ public class Show extends OpenStackRequest {
+
+ public Show(String id) {
+ super(CLIENT, HttpMethod.HEAD, new StringBuilder("/images/").append(id).toString(), null, Image.class);
+ }
+
+ @Override
+ public Image execute() {
+ // custom parsing here
+ return parse(CLIENT.request(this).headers());
+ }
+
+ }
+
+ public class Upload extends OpenStackRequest {
+
+ public Upload(String id, ImageUpload imageUpload) {
+ super(CLIENT, HttpMethod.PUT, new StringBuilder("/images/").append(id).toString(),
+ Entity.stream(imageUpload.getInputStream()), Image.class);
+ }
+
+ public Upload(ImageUpload imageUpload) {
+ super(CLIENT, HttpMethod.POST, "/images", Entity.stream(imageUpload.getInputStream()), Image.class);
+
+ for (Map.Entry entry : compose(imageUpload.getImage()).entrySet()) {
+ header(entry.getKey(), entry.getValue());
+ }
+
+ //file,s3,swift
+ header("x-image-meta-store", imageUpload.getStore());
+ }
+
+ }
+
+ public class Download extends OpenStackRequest {
+
+ public Download(String id) {
+ super(CLIENT, HttpMethod.GET, new StringBuilder("/images/").append(id).toString(), null, ImageDownload.class);
+ header("Accept", "application/octet-stream");
+ }
+
+ @Override
+ public ImageDownload execute() {
+ // custom parsing here
+ OpenStackResponse response = CLIENT.request(this);
+ ImageDownload imageDownload = new ImageDownload();
+ imageDownload.setImage(parse(response.headers()));
+ imageDownload.setInputStream(response.getInputStream());
+ return imageDownload;
+ }
+
+ }
+
+ public class ListMembers extends OpenStackRequest {
+
+ public ListMembers(String id) {
+ super(CLIENT, HttpMethod.GET, new StringBuilder("/images/").append(id).append("/members").toString(), null, ImageMembers.class);
+ }
+
+ }
+
+ public class ReplaceMembers extends OpenStackRequest {
+
+ public ReplaceMembers(String id, Collection members) {
+ super(CLIENT, HttpMethod.PUT, new StringBuilder("/images/").append(id).append("/members").toString(), Entity.json(new Memberships(members)), Void.class);
+ }
+
+ }
+
+ public class AddMember extends OpenStackRequest {
+
+ public AddMember(String id, String tenantId) {
+ super(CLIENT, HttpMethod.PUT, new StringBuilder("/images/").append(id).append("/members").append(tenantId).toString(), null, ImageMember.class);
+ }
+
+ }
+
+ public class RemoveMember extends OpenStackRequest {
+
+ public RemoveMember(String id, String tenantId) {
+ super(CLIENT, HttpMethod.DELETE, new StringBuilder("/images/").append(id).append("/members/").append(tenantId).toString(), null, Void.class);
+ }
+
+ }
+
+ public static Map compose(Image image) {
+ Map headers = new HashMap();
+
+ headers.put("X-Image-Meta-Name", image.getName());
+ headers.put("X-Image-Meta-Disk_format", image.getDiskFormat());
+ headers.put("X-Image-Meta-Container_format", image.getContainerFormat());
+ headers.put("X-Image-Meta-Id", image.getId());
+ headers.put("X-Image-Meta-Size", (image.getSize() != null) ? image.getSize().toString() : null);
+ headers.put("X-Image-Meta-Checksum", image.getChecksum());
+ headers.put("X-Image-Meta-Is_public", String.valueOf(image.isPublic()));
+ headers.put("X-Image-Meta-Owner", image.getOwner());
+
+ for(String key : image.getProperties().keySet()) {
+ image.getProperties().put("x-image-meta-property-" + key, image.getProperties().get(key));
+ }
+
+ return headers;
+ }
+
+ public static Image parse(Map headers) {
+ Image image = new Image();
+ image.setId(headers.get("X-Image-Meta-Id"));
+ image.setUri(headers.get("Location"));
+ image.setName(headers.get("X-Image-Meta-Name"));
+ image.setDiskFormat(headers.get("X-Image-Meta-Disk_format"));
+ image.setContainerFormat(headers.get("X-Image-Meta-Container_format"));
+ image.setSize(asLong(headers.get("X-Image-Meta-Size")));
+ image.setChecksum(headers.get("X-Image-Meta-Checksum"));
+ image.setCreatedAt(asCalendar(headers.get("X-Image-Meta-Created_at")));
+ image.setUpdatedAt(asCalendar(headers.get("X-Image-Meta-Updated_at")));
+ image.setDeletedAt(asCalendar(headers.get("X-Image-Meta-Deleted_at")));
+ image.setDeleted(asBoolean(headers.get("X-Image-Meta-Deleted")));
+ image.setStatus(headers.get("X-Image-Meta-Status"));
+ image.setProtected(asBoolean(headers.get("X-Image-Meta-Protected")));
+ image.setPublic(asBoolean(headers.get("X-Image-Meta-Is_public")));
+ image.setMinRam(asInteger(headers.get("X-Image-Meta-Min_ram")));
+ image.setMinDisk(asInteger(headers.get("X-Image-Meta-Min_disk")));
+ image.setOwner(headers.get("X-Image-Meta-Owner"));
+ for(String key : headers.keySet()) {
+ if(key.startsWith("x-image-meta-property-")) {
+ image.getProperties().put(key.substring(22), headers.get(key));
+ }
+ }
+ return image;
+ }
+
+ private static Calendar asCalendar(String calendarString) {
+ return Calendar.getInstance();
+ }
+
+ private static Integer asInteger(String integerString) {
+ if(integerString != null) {
+ return Integer.parseInt(integerString);
+ }
+ return 0;
+ }
+
+ private static Boolean asBoolean(String booleanString) {
+ if(booleanString != null) {
+ return Boolean.parseBoolean(booleanString);
+ }
+ return Boolean.FALSE;
+ }
+
+ private static Long asLong(String longString) {
+ if(longString != null) {
+ return Long.parseLong(longString);
+ }
+ return 0L;
+ }
+
+ public static class Memberships {
+
+ @JsonProperty("memberships")
+ private Collection memberships;
+
+ public Memberships(Collection memberships) {
+ this.memberships = memberships;
+ }
+
+ }
+
+}
diff --git a/glance-client/src/main/java/com/woorea/openstack/glance/SharedImagesResource.java b/glance-client/src/main/java/com/woorea/openstack/glance/SharedImagesResource.java
new file mode 100644
index 000000000..a46155463
--- /dev/null
+++ b/glance-client/src/main/java/com/woorea/openstack/glance/SharedImagesResource.java
@@ -0,0 +1,30 @@
+package com.woorea.openstack.glance;
+
+
+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.glance.model.Images;
+import com.woorea.openstack.glance.model.SharedImages;
+
+public class SharedImagesResource {
+
+ private final OpenStackClient CLIENT;
+
+ public SharedImagesResource(OpenStackClient client) {
+ CLIENT = client;
+ }
+
+ public List list(String tenantId, boolean detail) {
+ return new List(tenantId, detail);
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List(String tenantId, boolean detail) {
+ super(CLIENT, HttpMethod.GET, new StringBuffer(detail ? "/shared-images/detail" : "/shared-images/").append(tenantId).toString(), null, SharedImages.class);
+ }
+
+ }
+
+}
diff --git a/glance-client/src/main/java/com/woorea/openstack/glance/v2/Glance.java b/glance-client/src/main/java/com/woorea/openstack/glance/v2/Glance.java
new file mode 100644
index 000000000..ecfc4fc83
--- /dev/null
+++ b/glance-client/src/main/java/com/woorea/openstack/glance/v2/Glance.java
@@ -0,0 +1,22 @@
+package com.woorea.openstack.glance.v2;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackClientConnector;
+
+public class Glance extends OpenStackClient {
+
+ private final ImagesResource IMAGES;
+
+ public Glance(String endpoint, OpenStackClientConnector connector) {
+ super(endpoint, connector);
+ IMAGES = new ImagesResource(this);
+ }
+
+ public Glance(String endpoint) {
+ this(endpoint, null);
+ }
+
+ public final ImagesResource images() {
+ return IMAGES;
+ }
+}
diff --git a/glance-client/src/main/java/com/woorea/openstack/glance/v2/ImagesResource.java b/glance-client/src/main/java/com/woorea/openstack/glance/v2/ImagesResource.java
new file mode 100644
index 000000000..3b850689b
--- /dev/null
+++ b/glance-client/src/main/java/com/woorea/openstack/glance/v2/ImagesResource.java
@@ -0,0 +1,90 @@
+package com.woorea.openstack.glance.v2;
+
+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.base.client.OpenStackResponse;
+import com.woorea.openstack.glance.model.v2.Image;
+import com.woorea.openstack.glance.model.v2.ImageDownload;
+import com.woorea.openstack.glance.model.v2.Images;
+
+public class ImagesResource {
+
+ private final OpenStackClient CLIENT;
+
+ public ImagesResource(OpenStackClient client) {
+ CLIENT = client;
+ }
+
+ public List list(boolean detail) {
+ return new List(detail);
+ }
+
+ public Create create(Image image) {
+ return new Create(image);
+ }
+
+ public Show show(String id) {
+ return new Show(id);
+ }
+
+ public Delete delete(String id) {
+ return new Delete(id);
+ }
+
+ public Download download(String id) {
+ return new Download(id);
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List(boolean detail) {
+ super(CLIENT, HttpMethod.GET, "/images", null, Images.class);
+ }
+
+ }
+
+ public class Create extends OpenStackRequest {
+
+ public Create(Image image) {
+ super(CLIENT, HttpMethod.POST, "/images", Entity.json(image), Image.class);
+ }
+
+ }
+
+ public class Delete extends OpenStackRequest {
+
+ public Delete(String id) {
+ super(CLIENT, HttpMethod.DELETE, new StringBuilder("/images/").append(id).toString(), null, Void.class);
+ }
+
+ }
+
+ public class Show extends OpenStackRequest {
+
+ public Show(String id) {
+ super(CLIENT, HttpMethod.GET, new StringBuilder("/images/").append(id).toString(), null, Image.class);
+ }
+
+ }
+
+ public class Download extends OpenStackRequest {
+
+ public Download(String id) {
+ super(CLIENT, HttpMethod.GET, new StringBuilder("/images/").append(id).append("/file").toString(),
+ null, ImageDownload.class);
+ header("Accept", "application/octet-stream");
+ }
+
+ @Override
+ public ImageDownload execute() {
+ // custom parsing here
+ OpenStackResponse response = CLIENT.request(this);
+ ImageDownload imageDownload = new ImageDownload();
+ imageDownload.setInputStream(response.getInputStream());
+ return imageDownload;
+ }
+
+ }
+}
diff --git a/glance-model/pom.xml b/glance-model/pom.xml
new file mode 100644
index 000000000..1d0431c4c
--- /dev/null
+++ b/glance-model/pom.xml
@@ -0,0 +1,11 @@
+
+ 4.0.0
+
+ com.woorea
+ openstack-java-sdk
+ 3.2.10-SNAPSHOT
+
+ glance-model
+ OpenStack Glance Model
+ OpenStack Glance Model
+
\ No newline at end of file
diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/Image.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/Image.java
new file mode 100644
index 000000000..3ad874629
--- /dev/null
+++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/Image.java
@@ -0,0 +1,343 @@
+package com.woorea.openstack.glance.model;
+
+import java.io.Serializable;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("image")
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Image implements Serializable {
+
+ private String id;
+
+ private String uri;
+
+ private String name;
+
+ @JsonProperty("disk_format")
+ private String diskFormat;
+
+ @JsonProperty("container_format")
+ private String containerFormat;
+
+ private Long size;
+
+ @JsonProperty("virtual_size")
+ private Long virtualSize;
+
+ private String checksum;
+
+ @JsonProperty("created_at")
+ private Calendar createdAt;
+
+ @JsonProperty("updated_at")
+ private Calendar updatedAt;
+
+ @JsonProperty("deleted_at")
+ private Calendar deletedAt;
+
+ private String status;
+
+ @JsonProperty("is_public")
+ private boolean isPublic;
+
+ @JsonProperty("min_ram")
+ private Integer minRam;
+
+ @JsonProperty("min_disk")
+ private Integer minDisk;
+
+ private String owner;
+
+ @JsonProperty("deleted")
+ private boolean isDeleted;
+
+ @JsonProperty("protected")
+ private boolean isProtected;
+
+ private Map properties;
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the uri
+ */
+ public String getUri() {
+ return uri;
+ }
+
+ /**
+ * @param uri the uri to set
+ */
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the diskFormat
+ */
+ public String getDiskFormat() {
+ return diskFormat;
+ }
+
+ /**
+ * @param diskFormat the diskFormat to set
+ */
+ public void setDiskFormat(String diskFormat) {
+ this.diskFormat = diskFormat;
+ }
+
+ /**
+ * @return the containerFormat
+ */
+ public String getContainerFormat() {
+ return containerFormat;
+ }
+
+ /**
+ * @param containerFormat the containerFormat to set
+ */
+ public void setContainerFormat(String containerFormat) {
+ this.containerFormat = containerFormat;
+ }
+
+ /**
+ * @return the size
+ */
+ public Long getSize() {
+ return size;
+ }
+
+ /**
+ * @param size the size to set
+ */
+ public void setSize(Long size) {
+ this.size = size;
+ }
+
+ /**
+ * @return the virtual size
+ */
+ public Long getVirtualSize() {
+ return virtualSize;
+ }
+
+ /**
+ * @param virtualSize the virtual size to set
+ */
+ public void setVirtualSize(Long virtualSize) {
+ this.virtualSize = virtualSize;
+ }
+
+ /**
+ * @return the checksum
+ */
+ public String getChecksum() {
+ return checksum;
+ }
+
+ /**
+ * @param checksum the checksum to set
+ */
+ public void setChecksum(String checksum) {
+ this.checksum = checksum;
+ }
+
+ /**
+ * @return the createdAt
+ */
+ public Calendar getCreatedAt() {
+ return createdAt;
+ }
+
+ /**
+ * @param createdAt the createdAt to set
+ */
+ public void setCreatedAt(Calendar createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ /**
+ * @return the updatedAt
+ */
+ public Calendar getUpdatedAt() {
+ return updatedAt;
+ }
+
+ /**
+ * @param updatedAt the updatedAt to set
+ */
+ public void setUpdatedAt(Calendar updatedAt) {
+ this.updatedAt = updatedAt;
+ }
+
+ /**
+ * @return the deletedAt
+ */
+ public Calendar getDeletedAt() {
+ return deletedAt;
+ }
+
+ /**
+ * @param deletedAt the deletedAt to set
+ */
+ public void setDeletedAt(Calendar deletedAt) {
+ this.deletedAt = deletedAt;
+ }
+
+ /**
+ * @return the status
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * @param status the status to set
+ */
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ /**
+ * @return the isPublic
+ */
+ public boolean isPublic() {
+ return isPublic;
+ }
+
+ /**
+ * @param isPublic the isPublic to set
+ */
+ public void setPublic(boolean isPublic) {
+ this.isPublic = isPublic;
+ }
+
+ /**
+ * @return the minRam
+ */
+ public Integer getMinRam() {
+ return minRam;
+ }
+
+ /**
+ * @param minRam the minRam to set
+ */
+ public void setMinRam(Integer minRam) {
+ this.minRam = minRam;
+ }
+
+ /**
+ * @return the minDisk
+ */
+ public Integer getMinDisk() {
+ return minDisk;
+ }
+
+ /**
+ * @param minDisk the minDisk to set
+ */
+ public void setMinDisk(Integer minDisk) {
+ this.minDisk = minDisk;
+ }
+
+ /**
+ * @return the owner
+ */
+ public String getOwner() {
+ return owner;
+ }
+
+ /**
+ * @param owner the owner to set
+ */
+ public void setOwner(String owner) {
+ this.owner = owner;
+ }
+
+ /**
+ * @return the isDeleted
+ */
+ public boolean isDeleted() {
+ return isDeleted;
+ }
+
+ /**
+ * @param isDeleted the isDeleted to set
+ */
+ public void setDeleted(boolean isDeleted) {
+ this.isDeleted = isDeleted;
+ }
+
+ /**
+ * @return the isProtected
+ */
+ public boolean isProtected() {
+ return isProtected;
+ }
+
+ /**
+ * @param isProtected the isProtected to set
+ */
+ public void setProtected(boolean isProtected) {
+ this.isProtected = isProtected;
+ }
+
+ /**
+ * @return the properties
+ */
+ public Map getProperties() {
+ if(properties == null) {
+ properties = new HashMap();
+ }
+ return properties;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Image [id=" + id + ", uri=" + uri + ", name=" + name
+ + ", diskFormat=" + diskFormat + ", containerFormat="
+ + containerFormat + ", size=" + size + ", checksum=" + checksum
+ + ", createdAt=" + createdAt + ", updatedAt=" + updatedAt
+ + ", deletedAt=" + deletedAt + ", status=" + status
+ + ", isPublic=" + isPublic + ", minRam=" + minRam
+ + ", minDisk=" + minDisk + ", owner=" + owner + ", isDeleted="
+ + isDeleted + ", isProtected=" + isProtected + ", properties="
+ + properties + "]";
+ }
+
+}
diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageDownload.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageDownload.java
new file mode 100644
index 000000000..d7c575cf2
--- /dev/null
+++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageDownload.java
@@ -0,0 +1,39 @@
+package com.woorea.openstack.glance.model;
+
+import java.io.InputStream;
+
+public class ImageDownload {
+
+ private Image image;
+
+ private InputStream inputStream;
+
+ /**
+ * @return the image
+ */
+ public Image getImage() {
+ return image;
+ }
+
+ /**
+ * @param image the image to set
+ */
+ public void setImage(Image image) {
+ this.image = image;
+ }
+
+ /**
+ * @return the inputStream
+ */
+ public InputStream getInputStream() {
+ return inputStream;
+ }
+
+ /**
+ * @param inputStream the inputStream to set
+ */
+ public void setInputStream(InputStream inputStream) {
+ this.inputStream = inputStream;
+ }
+
+}
diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageMember.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageMember.java
new file mode 100644
index 000000000..0977fa34e
--- /dev/null
+++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageMember.java
@@ -0,0 +1,52 @@
+package com.woorea.openstack.glance.model;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ImageMember implements Serializable {
+
+ @JsonProperty("can_share")
+ private boolean canShare;
+
+ @JsonProperty("member_id")
+ private String memberId;
+
+ public ImageMember() {
+
+ }
+
+ public ImageMember(boolean canShare, String memberId) {
+ this.canShare = canShare;
+ this.memberId = memberId;
+ }
+
+ /**
+ * @return the canShare
+ */
+ public boolean isCanShare() {
+ return canShare;
+ }
+
+ /**
+ * @param canShare the canShare to set
+ */
+ public void setCanShare(boolean canShare) {
+ this.canShare = canShare;
+ }
+
+ /**
+ * @return the memberId
+ */
+ public String getMemberId() {
+ return memberId;
+ }
+
+ /**
+ * @param memberId the memberId to set
+ */
+ public void setMemberId(String memberId) {
+ this.memberId = memberId;
+ }
+
+}
diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageMembers.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageMembers.java
new file mode 100644
index 000000000..fc5193253
--- /dev/null
+++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageMembers.java
@@ -0,0 +1,26 @@
+package com.woorea.openstack.glance.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ImageMembers implements Iterable, Serializable {
+
+ @JsonProperty("members")
+ private List list;
+
+ /**
+ * @return the list
+ */
+ public List getList() {
+ return list;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return list.iterator();
+ }
+
+}
\ No newline at end of file
diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageUpload.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageUpload.java
new file mode 100644
index 000000000..326f5e006
--- /dev/null
+++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageUpload.java
@@ -0,0 +1,67 @@
+package com.woorea.openstack.glance.model;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ImageUpload {
+
+ private Image image;
+
+ private String store;
+
+ private Map properties;
+
+ private InputStream inputStream;
+
+ public ImageUpload(Image image) {
+ setImage(image);
+ }
+
+ public Image getImage() {
+ return image;
+ }
+
+ public void setImage(Image image) {
+ this.image = image;
+ }
+
+ /**
+ * @return the store
+ */
+ public String getStore() {
+ return store;
+ }
+
+ /**
+ * @param store the store to set
+ */
+ public void setStore(String store) {
+ this.store = store;
+ }
+
+ /**
+ * @return the properties
+ */
+ public Map getProperties() {
+ if(properties == null) {
+ properties = new HashMap();
+ }
+ return properties;
+ }
+
+ /**
+ * @return the inputStream
+ */
+ public InputStream getInputStream() {
+ return inputStream;
+ }
+
+ /**
+ * @param inputStream the inputStream to set
+ */
+ public void setInputStream(InputStream inputStream) {
+ this.inputStream = inputStream;
+ }
+
+}
diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/Images.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/Images.java
new file mode 100644
index 000000000..348ac29c1
--- /dev/null
+++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/Images.java
@@ -0,0 +1,26 @@
+package com.woorea.openstack.glance.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Images implements Iterable, Serializable {
+
+ @JsonProperty("images")
+ private List list;
+
+ /**
+ * @return the list
+ */
+ public List getList() {
+ return list;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return list.iterator();
+ }
+
+}
diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/SharedImage.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/SharedImage.java
new file mode 100644
index 000000000..ae23a6688
--- /dev/null
+++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/SharedImage.java
@@ -0,0 +1,5 @@
+package com.woorea.openstack.glance.model;
+
+public class SharedImage {
+
+}
\ No newline at end of file
diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/SharedImages.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/SharedImages.java
new file mode 100644
index 000000000..78ca09764
--- /dev/null
+++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/SharedImages.java
@@ -0,0 +1,26 @@
+package com.woorea.openstack.glance.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class SharedImages implements Iterable, Serializable {
+
+ @JsonProperty("shared_images")
+ private List list;
+
+ /**
+ * @return the list
+ */
+ public List getList() {
+ return list;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return list.iterator();
+ }
+
+}
\ No newline at end of file
diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/v2/Image.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/v2/Image.java
new file mode 100644
index 000000000..fe0531b65
--- /dev/null
+++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/v2/Image.java
@@ -0,0 +1,212 @@
+package com.woorea.openstack.glance.model.v2;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.io.Serializable;
+import java.util.Calendar;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Image implements Serializable {
+
+ private String id;
+
+ private String self;
+
+ private String name;
+
+ private String file;
+
+ @JsonProperty("disk_format")
+ private String diskFormat;
+
+ @JsonProperty("container_format")
+ private String containerFormat;
+
+ private Long size;
+
+ @JsonProperty("virtual_size")
+ private Long virtualSize;
+
+ private String checksum;
+
+ @JsonProperty("created_at")
+ private Calendar createdAt;
+
+ @JsonProperty("updated_at")
+ private Calendar updatedAt;
+
+ private String status;
+
+ private String visibility;
+
+ @JsonProperty("min_ram")
+ private Integer minRam;
+
+ @JsonProperty("min_disk")
+ private Integer minDisk;
+
+ private String owner;
+
+ @JsonProperty("protected")
+ private boolean isProtected;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getSelf() {
+ return self;
+ }
+
+ public void setSelf(String self) {
+ this.self = self;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDiskFormat() {
+ return diskFormat;
+ }
+
+ public void setDiskFormat(String diskFormat) {
+ this.diskFormat = diskFormat;
+ }
+
+ public String getContainerFormat() {
+ return containerFormat;
+ }
+
+ public void setContainerFormat(String containerFormat) {
+ this.containerFormat = containerFormat;
+ }
+
+ public Long getSize() {
+ return size;
+ }
+
+ public void setSize(Long size) {
+ this.size = size;
+ }
+
+ public Long getVirtualSize() {
+ return virtualSize;
+ }
+
+ public void setVirtualSize(Long virtualSize) {
+ this.virtualSize = virtualSize;
+ }
+
+ public String getChecksum() {
+ return checksum;
+ }
+
+ public void setChecksum(String checksum) {
+ this.checksum = checksum;
+ }
+
+ public Calendar getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(Calendar createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ public Calendar getUpdatedAt() {
+ return updatedAt;
+ }
+
+ public void setUpdatedAt(Calendar updatedAt) {
+ this.updatedAt = updatedAt;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public Integer getMinRam() {
+ return minRam;
+ }
+
+ public void setMinRam(Integer minRam) {
+ this.minRam = minRam;
+ }
+
+ public Integer getMinDisk() {
+ return minDisk;
+ }
+
+ public void setMinDisk(Integer minDisk) {
+ this.minDisk = minDisk;
+ }
+
+ public String getOwner() {
+ return owner;
+ }
+
+ public void setOwner(String owner) {
+ this.owner = owner;
+ }
+
+ public boolean isProtected() {
+ return isProtected;
+ }
+
+ public void setProtected(boolean aProtected) {
+ isProtected = aProtected;
+ }
+
+ public String getFile() {
+ return file;
+ }
+
+ public void setFile(String file) {
+ this.file = file;
+ }
+
+ public String getVisibility() {
+ return visibility;
+ }
+
+ public void setVisibility(String visibility) {
+ this.visibility = visibility;
+ }
+
+ @Override
+ public String toString() {
+ return "Image{" +
+ "id='" + id + '\'' +
+ ", self='" + self + '\'' +
+ ", name='" + name + '\'' +
+ ", file='" + file + '\'' +
+ ", diskFormat='" + diskFormat + '\'' +
+ ", containerFormat='" + containerFormat + '\'' +
+ ", size=" + size +
+ ", virtualSize=" + virtualSize +
+ ", checksum='" + checksum + '\'' +
+ ", createdAt=" + createdAt +
+ ", updatedAt=" + updatedAt +
+ ", status='" + status + '\'' +
+ ", visibility='" + visibility + '\'' +
+ ", minRam=" + minRam +
+ ", minDisk=" + minDisk +
+ ", owner='" + owner + '\'' +
+ ", isProtected=" + isProtected +
+ '}';
+ }
+}
diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/v2/ImageDownload.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/v2/ImageDownload.java
new file mode 100644
index 000000000..56f2cdce4
--- /dev/null
+++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/v2/ImageDownload.java
@@ -0,0 +1,23 @@
+package com.woorea.openstack.glance.model.v2;
+
+import java.io.InputStream;
+
+public class ImageDownload {
+
+ private InputStream inputStream;
+
+ /**
+ * @return the inputStream
+ */
+ public InputStream getInputStream() {
+ return inputStream;
+ }
+
+ /**
+ * @param inputStream the inputStream to set
+ */
+ public void setInputStream(InputStream inputStream) {
+ this.inputStream = inputStream;
+ }
+
+}
diff --git a/glance-model/src/main/java/com/woorea/openstack/glance/model/v2/Images.java b/glance-model/src/main/java/com/woorea/openstack/glance/model/v2/Images.java
new file mode 100644
index 000000000..0fed85be2
--- /dev/null
+++ b/glance-model/src/main/java/com/woorea/openstack/glance/model/v2/Images.java
@@ -0,0 +1,26 @@
+package com.woorea.openstack.glance.model.v2;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+public class Images implements Iterable, Serializable {
+
+ @JsonProperty("images")
+ private List list;
+
+ /**
+ * @return the list
+ */
+ public List getList() {
+ return list;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return list.iterator();
+ }
+
+}
diff --git a/heat-client/pom.xml b/heat-client/pom.xml
new file mode 100644
index 000000000..b3ad84354
--- /dev/null
+++ b/heat-client/pom.xml
@@ -0,0 +1,24 @@
+
+ 4.0.0
+
+ com.woorea
+ openstack-java-sdk
+ 3.2.10-SNAPSHOT
+
+ heat-client
+ OpenStack Heat Client
+ OpenStack Heat Client
+
+
+ com.woorea
+ openstack-client
+ 3.2.10-SNAPSHOT
+
+
+
+ com.woorea
+ heat-model
+ 3.2.10-SNAPSHOT
+
+
+
\ No newline at end of file
diff --git a/heat-client/src/main/java/com/woorea/openstack/heat/Heat.java b/heat-client/src/main/java/com/woorea/openstack/heat/Heat.java
new file mode 100644
index 000000000..96e9cd78b
--- /dev/null
+++ b/heat-client/src/main/java/com/woorea/openstack/heat/Heat.java
@@ -0,0 +1,31 @@
+package com.woorea.openstack.heat;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackClientConnector;
+
+/**
+ * Reference: http://api.openstack.org/api-ref-orchestration.html
+ */
+public class Heat extends OpenStackClient {
+
+ private final StackResource stacks;
+ private final ResourcesResource resources;
+
+ public Heat(String endpoint, OpenStackClientConnector connector) {
+ super(endpoint, connector);
+ stacks = new StackResource(this);
+ resources = new ResourcesResource(this);
+ }
+
+ public Heat(String endpoint) {
+ this(endpoint, null);
+ }
+
+ public StackResource getStacks() {
+ return stacks;
+ }
+
+ public ResourcesResource getResources() {
+ return resources;
+ }
+}
diff --git a/heat-client/src/main/java/com/woorea/openstack/heat/ResourcesResource.java b/heat-client/src/main/java/com/woorea/openstack/heat/ResourcesResource.java
new file mode 100644
index 000000000..c3635bcbe
--- /dev/null
+++ b/heat-client/src/main/java/com/woorea/openstack/heat/ResourcesResource.java
@@ -0,0 +1,31 @@
+package com.woorea.openstack.heat;
+
+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.heat.model.Resources;
+
+
+/**
+ * v1/{tenant_id}/stacks/{stack_name}/resources
+ */
+public class ResourcesResource {
+ private final OpenStackClient client;
+
+ public ResourcesResource(OpenStackClient client) {
+ this.client = client;
+ }
+
+ public ListResources listResources(String name) {
+ return new ListResources(name);
+ }
+
+ /**
+ * v1/{tenant_id}/stacks/{stack_name}/resources
+ */
+ public class ListResources extends OpenStackRequest {
+ public ListResources(String name) {
+ super(client, HttpMethod.GET, "/stacks/" + name + "/resources", null, Resources.class);
+ }
+ }
+}
diff --git a/heat-client/src/main/java/com/woorea/openstack/heat/StackResource.java b/heat-client/src/main/java/com/woorea/openstack/heat/StackResource.java
new file mode 100644
index 000000000..de4577d3c
--- /dev/null
+++ b/heat-client/src/main/java/com/woorea/openstack/heat/StackResource.java
@@ -0,0 +1,61 @@
+package com.woorea.openstack.heat;
+
+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.heat.model.CreateStackParam;
+import com.woorea.openstack.heat.model.Stack;
+import com.woorea.openstack.heat.model.Stacks;
+
+public class StackResource {
+
+ private final OpenStackClient client;
+
+ public StackResource(OpenStackClient client) {
+ this.client = client;
+ }
+
+ public CreateStack create(CreateStackParam param) {
+ return new CreateStack(param);
+ }
+
+ public List list() {
+ return new List();
+ }
+
+ public GetStack byName(String name) {
+ return new GetStack(name);
+ }
+
+ public DeleteStack deleteByName(String name) {
+ return new DeleteStack(name);
+ }
+
+ public class CreateStack extends OpenStackRequest {
+ public CreateStack(CreateStackParam params) {
+ super(client, HttpMethod.POST, "/stacks", Entity.json(params), Stack.class);
+ }
+ }
+
+ public class DeleteStack extends OpenStackRequest {
+ public DeleteStack(String name) {
+ super(client, HttpMethod.DELETE, "/stacks/" + name, null, Void.class);
+ }
+ }
+
+
+ public class GetStack extends OpenStackRequest {
+ public GetStack(String name) {
+ super(client, HttpMethod.GET, "/stacks/" + name, null, Stack.class);
+ }
+ }
+
+ public class List extends OpenStackRequest {
+ public List() {
+ super(client, HttpMethod.GET, "/stacks", null, Stacks.class);
+ }
+ }
+
+
+}
diff --git a/heat-model/pom.xml b/heat-model/pom.xml
new file mode 100644
index 000000000..6b93b0149
--- /dev/null
+++ b/heat-model/pom.xml
@@ -0,0 +1,11 @@
+
+ 4.0.0
+
+ com.woorea
+ openstack-java-sdk
+ 3.2.10-SNAPSHOT
+
+ heat-model
+ OpenStack Heat Model
+ OpenStack Heat Model
+
\ No newline at end of file
diff --git a/heat-model/src/main/java/com/woorea/openstack/heat/model/CreateStackParam.java b/heat-model/src/main/java/com/woorea/openstack/heat/model/CreateStackParam.java
new file mode 100644
index 000000000..f602719d6
--- /dev/null
+++ b/heat-model/src/main/java/com/woorea/openstack/heat/model/CreateStackParam.java
@@ -0,0 +1,100 @@
+package com.woorea.openstack.heat.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Map;
+
+public class CreateStackParam {
+ @JsonProperty("stack_name")
+ private String stackName;
+
+ @JsonProperty("template_url")
+ private String templateUrl;
+
+ @JsonProperty
+ private String template;
+
+ @JsonProperty("parameters")
+ private Map parameters;
+
+ @JsonProperty("timeout_mins")
+ private int timeoutMinutes;
+
+ @JsonProperty("environment")
+ private String environment;
+
+ public String getStackName() {
+ return stackName;
+ }
+
+ public void setStackName(String stackName) {
+ this.stackName = stackName;
+ }
+
+ public String getTemplateUrl() {
+ return templateUrl;
+ }
+
+ /**
+ * The URL of the template to instantiate. This value is ignored if the template is supplied inline.
+ *
+ * @param templateUrl a template url.
+ */
+ public void setTemplateUrl(String templateUrl) {
+ this.templateUrl = templateUrl;
+ }
+
+ public Map getParameters() {
+ return parameters;
+ }
+
+ public String getTemplate() {
+ return template;
+ }
+
+ /**
+ * A JSON template to instantiate. This value takes precedence over the template URL if both are supplied.
+ *
+ * @param template a template json.
+ */
+ public void setTemplate(String template) {
+ this.template = template;
+ }
+
+ public void setParameters(Map parameters) {
+ this.parameters = parameters;
+ }
+
+ public int getTimeoutMinutes() {
+ return timeoutMinutes;
+ }
+
+ public void setTimeoutMinutes(int timeoutMinutes) {
+ this.timeoutMinutes = timeoutMinutes;
+ }
+
+ public String getEnvironment() {
+ return environment;
+ }
+
+ /**
+ * A JSON environment for the stack.
+ *
+ * @param environment a environment.
+ */
+ public void setEnvironment(String environment) {
+ this.environment = environment;
+ }
+
+ @Override
+ public String toString() {
+ return "CreateStackParam{" +
+ "stackName='" + stackName + '\'' +
+ ", templateUrl='" + templateUrl + '\'' +
+ ", template='" + template + '\'' +
+ ", parameters=" + parameters +
+ ", timeoutMinutes=" + timeoutMinutes +
+ ", environment='" + environment + '\'' +
+ '}';
+ }
+}
diff --git a/heat-model/src/main/java/com/woorea/openstack/heat/model/Explanation.java b/heat-model/src/main/java/com/woorea/openstack/heat/model/Explanation.java
new file mode 100644
index 000000000..b14577418
--- /dev/null
+++ b/heat-model/src/main/java/com/woorea/openstack/heat/model/Explanation.java
@@ -0,0 +1,28 @@
+package com.woorea.openstack.heat.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("error")
+public class Explanation {
+ @JsonProperty("explanation")
+ private String explanation;
+
+ @JsonProperty("code")
+ private int code;
+
+ @JsonRootName("error")
+ public static class Error {
+ @JsonProperty("message")
+ private String message;
+
+ @JsonProperty("traceback")
+ private String traceback;
+
+ @JsonProperty("type")
+ private String type;
+
+ @JsonProperty("title")
+ private String title;
+ }
+}
diff --git a/heat-model/src/main/java/com/woorea/openstack/heat/model/Link.java b/heat-model/src/main/java/com/woorea/openstack/heat/model/Link.java
new file mode 100644
index 000000000..1f9d5826e
--- /dev/null
+++ b/heat-model/src/main/java/com/woorea/openstack/heat/model/Link.java
@@ -0,0 +1,35 @@
+package com.woorea.openstack.heat.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Link {
+ @JsonProperty("href")
+ private String href;
+
+ @JsonProperty("rel")
+ private String rel;
+
+ public String getHref() {
+ return href;
+ }
+
+ public void setHref(String href) {
+ this.href = href;
+ }
+
+ public String getRel() {
+ return rel;
+ }
+
+ public void setRel(String rel) {
+ this.rel = rel;
+ }
+
+ @Override
+ public String toString() {
+ return "Link{" +
+ "href='" + href + '\'' +
+ ", rel='" + rel + '\'' +
+ '}';
+ }
+}
diff --git a/heat-model/src/main/java/com/woorea/openstack/heat/model/Resource.java b/heat-model/src/main/java/com/woorea/openstack/heat/model/Resource.java
new file mode 100644
index 000000000..58c1a1ae4
--- /dev/null
+++ b/heat-model/src/main/java/com/woorea/openstack/heat/model/Resource.java
@@ -0,0 +1,122 @@
+package com.woorea.openstack.heat.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Date;
+import java.util.List;
+
+public class Resource {
+ @JsonProperty("resource_name")
+ private String name;
+
+ @JsonProperty("links")
+ private List links;
+
+ @JsonProperty("resource_status")
+ private String status;
+
+ @JsonProperty("physical_resource_id")
+ private String physicalResourceId;
+
+ @JsonProperty("logical_resource_id")
+ private String logicalResourceId;
+
+ @JsonProperty("required_by")
+ private List requiredBy;
+
+ @JsonProperty("updated_time")
+ private Date updatedTime;
+
+ @JsonProperty("resource_type")
+ private String type;
+
+ @JsonProperty("resource_status_reason")
+ private String statusReason;
+
+ public String getStatusReason() {
+ return statusReason;
+ }
+
+ public void setStatusReason(String statusReason) {
+ this.statusReason = statusReason;
+ }
+
+ public String getLogicalResourceId() {
+ return logicalResourceId;
+ }
+
+ public void setLogicalResourceId(String logicalResourceId) {
+ this.logicalResourceId = logicalResourceId;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getPhysicalResourceId() {
+ return physicalResourceId;
+ }
+
+ public void setPhysicalResourceId(String physicalResourceId) {
+ this.physicalResourceId = physicalResourceId;
+ }
+
+ public List getRequiredBy() {
+ return requiredBy;
+ }
+
+ public void setRequiredBy(List requiredBy) {
+ this.requiredBy = requiredBy;
+ }
+
+ public Date getUpdatedTime() {
+ return updatedTime;
+ }
+
+ public void setUpdatedTime(Date updatedTime) {
+ this.updatedTime = updatedTime;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List getLinks() {
+ return links;
+ }
+
+ public void setLinks(List links) {
+ this.links = links;
+ }
+
+ @Override
+ public String toString() {
+ return "Resource{" +
+ "name='" + name + '\'' +
+ ", links=" + links +
+ ", status='" + status + '\'' +
+ ", physicalResourceId='" + physicalResourceId + '\'' +
+ ", logicalResourceId='" + logicalResourceId + '\'' +
+ ", requiredBy=" + requiredBy +
+ ", updatedTime=" + updatedTime +
+ ", type='" + type + '\'' +
+ ", statusReason='" + statusReason + '\'' +
+ '}';
+ }
+}
diff --git a/heat-model/src/main/java/com/woorea/openstack/heat/model/Resources.java b/heat-model/src/main/java/com/woorea/openstack/heat/model/Resources.java
new file mode 100644
index 000000000..a8d9023f8
--- /dev/null
+++ b/heat-model/src/main/java/com/woorea/openstack/heat/model/Resources.java
@@ -0,0 +1,28 @@
+package com.woorea.openstack.heat.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+public class Resources implements Iterable, Serializable {
+ @JsonProperty("resources")
+ private List list;
+
+ public List getList() {
+ return list;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return list.iterator();
+ }
+
+ @Override
+ public String toString() {
+ return "Resources{" +
+ "list=" + list +
+ '}';
+ }
+}
\ No newline at end of file
diff --git a/heat-model/src/main/java/com/woorea/openstack/heat/model/Stack.java b/heat-model/src/main/java/com/woorea/openstack/heat/model/Stack.java
new file mode 100644
index 000000000..b27bbc1ab
--- /dev/null
+++ b/heat-model/src/main/java/com/woorea/openstack/heat/model/Stack.java
@@ -0,0 +1,115 @@
+package com.woorea.openstack.heat.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+import java.util.Date;
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+@JsonRootName("stack")
+public class Stack {
+ @JsonProperty("description")
+ private String description;
+
+ @JsonProperty("links")
+ private List links;
+
+ @JsonProperty("stack_status_reason")
+ private String stackStatusReason;
+
+ @JsonProperty("stack_name")
+ private String stackName;
+
+ @JsonProperty("updated_time")
+ private Date updatedTime;
+
+ @JsonProperty("creation_time")
+ private Date creationTime;
+
+ @JsonProperty("stack_status")
+ private String stackStatus;
+
+ @JsonProperty("id")
+ private String id;
+
+ public Date getUpdatedTime() {
+ return updatedTime;
+ }
+
+ public void setUpdatedTime(Date updatedTime) {
+ this.updatedTime = updatedTime;
+ }
+
+ public String getStackStatus() {
+ return stackStatus;
+ }
+
+ public void setStackStatus(String stackStatus) {
+ this.stackStatus = stackStatus;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Date getCreationTime() {
+ return creationTime;
+ }
+
+ public void setCreationTime(Date creationTime) {
+ this.creationTime = creationTime;
+ }
+
+ public String getStackName() {
+ return stackName;
+ }
+
+ public void setStackName(String stackName) {
+ this.stackName = stackName;
+ }
+
+ public String getStackStatusReason() {
+ return stackStatusReason;
+ }
+
+ public void setStackStatusReason(String stackStatusReason) {
+ this.stackStatusReason = stackStatusReason;
+ }
+
+ public List getLinks() {
+ return links;
+ }
+
+ public void setLinks(List links) {
+ this.links = links;
+ }
+
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Override
+ public String toString() {
+ return "Stack{" +
+ "description='" + description + '\'' +
+ ", links=" + links +
+ ", stackStatusReason='" + stackStatusReason + '\'' +
+ ", stackName='" + stackName + '\'' +
+ ", updatedTime=" + updatedTime +
+ ", creationTime=" + creationTime +
+ ", stackStatus='" + stackStatus + '\'' +
+ ", id='" + id + '\'' +
+ '}';
+ }
+}
diff --git a/heat-model/src/main/java/com/woorea/openstack/heat/model/Stacks.java b/heat-model/src/main/java/com/woorea/openstack/heat/model/Stacks.java
new file mode 100644
index 000000000..5731f5b7a
--- /dev/null
+++ b/heat-model/src/main/java/com/woorea/openstack/heat/model/Stacks.java
@@ -0,0 +1,17 @@
+package com.woorea.openstack.heat.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+public class Stacks implements Iterable, Serializable {
+ @JsonProperty("stacks")
+ private List list;
+
+ @Override
+ public Iterator iterator() {
+ return list.iterator();
+ }
+}
diff --git a/keystone-client/pom.xml b/keystone-client/pom.xml
new file mode 100644
index 000000000..8c190e32b
--- /dev/null
+++ b/keystone-client/pom.xml
@@ -0,0 +1,23 @@
+
+ 4.0.0
+
+ com.woorea
+ openstack-java-sdk
+ 3.2.10-SNAPSHOT
+
+ keystone-client
+ OpenStack Keystone Client
+ OpenStack Keystone Client
+
+
+ com.woorea
+ openstack-client
+ 3.2.10-SNAPSHOT
+
+
+ com.woorea
+ keystone-model
+ 3.2.10-SNAPSHOT
+
+
+
\ No newline at end of file
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/Keystone.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/Keystone.java
new file mode 100644
index 000000000..38d42f001
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/Keystone.java
@@ -0,0 +1,65 @@
+package com.woorea.openstack.keystone;
+
+import com.woorea.openstack.keystone.api.EndpointsResource;
+import com.woorea.openstack.keystone.api.RolesResource;
+import com.woorea.openstack.keystone.api.ServicesResource;
+import com.woorea.openstack.keystone.api.TenantsResource;
+import com.woorea.openstack.keystone.api.TokensResource;
+import com.woorea.openstack.keystone.api.UsersResource;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackClientConnector;
+
+public class Keystone extends OpenStackClient {
+
+ private final TokensResource TOKENS;
+
+ private final TenantsResource TENANTS;
+
+ private final UsersResource USERS;
+
+ private final RolesResource ROLES;
+
+ private final ServicesResource SERVICES;
+
+ private final EndpointsResource ENDPOINTS;
+
+ public Keystone(String endpoint, OpenStackClientConnector connector) {
+ super(endpoint, connector);
+ TOKENS = new TokensResource(this);
+ TENANTS = new TenantsResource(this);
+ USERS = new UsersResource(this);
+ ROLES = new RolesResource(this);
+ SERVICES = new ServicesResource(this);
+ ENDPOINTS = new EndpointsResource(this);
+ }
+
+ public Keystone(String endpoint) {
+ this(endpoint, null);
+ }
+
+ public TokensResource tokens() {
+ return TOKENS;
+ }
+
+ public TenantsResource tenants() {
+ return TENANTS;
+ }
+
+ public UsersResource users() {
+ return USERS;
+ }
+
+ public RolesResource roles() {
+ return ROLES;
+ }
+
+ public ServicesResource services() {
+ return SERVICES;
+ }
+
+ public EndpointsResource endpoints() {
+ return ENDPOINTS;
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/EndpointsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/EndpointsResource.java
new file mode 100644
index 000000000..acc128b89
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/EndpointsResource.java
@@ -0,0 +1,71 @@
+package com.woorea.openstack.keystone.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.keystone.model.Endpoint;
+import com.woorea.openstack.keystone.model.Endpoints;
+
+public class EndpointsResource {
+
+ private OpenStackClient client;
+
+ public EndpointsResource(OpenStackClient client) {
+ this.client = client;
+ }
+
+ public List list() {
+ return new List();
+ }
+
+ public Create create(Endpoint endpoint) {
+ return new Create(endpoint);
+ }
+
+ public Show show(String id) {
+ return new Show(id);
+ }
+
+
+ public Delete delete(String id) {
+ return new Delete(id);
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List() {
+ super(client, HttpMethod.GET, "/endpoints", null, Endpoints.class);
+ }
+
+ }
+
+ public class Create extends OpenStackRequest {
+
+ private Endpoint endpoint;
+
+ public Create(Endpoint endpoint) {
+ super(client, HttpMethod.POST, "/endpoints", Entity.json(endpoint), Endpoint.class);
+ this.endpoint = endpoint;
+ }
+
+ }
+
+ public class Show extends OpenStackRequest {
+
+ public Show(String id) {
+ super(client, HttpMethod.GET, new StringBuilder("/endpoints/").append(id).toString(), null, Endpoint.class);
+ }
+
+ }
+
+ public class Delete extends OpenStackRequest {
+
+ public Delete(String id) {
+ super(client, HttpMethod.DELETE, new StringBuilder("/endpoints/").append(id).toString(), null, Void.class);
+ }
+
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/RolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/RolesResource.java
new file mode 100644
index 000000000..d39dc770e
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/RolesResource.java
@@ -0,0 +1,58 @@
+package com.woorea.openstack.keystone.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.keystone.model.Role;
+import com.woorea.openstack.keystone.model.Roles;
+
+public class RolesResource {
+
+ private OpenStackClient client;
+
+ public RolesResource(OpenStackClient client) {
+ this.client = client;
+ }
+
+ public List list() {
+ return new List();
+ }
+
+ public Create create(Role role) {
+ return new Create(role);
+ }
+
+ public Delete delete(String id) {
+ return new Delete(id);
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List() {
+ super(client, HttpMethod.GET, "/OS-KSADM/roles", null, Roles.class);
+ }
+
+ }
+
+ public class Create extends OpenStackRequest {
+
+ private Role role;
+
+ public Create(Role role) {
+ super(client, HttpMethod.POST, "/OS-KSADM/roles", Entity.json(role), Role.class);
+ this.role = role;
+ }
+
+ }
+
+ public class Delete extends OpenStackRequest {
+
+ public Delete(String id) {
+ super(client, HttpMethod.DELETE, new StringBuilder("/OS-KSADM/roles/").append(id).toString(), null, Void.class);
+ }
+
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/ServicesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/ServicesResource.java
new file mode 100644
index 000000000..5b1893974
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/ServicesResource.java
@@ -0,0 +1,70 @@
+package com.woorea.openstack.keystone.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.keystone.model.Service;
+import com.woorea.openstack.keystone.model.Services;
+
+public class ServicesResource {
+
+ private OpenStackClient client;
+
+ public ServicesResource(OpenStackClient client) {
+ this.client = client;
+ }
+
+ public List list() {
+ return new List();
+ }
+
+ public Create create(Service service) {
+ return new Create(service);
+ }
+
+ public Show show(String id) {
+ return new Show(id);
+ }
+
+ public Delete delete(String id) {
+ return new Delete(id);
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List() {
+ super(client, HttpMethod.GET, "/OS-KSADM/services", null, Services.class);
+ }
+
+ }
+
+ public class Create extends OpenStackRequest {
+
+ private Service service;
+
+ public Create(Service service) {
+ super(client, HttpMethod.POST, "/OS-KSADM/services", Entity.json(service), Service.class);
+ this.service = service;
+ }
+
+ }
+
+ public class Show extends OpenStackRequest {
+
+ public Show(String id) {
+ super(client, HttpMethod.GET, new StringBuilder("/OS-KSADM/services/").append(id).toString(), null, Service.class);
+ }
+
+ }
+
+ public class Delete extends OpenStackRequest {
+
+ public Delete(String id) {
+ super(client, HttpMethod.DELETE, new StringBuilder("/OS-KSADM/services/").append(id).toString(), null, Void.class);
+ }
+
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/TenantsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/TenantsResource.java
new file mode 100644
index 000000000..24a91f62f
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/TenantsResource.java
@@ -0,0 +1,135 @@
+package com.woorea.openstack.keystone.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.keystone.model.Roles;
+import com.woorea.openstack.keystone.model.Tenant;
+import com.woorea.openstack.keystone.model.Tenants;
+import com.woorea.openstack.keystone.model.Users;
+
+public class TenantsResource {
+
+ private OpenStackClient client;
+
+ public TenantsResource(OpenStackClient client) {
+ this.client = client;
+ }
+
+ public List list() {
+ return new List();
+ }
+
+ public Create create(Tenant tenant) {
+ return new Create(tenant);
+ }
+
+ public Show show(String id) {
+ return new Show(id);
+ }
+
+ public Update update(String id, Tenant tenant) {
+ return new Update(id, tenant);
+ }
+
+ public Delete delete(String id) {
+ return new Delete(id);
+ }
+
+ public ListUsers listUsers(String tenantId) {
+ return new ListUsers(tenantId);
+ }
+
+ public AddUser addUser(String tenantId, String userId, String roleId) {
+ return new AddUser(tenantId, userId, roleId);
+ }
+
+ public RemoveUser removeUser(String tenantId, String userId, String roleId) {
+ return new RemoveUser(tenantId, userId, roleId);
+ }
+
+ public ListUserRoles listUserRoles(String tenantId, String userId) {
+ return new ListUserRoles(tenantId, userId);
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List() {
+ super(client, HttpMethod.GET, "/tenants", null, Tenants.class);
+ }
+
+ }
+
+ public class Create extends OpenStackRequest {
+
+ private Tenant tenant;
+
+ public Create(Tenant tenant) {
+ super(client, HttpMethod.POST, "/tenants", Entity.json(tenant), Tenant.class);
+ this.tenant = tenant;
+ }
+
+ }
+
+ public class Show extends OpenStackRequest {
+
+ public Show(String id) {
+ super(client, HttpMethod.GET, new StringBuilder("/tenants/").append(id).toString(), null, Tenant.class);
+ }
+
+ }
+
+ public class Update extends OpenStackRequest {
+
+ private Tenant tenant;
+
+ public Update(String id, Tenant tenant) {
+ super(client, HttpMethod.PUT, new StringBuilder("/tenants/").append(id).toString(), Entity.json(tenant), Tenant.class);
+ this.tenant = tenant;
+ }
+
+ }
+
+ public class Delete extends OpenStackRequest {
+
+ public Delete(String id) {
+ super(client, HttpMethod.DELETE, new StringBuilder("/tenants/").append(id).toString(), null, Void.class);
+ }
+
+ }
+
+ public class ListUsers extends OpenStackRequest {
+
+ public ListUsers(String tenantId) {
+ super(client, HttpMethod.GET, new StringBuilder("/tenants/").append(tenantId).append("/users").toString(), null, Users.class);
+ }
+
+ }
+
+ public class AddUser extends OpenStackRequest {
+
+ public AddUser(String tenantId, String userId, String roleId) {
+ super(client, HttpMethod.PUT, new StringBuilder("/tenants/").append(tenantId).append("/users/").append(userId).append("/roles/OS-KSADM/").append(roleId).toString(), null, Void.class);
+ }
+
+ }
+
+ public class RemoveUser extends OpenStackRequest {
+
+ public RemoveUser(String tenantId, String userId, String roleId) {
+ super(client, HttpMethod.DELETE, new StringBuilder("/tenants/").append(tenantId).append("/users/").append(userId).append("/roles/OS-KSADM/").append(roleId).toString(), null, Void.class);
+ }
+
+ }
+
+ public class ListUserRoles extends OpenStackRequest {
+
+ public ListUserRoles(String tenantId, String userId) {
+ super(client, HttpMethod.GET, new StringBuilder("/tenants/").append(tenantId).append("/users/").append(userId).append("/roles").toString(), null, Roles.class);
+ }
+
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/TokensResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/TokensResource.java
new file mode 100644
index 000000000..b9f1cfc88
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/TokensResource.java
@@ -0,0 +1,74 @@
+package com.woorea.openstack.keystone.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.keystone.model.Access;
+import com.woorea.openstack.keystone.model.Authentication;
+import com.woorea.openstack.keystone.model.authentication.AccessKey;
+import com.woorea.openstack.keystone.model.authentication.TokenAuthentication;
+import com.woorea.openstack.keystone.model.authentication.UsernamePassword;
+
+public class TokensResource {
+
+ private final OpenStackClient CLIENT;
+
+ public TokensResource(OpenStackClient client) {
+ CLIENT = client;
+ }
+
+ public Authenticate.Builder authenticate() {
+ return new Authenticate().new Builder();
+ }
+
+ public Authenticate authenticate(Authentication authentication) {
+ return new Authenticate(authentication);
+ }
+
+ public class Authenticate extends OpenStackRequest {
+
+ private Authentication authentication;
+
+ public Authenticate() {
+
+ }
+
+ public Authenticate(Authentication authentication) {
+ super(CLIENT, HttpMethod.POST, "/tokens", Entity.json(authentication), Access.class);
+ this.authentication = authentication;
+ }
+
+ public Authenticate withTenantId(String tenantId) {
+ authentication.setTenantId(tenantId);
+ return this;
+ }
+
+ public Authenticate withTenantName(String tenantName) {
+ authentication.setTenantName(tenantName);
+ return this;
+ }
+
+ public class Builder {
+
+ public Authenticate withUsernamePassword(String username, String password) {
+ Authentication authentication = new UsernamePassword(username, password);
+ return new Authenticate(authentication);
+ }
+
+ public Authenticate withToken(String token) {
+ Authentication authentication = new TokenAuthentication(token);
+ return new Authenticate(authentication);
+ }
+
+ public Authenticate withAccessKey(String accessKey, String secretKey) {
+ Authentication authentication = new AccessKey(accessKey, secretKey);
+ return new Authenticate(authentication);
+ }
+
+ }
+
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/UsersResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/UsersResource.java
new file mode 100644
index 000000000..dbb897cf5
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/UsersResource.java
@@ -0,0 +1,85 @@
+package com.woorea.openstack.keystone.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.keystone.model.User;
+import com.woorea.openstack.keystone.model.Users;
+
+public class UsersResource {
+
+ private OpenStackClient client;
+
+ public UsersResource(OpenStackClient client) {
+ this.client = client;
+ }
+
+ public List list() {
+ return new List();
+ }
+
+ public Create create(User user) {
+ return new Create(user);
+ }
+
+ public Show show(String id) {
+ return new Show(id);
+ }
+
+ public Update update(String id, User user) {
+ return new Update(id, user);
+ }
+
+ public Delete delete(String id) {
+ return new Delete(id);
+ }
+
+ public class List extends OpenStackRequest {
+
+ public List() {
+ super(client, HttpMethod.GET, "/users", null, Users.class);
+ }
+
+ }
+
+ public class Create extends OpenStackRequest {
+
+ private User user;
+
+ public Create(User user) {
+ super(client, HttpMethod.POST, "/users", Entity.json(user), User.class);
+ this.user = user;
+ }
+
+ }
+
+ public class Show extends OpenStackRequest {
+
+ public Show(String id) {
+ super(client, HttpMethod.GET, new StringBuilder("/users/").append(id).toString(), null, User.class);
+ }
+
+ }
+
+ public class Update extends OpenStackRequest {
+
+ private User user;
+
+ public Update(String id, User user) {
+ super(client, HttpMethod.PUT, new StringBuilder("/users/").append(id).toString(), Entity.json(user), User.class);
+ this.user = user;
+ }
+
+ }
+
+ public class Delete extends OpenStackRequest {
+
+ public Delete(String id) {
+ super(client, HttpMethod.DELETE, new StringBuilder("/users/").append(id).toString(), null, Void.class);
+ }
+
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneTokenProvider.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneTokenProvider.java
new file mode 100644
index 000000000..fb5127abe
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneTokenProvider.java
@@ -0,0 +1,56 @@
+package com.woorea.openstack.keystone.utils;
+
+import java.util.concurrent.ConcurrentHashMap;
+
+import com.woorea.openstack.base.client.OpenStackTokenProvider;
+import com.woorea.openstack.keystone.Keystone;
+import com.woorea.openstack.keystone.model.Access;
+import com.woorea.openstack.keystone.model.authentication.UsernamePassword;
+
+public class KeystoneTokenProvider {
+
+ protected Keystone keystone;
+
+ protected String username;
+
+ protected String password;
+
+ ConcurrentHashMap hashTenantAccess;
+
+ public KeystoneTokenProvider(String endpoint, String username, String password) {
+ this.keystone = new Keystone(endpoint);
+ this.username = username;
+ this.password = password;
+ this.hashTenantAccess = new ConcurrentHashMap();
+ }
+
+ public Access getAccessByTenant(String tenantName) {
+ Access access = hashTenantAccess.get(tenantName);
+ if (access == null) {
+ access = keystone.tokens().authenticate(new UsernamePassword(username, password))
+ .withTenantName(tenantName)
+ .execute();
+ hashTenantAccess.put(tenantName, access);
+ }
+ return access;
+ }
+
+ public void expireAccessByTenant(String tenantName) {
+ hashTenantAccess.remove(tenantName);
+ }
+
+ public OpenStackTokenProvider getProviderByTenant(final String tenantName) {
+ final KeystoneTokenProvider keystoneTokenProvider = this;
+ return new OpenStackTokenProvider() {
+ @Override
+ public String getToken() {
+ return keystoneTokenProvider.getAccessByTenant(tenantName)
+ .getToken().getId();
+ }
+ @Override
+ public void expireToken() {
+ keystoneTokenProvider.expireAccessByTenant(tenantName);
+ }
+ };
+ }
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneUtils.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneUtils.java
new file mode 100644
index 000000000..8269597db
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneUtils.java
@@ -0,0 +1,28 @@
+package com.woorea.openstack.keystone.utils;
+
+import java.util.List;
+
+import com.woorea.openstack.keystone.model.Access.Service;
+
+public class KeystoneUtils {
+
+ public static String findEndpointURL(List serviceCatalog, String type, String region, String facing) {
+ for(Service service : serviceCatalog) {
+ if(type.equals(service.getType())) {
+ for(Service.Endpoint endpoint : service.getEndpoints()) {
+ if(region == null || region.equals(endpoint.getRegion())) {
+ if(endpoint.getPublicURL() != null && facing.equals("public")) {
+ return endpoint.getPublicURL();
+ } else if(endpoint.getInternalURL() != null && facing.equals("internal")) {
+ return endpoint.getInternalURL();
+ } else if(endpoint.getAdminURL() != null && facing.equals("admin")) {
+ return endpoint.getAdminURL();
+ }
+ }
+ }
+ }
+ }
+ throw new RuntimeException("endpoint url not found");
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/Keystone.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/Keystone.java
new file mode 100644
index 000000000..6ff889cb5
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/Keystone.java
@@ -0,0 +1,73 @@
+package com.woorea.openstack.keystone.v3;
+
+import com.woorea.openstack.keystone.v3.api.DomainsResource;
+import com.woorea.openstack.keystone.v3.api.EndpointsResource;
+import com.woorea.openstack.keystone.v3.api.RolesResource;
+import com.woorea.openstack.keystone.v3.api.ServicesResource;
+import com.woorea.openstack.keystone.v3.api.ProjectsResource;
+import com.woorea.openstack.keystone.v3.api.TokensResource;
+import com.woorea.openstack.keystone.v3.api.UsersResource;
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackClientConnector;
+
+public class Keystone extends OpenStackClient {
+
+ private final TokensResource TOKENS;
+
+ private final DomainsResource DOMAINS;
+
+ private final ProjectsResource PROJECTS;
+
+ private final UsersResource USERS;
+
+ private final RolesResource ROLES;
+
+ private final ServicesResource SERVICES;
+
+ private final EndpointsResource ENDPOINTS;
+
+ public Keystone(String endpoint, OpenStackClientConnector connector) {
+ super(endpoint, connector);
+ TOKENS = new TokensResource(this);
+ DOMAINS = new DomainsResource(this);
+ PROJECTS = new ProjectsResource(this);
+ USERS = new UsersResource(this);
+ ROLES = new RolesResource(this);
+ SERVICES = new ServicesResource(this);
+ ENDPOINTS = new EndpointsResource(this);
+ }
+
+ public Keystone(String endpoint) {
+ this(endpoint, null);
+ }
+
+ public TokensResource tokens() {
+ return TOKENS;
+ }
+
+ public DomainsResource domains() {
+ return DOMAINS;
+ }
+
+ public ProjectsResource projects() {
+ return PROJECTS;
+ }
+
+ public UsersResource users() {
+ return USERS;
+ }
+
+ public RolesResource roles() {
+ return ROLES;
+ }
+
+ public ServicesResource services() {
+ return SERVICES;
+ }
+
+ public EndpointsResource endpoints() {
+ return ENDPOINTS;
+ }
+
+}
+
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/CredentialsResources.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/CredentialsResources.java
new file mode 100644
index 000000000..7be2620da
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/CredentialsResources.java
@@ -0,0 +1,13 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.keystone.v3.model.Credential;
+import com.woorea.openstack.keystone.v3.model.Credentials;
+
+public class CredentialsResources extends GenericResource {
+
+ public CredentialsResources(OpenStackClient client) {
+ super(client, "/credentials", Credential.class, Credentials.class);
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainGroupRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainGroupRolesResource.java
new file mode 100644
index 000000000..a041ba20b
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainGroupRolesResource.java
@@ -0,0 +1,13 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.keystone.v3.model.Role;
+import com.woorea.openstack.keystone.v3.model.Roles;
+
+public class DomainGroupRolesResource extends GenericResource {
+
+ public DomainGroupRolesResource(OpenStackClient client, String path) {
+ super(client, path, Role.class, Roles.class);
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java
new file mode 100644
index 000000000..9a6e8e566
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java
@@ -0,0 +1,24 @@
+package com.woorea.openstack.keystone.v3.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.keystone.model.Role;
+import com.woorea.openstack.keystone.model.Roles;
+
+public class DomainUserRolesResource extends GenericResource {
+
+ public DomainUserRolesResource(OpenStackClient client, String path) {
+ super(client, path, Role.class, Roles.class);
+ }
+
+ public OpenStackRequest add(String roleId) {
+ return new OpenStackRequest(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class);
+ }
+
+ public OpenStackRequest remove(String roleId) {
+ return new OpenStackRequest(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class);
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java
new file mode 100644
index 000000000..28015eec4
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java
@@ -0,0 +1,21 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.keystone.v3.model.Domain;
+import com.woorea.openstack.keystone.v3.model.Domains;
+
+public class DomainsResource extends GenericResource {
+
+ public DomainsResource(OpenStackClient client) {
+ super(client, "/domains", Domain.class, Domains.class);
+ }
+
+ public DomainUserRolesResource userRoles(String domainId, String userId) {
+ return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString());
+ }
+
+ public DomainUserRolesResource groupRoles(String domainId, String groupId) {
+ return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/groups/").append(groupId).append("/roles").toString());
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/EndpointsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/EndpointsResource.java
new file mode 100644
index 000000000..d1db88a14
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/EndpointsResource.java
@@ -0,0 +1,13 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.keystone.v3.model.Endpoint;
+import com.woorea.openstack.keystone.v3.model.Endpoints;
+
+public class EndpointsResource extends GenericResource {
+
+ public EndpointsResource(OpenStackClient client) {
+ super(client, "/endpoints", Endpoint.class, Endpoints.class);
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java
new file mode 100644
index 000000000..117e941df
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java
@@ -0,0 +1,44 @@
+package com.woorea.openstack.keystone.v3.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;
+
+public class GenericResource {
+
+ protected final OpenStackClient CLIENT;
+
+ protected CharSequence path;
+
+ protected Class oneClass;
+ protected Class manyClass;
+
+ public GenericResource(OpenStackClient client, CharSequence path, Class oneClass, Class manyClass) {
+ CLIENT = client;
+ this.path = path;
+ this.oneClass = oneClass;
+ this.manyClass = manyClass;
+ }
+
+ public OpenStackRequest list() {
+ return new OpenStackRequest(CLIENT, HttpMethod.GET, path, null, manyClass);
+ }
+
+ public OpenStackRequest create(One one) {
+ return new OpenStackRequest(CLIENT, HttpMethod.POST, path, Entity.json(one), oneClass);
+ }
+
+ public OpenStackRequest show(String id) {
+ return new OpenStackRequest(CLIENT, HttpMethod.GET, new StringBuilder(path).append("/").append(id).toString(), null, oneClass);
+ }
+
+ public OpenStackRequest update(String id, One one) {
+ return new OpenStackRequest(CLIENT, HttpMethod.PATCH, new StringBuilder(path).append("/").append(id).toString(), Entity.json(one), oneClass);
+ }
+
+ public OpenStackRequest delete(String id) {
+ return new OpenStackRequest(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(id).toString(), null, oneClass);
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupUsersResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupUsersResource.java
new file mode 100644
index 000000000..60cce41c4
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupUsersResource.java
@@ -0,0 +1,14 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.keystone.v3.model.User;
+import com.woorea.openstack.keystone.v3.model.Users;
+
+
+public class GroupUsersResource extends GenericResource {
+
+ public GroupUsersResource(OpenStackClient client, String path) {
+ super(client, path, User.class, Users.class);
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java
new file mode 100644
index 000000000..be380cc87
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java
@@ -0,0 +1,17 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.keystone.v3.model.Group;
+import com.woorea.openstack.keystone.v3.model.Groups;
+
+public class GroupsResource extends GenericResource {
+
+ public GroupsResource(OpenStackClient client) {
+ super(client, "/groups", Group.class, Groups.class);
+ }
+
+ public DomainUserRolesResource userRoles(String domainId, String userId) {
+ return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString());
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/PoliciesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/PoliciesResource.java
new file mode 100644
index 000000000..ba16a4657
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/PoliciesResource.java
@@ -0,0 +1,15 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.keystone.model.Role;
+import com.woorea.openstack.keystone.model.Roles;
+import com.woorea.openstack.keystone.v3.model.Policies;
+import com.woorea.openstack.keystone.v3.model.Policy;
+
+public class PoliciesResource extends GenericResource {
+
+ public PoliciesResource(OpenStackClient client) {
+ super(client, "/policies", Policy.class, Policies.class);
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectGroupRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectGroupRolesResource.java
new file mode 100644
index 000000000..caed8acd7
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectGroupRolesResource.java
@@ -0,0 +1,34 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackRequest;
+import com.woorea.openstack.keystone.model.Role;
+import com.woorea.openstack.keystone.model.Roles;
+
+public class ProjectGroupRolesResource extends GenericResource {
+
+ public ProjectGroupRolesResource(OpenStackClient client, String path) {
+ super(client, path, Role.class, Roles.class);
+ }
+
+ @Override
+ public OpenStackRequest create(Role one) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public OpenStackRequest show(String id) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public OpenStackRequest update(String id, Role one) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public OpenStackRequest delete(String id) {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java
new file mode 100644
index 000000000..7e7e2fa30
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java
@@ -0,0 +1,27 @@
+package com.woorea.openstack.keystone.v3.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;
+
+public class ProjectRolesResource {
+
+ private final OpenStackClient CLIENT;
+
+ private final String PATH;
+
+ public ProjectRolesResource(OpenStackClient client, String path) {
+ this.CLIENT = client;
+ this.PATH = path;
+ }
+
+ public OpenStackRequest add(String roleId) {
+ return new OpenStackRequest(CLIENT, HttpMethod.PUT, new StringBuilder(PATH).append("/").append(roleId).toString(), Entity.json(""), Void.class);
+ }
+
+ public OpenStackRequest remove(String roleId) {
+ return new OpenStackRequest(CLIENT, HttpMethod.DELETE, new StringBuilder(PATH).append("/").append(roleId).toString(), null, Void.class);
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java
new file mode 100644
index 000000000..9f3dc50d2
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java
@@ -0,0 +1,24 @@
+package com.woorea.openstack.keystone.v3.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.keystone.model.Role;
+import com.woorea.openstack.keystone.model.Roles;
+
+public class ProjectUserRolesResource extends GenericResource {
+
+ public ProjectUserRolesResource(OpenStackClient client, String path) {
+ super(client, path, Role.class, Roles.class);
+ }
+
+ public OpenStackRequest add(String roleId) {
+ return new OpenStackRequest(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class);
+ }
+
+ public OpenStackRequest remove(String roleId) {
+ return new OpenStackRequest(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class);
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java
new file mode 100644
index 000000000..2e9fd9ac9
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java
@@ -0,0 +1,27 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackRequest;
+import com.woorea.openstack.keystone.model.Users;
+import com.woorea.openstack.keystone.v3.model.Project;
+import com.woorea.openstack.keystone.v3.model.Projects;
+
+public class ProjectsResource extends GenericResource {
+
+ public ProjectsResource(OpenStackClient client) {
+ super(client, "/projects", Project.class, Projects.class);
+ }
+
+ public OpenStackRequest users(String projectId) {
+ return CLIENT.get(new StringBuilder(path).append("/").append(projectId).append("/users/").toString(), Users.class);
+ }
+
+ public ProjectUserRolesResource userRoles(String projectId, String userId) {
+ return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/users/").append(userId).append("/roles").toString());
+ }
+
+ public ProjectUserRolesResource groupRoles(String projectId, String groupId) {
+ return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/groups/").append(groupId).append("/roles").toString());
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java
new file mode 100644
index 000000000..2c28a1bfa
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java
@@ -0,0 +1,19 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackRequest;
+import com.woorea.openstack.keystone.v3.model.Role;
+import com.woorea.openstack.keystone.v3.model.Roles;
+import com.woorea.openstack.keystone.v3.model.Users;
+
+public class RolesResource extends GenericResource {
+
+ public RolesResource(OpenStackClient client) {
+ super(client, "/roles", Role.class, Roles.class);
+ }
+
+ public OpenStackRequest users(String domainId, String userId) {
+ return CLIENT.get(new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString(), Users.class);
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ServicesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ServicesResource.java
new file mode 100644
index 000000000..4742a2f04
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ServicesResource.java
@@ -0,0 +1,13 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.keystone.model.Service;
+import com.woorea.openstack.keystone.model.Services;
+
+public class ServicesResource extends GenericResource {
+
+ public ServicesResource(OpenStackClient client) {
+ super(client, "/services", Service.class, Services.class);
+ }
+
+}
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java
new file mode 100644
index 000000000..c2d53b300
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java
@@ -0,0 +1,42 @@
+package com.woorea.openstack.keystone.v3.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.keystone.v3.model.Authentication;
+import com.woorea.openstack.keystone.v3.model.Token;
+
+public class TokensResource {
+
+ private final OpenStackClient CLIENT;
+
+ public TokensResource(OpenStackClient client) {
+ CLIENT = client;
+ }
+
+ public Authenticate authenticate(Authentication authentication) {
+ return new Authenticate(authentication);
+ }
+
+ public OpenStackRequest show() {
+ return CLIENT.get("/auth/tokens", Token.class);
+ }
+
+ public class Authenticate extends OpenStackRequest {
+
+ private Authentication authentication;
+
+ public Authenticate() {
+
+ }
+
+ public Authenticate(Authentication authentication) {
+ super(CLIENT, HttpMethod.POST, "/auth/tokens", Entity.json(authentication), Token.class);
+ this.authentication = authentication;
+ }
+
+ }
+
+}
+
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java
new file mode 100644
index 000000000..d6a6d1400
--- /dev/null
+++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java
@@ -0,0 +1,27 @@
+package com.woorea.openstack.keystone.v3.api;
+
+import com.woorea.openstack.base.client.OpenStackClient;
+import com.woorea.openstack.base.client.OpenStackRequest;
+import com.woorea.openstack.keystone.model.Services;
+import com.woorea.openstack.keystone.v3.model.User;
+import com.woorea.openstack.keystone.v3.model.Users;
+
+public class UsersResource extends GenericResource {
+
+ public UsersResource(OpenStackClient client) {
+ super(client, "/users", User.class, Users.class);
+ }
+
+ public OpenStackRequest groups(String userId) {
+ return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/groups").toString(), Services.class);
+ }
+
+ public OpenStackRequest projects(String userId) {
+ return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/projects").toString(), Services.class);
+ }
+
+ public OpenStackRequest roles(String userId) {
+ return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/roles").toString(), Services.class);
+ }
+
+}
diff --git a/keystone-model/pom.xml b/keystone-model/pom.xml
new file mode 100644
index 000000000..2ee5b28f3
--- /dev/null
+++ b/keystone-model/pom.xml
@@ -0,0 +1,11 @@
+
+ 4.0.0
+
+ com.woorea
+ openstack-java-sdk
+ 3.2.10-SNAPSHOT
+
+ keystone-model
+ OpenStack Keystone Model
+ OpenStack Keystone Model
+
\ No newline at end of file
diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Access.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Access.java
new file mode 100644
index 000000000..f4f37d80a
--- /dev/null
+++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Access.java
@@ -0,0 +1,252 @@
+package com.woorea.openstack.keystone.model;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("access")
+public class Access implements Serializable {
+
+ public static final class Service {
+
+ @JsonIgnoreProperties(ignoreUnknown=true)
+ public static final class Endpoint {
+
+ private String region;
+
+ private String publicURL;
+
+ private String internalURL;
+
+ private String adminURL;
+
+ /**
+ * @return the region
+ */
+ public String getRegion() {
+ return region;
+ }
+
+ /**
+ * @return the publicURL
+ */
+ public String getPublicURL() {
+ return publicURL;
+ }
+
+ /**
+ * @return the internalURL
+ */
+ public String getInternalURL() {
+ return internalURL;
+ }
+
+ /**
+ * @return the adminURL
+ */
+ public String getAdminURL() {
+ return adminURL;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Endpoint [region=" + region + ", publicURL="
+ + publicURL + ", internalURL=" + internalURL
+ + ", adminURL=" + adminURL + "]";
+ }
+
+ }
+
+ private String type;
+
+ private String name;
+
+ private List endpoints;
+
+ @JsonProperty("endpoints_links")
+ private List endpointsLinks;
+
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the endpoints
+ */
+ public List getEndpoints() {
+ return endpoints;
+ }
+
+ /**
+ * @return the endpointsLinks
+ */
+ public List getEndpointsLinks() {
+ return endpointsLinks;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Service [type=" + type + ", name=" + name + ", endpoints="
+ + endpoints + ", endpointsLinks=" + endpointsLinks + "]";
+ }
+
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown=true)
+ public static final class User {
+
+ @JsonIgnoreProperties(ignoreUnknown=true)
+ public static final class Role {
+
+ private String id;
+
+ private String name;
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Role [id=" + id + ", name=" + name + "]";
+ }
+
+ }
+
+ private String id;
+
+ private String name;
+
+ private String username;
+
+ private List roles;
+
+ @JsonProperty("roles_links")
+ private List rolesLinks;
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the username
+ */
+ public String getUsername() {
+ return username;
+ }
+
+ /**
+ * @return the roles
+ */
+ public List getRoles() {
+ return roles;
+ }
+
+ /**
+ * @return the rolesLinks
+ */
+ public List getRolesLinks() {
+ return rolesLinks;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "User [id=" + id + ", name=" + name + ", username="
+ + username + ", roles=" + roles + ", rolesLinks="
+ + rolesLinks + "]";
+ }
+
+ }
+
+ private Token token;
+
+ private List serviceCatalog;
+
+ private User user;
+
+ private Map metadata;
+
+ /**
+ * @return the token
+ */
+ public Token getToken() {
+ return token;
+ }
+
+ /**
+ * @return the serviceCatalog
+ */
+ public List getServiceCatalog() {
+ return serviceCatalog;
+ }
+
+ /**
+ * @return the user
+ */
+ public User getUser() {
+ return user;
+ }
+
+ /**
+ * @return the metadata
+ */
+ public Map getMetadata() {
+ return metadata;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Access [token=" + token + ", serviceCatalog=" + serviceCatalog
+ + ", user=" + user + ", metadata=" + metadata + "]";
+ }
+
+}
diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Authentication.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Authentication.java
new file mode 100644
index 000000000..b795b3d05
--- /dev/null
+++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Authentication.java
@@ -0,0 +1,41 @@
+package com.woorea.openstack.keystone.model;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+public abstract class Authentication implements Serializable {
+
+ private String tenantId;
+
+ private String tenantName;
+
+ /**
+ * @return the tenantId
+ */
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ /**
+ * @param tenantId the tenantId to set
+ */
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ /**
+ * @return the tenantName
+ */
+ public String getTenantName() {
+ return tenantName;
+ }
+
+ /**
+ * @param tenantName the tenantName to set
+ */
+ public void setTenantName(String tenantName) {
+ this.tenantName = tenantName;
+ }
+
+}
diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoint.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoint.java
new file mode 100644
index 000000000..77f195d7d
--- /dev/null
+++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoint.java
@@ -0,0 +1,121 @@
+package com.woorea.openstack.keystone.model;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("endpoint")
+public class Endpoint implements Serializable {
+
+ private String id;
+
+ @JsonProperty("service_id")
+ private String serviceId;
+
+ private String region;
+
+ @JsonProperty("publicurl")
+ private String publicURL;
+
+ @JsonProperty("internalurl")
+ private String internalURL;
+
+ @JsonProperty("adminurl")
+ private String adminURL;
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the serviceId
+ */
+ public String getServiceId() {
+ return serviceId;
+ }
+
+ /**
+ * @param serviceId the serviceId to set
+ */
+ public void setServiceId(String serviceId) {
+ this.serviceId = serviceId;
+ }
+
+ /**
+ * @return the region
+ */
+ public String getRegion() {
+ return region;
+ }
+
+ /**
+ * @param region the region to set
+ */
+ public void setRegion(String region) {
+ this.region = region;
+ }
+
+ /**
+ * @return the publicURL
+ */
+ public String getPublicURL() {
+ return publicURL;
+ }
+
+ /**
+ * @param publicURL the publicURL to set
+ */
+ public void setPublicURL(String publicURL) {
+ this.publicURL = publicURL;
+ }
+
+ /**
+ * @return the internalURL
+ */
+ public String getInternalURL() {
+ return internalURL;
+ }
+
+ /**
+ * @param internalURL the internalURL to set
+ */
+ public void setInternalURL(String internalURL) {
+ this.internalURL = internalURL;
+ }
+
+ /**
+ * @return the adminURL
+ */
+ public String getAdminURL() {
+ return adminURL;
+ }
+
+ /**
+ * @param adminURL the adminURL to set
+ */
+ public void setAdminURL(String adminURL) {
+ this.adminURL = adminURL;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Endpoint [id=" + id + ", serviceId=" + serviceId + ", region="
+ + region + ", publicURL=" + publicURL + ", internalURL="
+ + internalURL + ", adminURL=" + adminURL + "]";
+ }
+
+}
diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoints.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoints.java
new file mode 100644
index 000000000..395ce3671
--- /dev/null
+++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoints.java
@@ -0,0 +1,34 @@
+package com.woorea.openstack.keystone.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Endpoints implements Iterable, Serializable {
+
+ @JsonProperty("endpoints")
+ private List list;
+
+ /**
+ * @return the list
+ */
+ public List getList() {
+ return list;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Endpoints [list=" + list + "]";
+ }
+
+ @Override
+ public Iterator iterator() {
+ return list.iterator();
+ }
+
+}
diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Error.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Error.java
new file mode 100644
index 000000000..b8997c565
--- /dev/null
+++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Error.java
@@ -0,0 +1,46 @@
+package com.woorea.openstack.keystone.model;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("error")
+public class Error implements Serializable {
+
+ private Integer code;
+
+ private String title;
+
+ private String message;
+
+ /**
+ * @return the code
+ */
+ public Integer getCode() {
+ return code;
+ }
+
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * @return the message
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Error [code=" + code + ", title=" + title + ", message="
+ + message + "]";
+ }
+
+}
diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Link.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Link.java
new file mode 100644
index 000000000..a673bcaea
--- /dev/null
+++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Link.java
@@ -0,0 +1,42 @@
+package com.woorea.openstack.keystone.model;
+
+import java.io.Serializable;
+
+public class Link implements Serializable {
+
+ private String rel;
+
+ private String href;
+
+ private String type;
+
+ /**
+ * @return the rel
+ */
+ public String getRel() {
+ return rel;
+ }
+
+ /**
+ * @return the href
+ */
+ public String getHref() {
+ return href;
+ }
+
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "Link [rel=" + rel + ", href=" + href + ", type=" + type + "]";
+ }
+
+}
diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Role.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Role.java
new file mode 100644
index 000000000..cddd06ee7
--- /dev/null
+++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Role.java
@@ -0,0 +1,67 @@
+package com.woorea.openstack.keystone.model;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("role")
+public class Role implements Serializable {
+
+ private String id;
+
+ private String name;
+
+ private String description;
+
+ private String enabled;
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * @return the enabled
+ */
+ public String getEnabled() {
+ return enabled;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(String enabled) {
+ this.enabled = enabled;
+ }
+
+}
diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Roles.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Roles.java
new file mode 100644
index 000000000..669612b57
--- /dev/null
+++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Roles.java
@@ -0,0 +1,34 @@
+package com.woorea.openstack.keystone.model;
+
+import java.io.Serializable;
+import java.util.Iterator;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Roles implements Iterable, Serializable {
+
+ @JsonProperty("roles")
+ private List